Skip to content

Commit

Permalink
am: --rebasing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Mar 5, 2008
1 parent e72c740 commit 3041c32
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
10 changes: 9 additions & 1 deletion contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,15 @@ __git_ps1 ()
local b
if [ -d "$g/../.dotest" ]
then
r="|AM/REBASE"
if test -f "$g/../.dotest/rebasing"
then
r="|REBASE"
elif test -f "$g/../.dotest/applying"
then
r="|AM"
else
r="|AM/REBASE"
fi
b="$(git symbolic-ref HEAD 2>/dev/null)"
elif [ -f "$g/.dotest-merge/interactive" ]
then
Expand Down
13 changes: 11 additions & 2 deletions git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ C= pass it through git-apply
p= pass it through git-apply
resolvemsg= override error message when patch failure occurs
r,resolved to be used after a patch failure
skip skip the current patch"
skip skip the current patch
rebasing (internal use for git-rebase)"

. git-sh-setup
prefix=$(git rev-parse --show-prefix)
Expand Down Expand Up @@ -122,7 +123,7 @@ reread_subject () {

prec=4
dotest=".dotest"
sign= utf8=t keep= skip= interactive= resolved= binary=
sign= utf8=t keep= skip= interactive= resolved= binary= rebasing=
resolvemsg= resume=
git_apply_opt=

Expand All @@ -147,6 +148,8 @@ do
resolved=t ;;
--skip)
skip=t ;;
--rebasing)
rebasing=t threeway=t keep=t binary=t ;;
-d|--dotest)
die "-d option is no longer supported. Do not use."
;;
Expand Down Expand Up @@ -237,6 +240,12 @@ else
echo "$utf8" >"$dotest/utf8"
echo "$keep" >"$dotest/keep"
echo 1 >"$dotest/next"
if test -n "$rebasing"
then
: >"$dotest/rebasing"
else
: >"$dotest/applying"
fi
fi

case "$resolved" in
Expand Down
2 changes: 1 addition & 1 deletion git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ fi
if test -z "$do_merge"
then
git format-patch -k --stdout --full-index --ignore-if-in-upstream "$upstream"..ORIG_HEAD |
git am $git_am_opt --binary -3 -k --resolvemsg="$RESOLVEMSG" &&
git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" &&
move_to_original_branch
ret=$?
test 0 != $ret -a -d .dotest &&
Expand Down

0 comments on commit 3041c32

Please sign in to comment.