From: John Keeping <john@keeping.me.uk>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Ted Felix <ted@tedfelix.com>,
John Keeping <john@keeping.me.uk>
Subject: [PATCH v2 1/2] rebase--am: use --cherry-pick instead of --ignore-if-in-upstream
Date: Wed, 16 Jul 2014 20:23:48 +0100 [thread overview]
Message-ID: <47e67c62fb2a8c8846f5d3a12d71aebf8fa875d7.1405538598.git.john@keeping.me.uk> (raw)
In-Reply-To: <xmqqmwcatgza.fsf@gitster.dls.corp.google.com>
When using `git format-patch --ignore-if-in-upstream` we are only
allowed to give a single revision range. In the next commit we will
want to add an additional exclusion revision in order to handle fork
points correctly, so convert `git-rebase--am` to use a symmetric
difference with `--cherry-pick --right-only`.
This does not change the result of the format-patch invocation, just how
we spell the arguments.
Signed-off-by: John Keeping <john@keeping.me.uk>
---
Unchanged from v1.
git-rebase--am.sh | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/git-rebase--am.sh b/git-rebase--am.sh
index ca20e1e..902bf2d 100644
--- a/git-rebase--am.sh
+++ b/git-rebase--am.sh
@@ -29,7 +29,13 @@ skip)
;;
esac
-test -n "$rebase_root" && root_flag=--root
+if test -z "$rebase_root"
+ # this is now equivalent to ! -z "$upstream"
+then
+ revisions=$upstream...$orig_head
+else
+ revisions=$onto...$orig_head
+fi
ret=0
if test -n "$keep_empty"
@@ -38,14 +44,15 @@ then
# empty commits and even if it didn't the format doesn't really lend
# itself well to recording empty patches. fortunately, cherry-pick
# makes this easy
- git cherry-pick ${gpg_sign_opt:+"$gpg_sign_opt"} --allow-empty "$revisions"
+ git cherry-pick ${gpg_sign_opt:+"$gpg_sign_opt"} --allow-empty \
+ --right-only "$revisions"
ret=$?
else
rm -f "$GIT_DIR/rebased-patches"
- git format-patch -k --stdout --full-index --ignore-if-in-upstream \
+ git format-patch -k --stdout --full-index --cherry-pick --right-only \
--src-prefix=a/ --dst-prefix=b/ --no-renames --no-cover-letter \
- $root_flag "$revisions" >"$GIT_DIR/rebased-patches"
+ "$revisions" >"$GIT_DIR/rebased-patches"
ret=$?
if test 0 != $ret
--
2.0.1.472.g6f92e5f.dirty
next prev parent reply other threads:[~2014-07-16 19:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 15:14 [BUG] rebase no longer omits local commits Ted Felix
2014-07-03 19:09 ` John Keeping
2014-07-03 22:25 ` John Keeping
2014-07-07 17:56 ` Junio C Hamano
2014-07-07 21:14 ` John Keeping
2014-07-15 19:14 ` [PATCH 1/2] rebase--am: use --cherry-pick instead of --ignore-if-in-upstream John Keeping
2014-07-15 19:14 ` [PATCH 2/2] rebase: omit patch-identical commits with --fork-point John Keeping
2014-07-15 19:48 ` Ted Felix
2014-07-15 22:06 ` Junio C Hamano
2014-07-16 19:23 ` John Keeping [this message]
2014-07-16 19:23 ` [PATCH v2 " John Keeping
2014-07-16 20:26 ` Junio C Hamano
2014-07-16 21:27 ` John Keeping
2014-07-16 21:36 ` Ted Felix
2014-07-17 9:36 ` John Keeping
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=47e67c62fb2a8c8846f5d3a12d71aebf8fa875d7.1405538598.git.john@keeping.me.uk \
--to=john@keeping.me.uk \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ted@tedfelix.com \
/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).