From: Michael J Gruber <git@drmicha.warpmail.net>
To: Sitaram Chamarty <sitaramc@gmail.com>
Cc: git@vger.kernel.org, Stephen Haberman <stephen@exigencecorp.com>
Subject: Re: rebase -p confusion in 1.6.1
Date: Thu, 15 Jan 2009 14:39:37 +0100 [thread overview]
Message-ID: <496F3C99.1040800@drmicha.warpmail.net> (raw)
In-Reply-To: <slrngmu4j5.e1u.sitaramc@sitaramc.homelinux.net>
Sitaram Chamarty venit, vidit, dixit 15.01.2009 11:39:
> Hello all,
>
> While trying to understand "rebase -p", I came across some
> very unexpected behaviour that made me throw in the towel
> and ask for help!
>
> The outputs I got really confused me. Before the "rebase
> -p", the tree looked like
>
> * 78ffda9... (refs/heads/work) b4
> * be1e3a4... b3
> * cd8d893... Merge branch 'master' into work
> |\
> | * 0153c27... (refs/heads/master) a4
> | * 74f4387... a3
> * | f1b0c1c... b2
> * | 2e202d0... b1
> |/
> * b37ae36... a2
> * ed1e1bc... a1
>
> But afterward, this is what it looks like -- all the "b"
> commits are gone!
>
> * 0153c27... (refs/heads/work, refs/heads/master) a4
> * 74f4387... a3
> * b37ae36... a2
> * ed1e1bc... a1
>
> What did I do wrong/misunderstand?
>
> Here's how to recreate. Note that "testci" is a shell
> function and "lg" is a git alias. They are, respectively,
> (1) testci() { for i; do echo $i > $i; git add $i; git commit -m $i; done; }
> (2) git config alias.lg log --graph --pretty=oneline --abbrev-commit --decorate
>
> git init
> testci a1 a2
> git checkout -b work
> testci b1 b2
> git checkout master
> testci a3 a4
> git checkout work
> git merge master
> testci b3 b4
> git --no-pager lg # graph before rebase -p
> git rebase -p master
> git --no-pager lg # graph after rebase -p
>
First of all: git 1.6.0.6 gives you the unchanged graph after using
rebase -i -p (git 1.6.1 adds -i behind you back and sets up a dummy
editor). In any case, git rebase should not simply eat those commits -
either leave them alone or rewrite them. git bisect says
d80d6bc146232d81f1bb4bc58e5d89263fd228d4 is first bad commit
commit d80d6bc146232d81f1bb4bc58e5d89263fd228d4
Author: Stephen Haberman <stephen@exigencecorp.com>
Date: Wed Oct 15 02:44:39 2008 -0500
rebase-i-p: do not include non-first-parent commits touching UPSTREAM
so I'll cc the bad guy ;)
Second, what result do you expect? If the merge is to be preserved then
b1, b2 can't be simply ripped out - or else you get the linear structure
which rebase without '-p' delivers. The merge base (as returned by git
merge-base) between work and master is a4, i.e. master, so that the
expected result with '-p' is the one from 1.6.0.6 (unchanged graph).
Cheers,
Michael
next prev parent reply other threads:[~2009-01-15 13:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-15 10:39 rebase -p confusion in 1.6.1 Sitaram Chamarty
2009-01-15 13:34 ` Johannes Schindelin
2009-01-15 14:51 ` Sitaram Chamarty
2009-01-15 15:09 ` Stephan Beyer
2009-01-15 15:21 ` Sitaram Chamarty
2009-01-15 13:38 ` Stephan Beyer
2009-01-15 13:58 ` Johannes Schindelin
2009-01-15 15:03 ` Sitaram Chamarty
2009-01-15 13:39 ` Michael J Gruber [this message]
2009-01-15 13:55 ` Stephan Beyer
2009-01-15 14:14 ` Michael J Gruber
2009-01-15 14:25 ` Johannes Schindelin
2009-01-15 14:45 ` Michael J Gruber
2009-01-15 16:04 ` Johannes Schindelin
2009-01-15 16:24 ` Sitaram Chamarty
2009-01-15 16:53 ` Johannes Schindelin
2009-01-15 18:22 ` Sitaram Chamarty
2009-01-15 16:56 ` Michael J Gruber
2009-01-15 18:18 ` Johannes Schindelin
[not found] ` <cover.1232233454.git.stephen@exigencecorp.com>
2009-01-17 23:41 ` [PATCH] do not drop commits before the merge base Johannes Schindelin
[not found] ` <ac1a4533de095f916dd68029793c8ee6eb02d200.1232233454.git.stephen@exigencecorp.com>
[not found] ` <a524993b13ee586cf0e8fbd3b6459ccd6767c6d8.1232233454.git.stephen@exigencecorp.com>
2009-01-17 23:51 ` [PATCH] rebase -p: seed first commit in case it's before the merge bases Johannes Schindelin
2009-01-18 0:11 ` Stephen Haberman
2009-01-18 0:19 ` Johannes Schindelin
2009-01-18 3:57 ` Stephen Haberman
2009-01-18 4:02 ` Stephen Haberman
2009-01-15 14:40 ` rebase -p confusion in 1.6.1 Stephan Beyer
2009-01-15 16:43 ` Johannes Schindelin
2009-01-15 15:14 ` Sitaram Chamarty
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=496F3C99.1040800@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=sitaramc@gmail.com \
--cc=stephen@exigencecorp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.