-
Notifications
You must be signed in to change notification settings - Fork 1
/
git-cdd-fire
executable file
·62 lines (54 loc) · 1.19 KB
/
git-cdd-fire
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env sh
. cdd-shared
usage() {
echo "git cdd fire"
echo " "
echo "Commit your changes."
echo " "
echo "This passes all options through to git commit, except:"
echo " "
echo "-F, --file <file>"
echo "-m, --message <message>"
echo "-c, --reedit-message <commit>"
echo "-C, --reuse-message <commit>"
echo " "
echo "Check git commit -h for more information."
}
cmd_fire() {
if [ ! -e "$CDD_COMMIT_MSG" ]; then
echo "No commit message found."
echo " "
echo "Start your commit with git cdd aim or use the default git commit."
exit 1
fi
check_msg
value=false
for arg; do
if [ "$arg" = "--" ]; then
break
fi
case $arg in
-m | --message | --message=* | -F | --file | --file=* | -c | --reedit-message | --reedit-message=* | -C | --reuse-message | reuse-message=* )
value=true
;;
-*)
set -- "$@" "$arg"
value=false
;;
*)
if [ $value != true ]; then
set -- "$@" "$arg"
fi
echo "$arg"
value=false
;;
esac
shift
done
export editor
get_editor
"$editor" "$CDD_COMMIT_MSG"
unset editor
git commit -F "$CDD_COMMIT_MSG" "$@"
rm "$CDD_COMMIT_MSG"
}