am: --rebasing
The new option --rebasing is used internally for rebase to tell am that it is being used for its purpose. This would leave .dotest/rebasing to help "completion" scripts tell if the ongoing operation is am or rebase. Also the option at the same time stands for --binary, -3 and -k which are always given when rebase drives am as its backend. Using the information "am" leaves, git-completion.bash tells ongoing rebase and am apart. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Mar 4, 2008 at 00:25 UTC
3041c324305e2bad59d7372336940846646dd46a
3 files changed
+21
-4
contrib/completion/git-completion.bash
+9
-1
@@ -70,7 +70,15 @@ __git_ps1 ()
70
local b
71
if [ -d "$g/../.dotest" ]
72
then
73
- r="|AM/REBASE"
73
+ if test -f "$g/../.dotest/rebasing"
74
+ then
75
+ r="|REBASE"
76
+ elif test -f "$g/../.dotest/applying"
77
+ then
78
+ r="|AM"
79
+ else
80
+ r="|AM/REBASE"
81
+ fi
82
b="$(git symbolic-ref HEAD 2>/dev/null)"
83
elif [ -f "$g/.dotest-merge/interactive" ]
84
then
git-am.sh
+11
-2
@@ -21,7 +21,8 @@ C= pass it through git-apply
21
p= pass it through git-apply
22
resolvemsg= override error message when patch failure occurs
23
r,resolved to be used after a patch failure
24
-skip skip the current patch"
24
+skip skip the current patch
25
+rebasing (internal use for git-rebase)"
26
27
. git-sh-setup
28
prefix=$(git rev-parse --show-prefix)
@@ -122,7 +123,7 @@ reread_subject () {
123
124
prec=4
125
dotest=".dotest"
125
-sign= utf8=t keep= skip= interactive= resolved= binary=
126
+sign= utf8=t keep= skip= interactive= resolved= binary= rebasing=
127
resolvemsg= resume=
128
git_apply_opt=
129
@@ -147,6 +148,8 @@ do
148
resolved=t ;;
149
--skip)
150
skip=t ;;
151
+ --rebasing)
152
+ rebasing=t threeway=t keep=t binary=t ;;
153
-d|--dotest)
154
die "-d option is no longer supported. Do not use."
155
;;
@@ -237,6 +240,12 @@ else
240
echo "$utf8" >"$dotest/utf8"
241
echo "$keep" >"$dotest/keep"
242
echo 1 >"$dotest/next"
243
+ if test -n "$rebasing"
244
+ then
245
+ : >"$dotest/rebasing"
246
+ else
247
+ : >"$dotest/applying"
248
+ fi
249
fi
250
251
case "$resolved" in
git-rebase.sh
+1
-1
@@ -376,7 +376,7 @@ fi
376
if test -z "$do_merge"
377
then
378
git format-patch -k --stdout --full-index --ignore-if-in-upstream "$upstream"..ORIG_HEAD |
379
- git am $git_am_opt --binary -3 -k --resolvemsg="$RESOLVEMSG" &&
379
+ git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" &&
380
move_to_original_branch
381
ret=$?
382
test 0 != $ret -a -d .dotest &&