git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 3/3] am: --rebasing
Date: Tue,  4 Mar 2008 00:25:06 -0800	[thread overview]
Message-ID: <1204619106-30449-3-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1204619106-30449-2-git-send-email-gitster@pobox.com>

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>
---
 contrib/completion/git-completion.bash |   10 +++++++++-
 git-am.sh                              |   13 +++++++++++--
 git-rebase.sh                          |    2 +-
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8f70e1e..5ae8799 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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
diff --git a/git-am.sh b/git-am.sh
index 25129e6..db8171c 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -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)
@@ -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=
 
@@ -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 not longer supported.  Do not use."
 		;;
@@ -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
diff --git a/git-rebase.sh b/git-rebase.sh
index 6b9af96..452c5e7 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -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 &&
-- 
1.5.4.3.529.gb25fb


  reply	other threads:[~2008-03-04  8:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04  8:25 [PATCH 1/3] am: read from the right mailbox when started from a subdirectory Junio C Hamano
2008-03-04  8:25 ` [PATCH 2/3] am: remove support for -d .dotest Junio C Hamano
2008-03-04  8:25   ` Junio C Hamano [this message]
2008-03-04  8:57   ` Jay Soffian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1204619106-30449-3-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).