big update
This commit is contained in:
parent
49bdae8bc6
commit
15f7d7fb9e
14 changed files with 104 additions and 10 deletions
16
bin/.local/bin/alm
Executable file
16
bin/.local/bin/alm
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
ISSUE_ID=
|
||||
|
||||
while read line; do
|
||||
if [[ "$line" == X-Redmine-Issue-Id:* ]]; then
|
||||
ISSUE_ID=${line##*: }
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $ISSUE_ID = "" ]]; then
|
||||
echo No issue id found
|
||||
exit 2
|
||||
else
|
||||
nohup xdg-open "https://alm.waarp.fr/issues/$ISSUE_ID" 1>/dev/null 2>&1 &
|
||||
fi
|
48
bin/.local/bin/git-f
Executable file
48
bin/.local/bin/git-f
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#set -x
|
||||
|
||||
usage() {
|
||||
cat <<EOT
|
||||
Usage: git f [COMMAND]
|
||||
|
||||
Available commands:
|
||||
|
||||
workon Switch to a branch for the given issue
|
||||
help Shows this message
|
||||
|
||||
EOT
|
||||
}
|
||||
|
||||
t_workon() {
|
||||
if [[ $1 == "" ]]; then
|
||||
cat <<EOT
|
||||
ERROR: No issue given
|
||||
|
||||
Usage: git f workon [ISSUE]
|
||||
EOT
|
||||
return 1
|
||||
fi
|
||||
|
||||
git fetch -p
|
||||
local branch=$(git branch -r | grep $1 | cut -d'/' -f2)
|
||||
|
||||
if [[ $branch == "" ]]; then
|
||||
echo ERROR: no branch found for this issue
|
||||
return 2
|
||||
fi
|
||||
|
||||
git checkout $branch
|
||||
}
|
||||
|
||||
ACTION=$1
|
||||
shift
|
||||
|
||||
case $ACTION in
|
||||
workon)
|
||||
t_workon $1
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue