From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Thomas Rast <trast@student.ethz.ch>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: [PATCH 1/2] rebase -i --root: simplify code
Date: Mon, 26 Jan 2009 00:31:55 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.1.00.0901260031460.14855@racer> (raw)
In-Reply-To: <alpine.DEB.1.00.0901260029480.14855@racer>
When we rebase with --root, what we are actually picking are the commits
in $ONTO..$HEAD. So $ONTO is really our $UPSTREAM. Spell it out.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
git-rebase--interactive.sh | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 21ac20c..6e2bf25 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -581,13 +581,15 @@ first and then run 'git rebase --continue' again."
if test -z "$REBASE_ROOT"
then
UPSTREAM_ARG="$1"
- UPSTREAM=$(git rev-parse --verify "$1") || die "Invalid base"
+ UPSTREAM=$(git rev-parse --verify "$1") ||
+ die "Invalid base"
test -z "$ONTO" && ONTO=$UPSTREAM
shift
else
UPSTREAM_ARG=--root
test -z "$ONTO" &&
die "You must specify --onto when using --root"
+ UPSTREAM=$ONTO
fi
run_pre_rebase_hook "$UPSTREAM_ARG" "$@"
@@ -648,16 +650,9 @@ first and then run 'git rebase --continue' again."
SHORTHEAD=$(git rev-parse --short $HEAD)
SHORTONTO=$(git rev-parse --short $ONTO)
- if test -z "$REBASE_ROOT"
- # this is now equivalent to ! -z "$UPSTREAM"
- then
- SHORTUPSTREAM=$(git rev-parse --short $UPSTREAM)
- REVISIONS=$UPSTREAM...$HEAD
- SHORTREVISIONS=$SHORTUPSTREAM..$SHORTHEAD
- else
- REVISIONS=$ONTO...$HEAD
- SHORTREVISIONS=$SHORTHEAD
- fi
+ SHORTUPSTREAM=$(git rev-parse --short $UPSTREAM)
+ REVISIONS=$UPSTREAM...$HEAD
+ SHORTREVISIONS=$SHORTUPSTREAM..$SHORTHEAD
git rev-list $MERGES_OPTION --pretty=oneline --abbrev-commit \
--abbrev=7 --reverse --left-right --topo-order \
$REVISIONS | \
--
1.6.1.482.g7d54be
next prev parent reply other threads:[~2009-01-25 23:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-25 23:31 [PATCH 0/2] rebase -i --root cleanups Johannes Schindelin
2009-01-25 23:31 ` Johannes Schindelin [this message]
2009-01-25 23:49 ` [PATCH 1/2] rebase -i --root: simplify code Thomas Rast
2009-01-25 23:53 ` Thomas Rast
2009-01-26 5:54 ` Junio C Hamano
2009-01-26 9:05 ` [PATCH] rebase -i: correctly remember --root flag across --continue Thomas Rast
2009-01-26 20:47 ` Junio C Hamano
2009-01-26 21:05 ` Junio C Hamano
2009-01-26 21:09 ` Jeff King
2009-01-26 21:12 ` Jeff King
2009-01-26 21:28 ` Thomas Rast
2009-01-27 0:29 ` Junio C Hamano
2009-01-26 21:49 ` Junio C Hamano
2009-01-30 22:43 ` Thomas Rast
2009-01-30 22:47 ` [PATCH 1/2] t3412: clean up GIT_EDITOR usage Thomas Rast
2009-01-30 22:47 ` [PATCH 2/2] t3412: use log|name-rev instead of log --graph Thomas Rast
2009-02-01 22:24 ` [PATCH 1/2] t3412: clean up GIT_EDITOR usage Johannes Schindelin
2009-02-02 8:39 ` Thomas Rast
2009-01-26 0:44 ` [PATCH 1/2] rebase -i --root: simplify code Johannes Schindelin
2009-01-25 23:32 ` [PATCH 2/2] rebase -i --root: fix check for number of arguments Johannes Schindelin
2009-01-26 0:07 ` Thomas Rast
2009-01-26 0:49 ` Johannes Schindelin
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=alpine.DEB.1.00.0901260031460.14855@racer \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=trast@student.ethz.ch \
/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