From: "Jörg Sommer" <joerg@alea.gnuu.de>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Why rebase with preserve merges asks for merged commits
Date: Fri, 21 Mar 2008 13:56:50 +0100 [thread overview]
Message-ID: <20080321125650.GA4587@alea.gnuu.de> (raw)
In-Reply-To: <alpine.LSU.1.00.0803210040270.4124@racer.site>
[-- Attachment #1: Type: text/plain, Size: 2736 bytes --]
Hallo Johannes,
Johannes Schindelin schrieb am Fri 21. Mar, 00:46 (+0100):
> On Thu, 20 Mar 2008, Jörg Sommer wrote:
>
> > diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> > index 62e65d7..c849415 100755
> > --- a/t/t3404-rebase-interactive.sh
> > +++ b/t/t3404-rebase-interactive.sh
> > @@ -362,4 +362,56 @@ test_expect_success 'rebase with a file named HEAD in worktree' '
> >
> > '
> >
> > +test_expect_success 'squash and preserve merges' '
> > + test_tick &&
> > + git checkout -b squash-and-preserve-merges master &&
> > + echo A > file1 &&
> > + git commit -m SaPM-1 file1 &&
> > + echo B > file1 &&
> > + git commit -m SaPM-2 file1 &&
> > + git merge to-be-preserved &&
> > + echo C > file1 &&
> > + git commit -m SaPM-3 file1
> > +'
> > +
> > +# This test should fail, because the prompt includes the commit from the
> > +# merge not only the merge:
> > +# -> pick 9604163 unrelated
> > +# pick 5ef0364 SaPM-1
> > +# pick 22aadcf SaPM-2
> > +# pick 828f7d8 Merge branch 'to-be-preserved' into squash-and-preserve-merges
> > +# pick 2a15a54 SaPM-3
> > +test_expect_failure 'expect preserve merges shown not commits from merge' '
> > + EXPECT_COUNT=4 FAKE_LINES="1 2 squash 4 3" \
> > + git rebase -i -p --onto branch1 master ||
> > + { git rebase --abort;
> > + EXPECT_COUNT=5 FAKE_LINES="1 2 3 squash 5 4" \
> > + git rebase -i -p --onto branch1 master;
> > + false; }
> > +'
>
> I'm sorry, but I have to tell you: I do not like that style at all (for
> one, your expect_failure can succeed for all kind of reasons, the exit
> value of git rebase --abort is not even checked).
Yes, it's ugly. So, let me step back. Think of the following situation:
M----------U to-be-preserved
\ \
`--A---B---+---C squash-and-preserve-merges
When I do a rebase M..C with preserve merges I can decide about all commits
including U which came in with the merge.
U pick 9604163 unrelated
A pick 5ef0364 SaPM-1
B pick 22aadcf SaPM-2
+ pick 828f7d8 Merge branch 'to-be-preserved' into squash-and-preserve-merges
C pick 2a15a54 SaPM-3
Why I can decide about the commit U from the branch to-be-preserved? I
expect to see not the commit from the merged branches, because they
aren't related to the branch to be rebased.
Let's take a different situation:
M--U1--U2--U3
\ \
`---A---B---+---C
A rebase M..C with preserve merges asks you about the commits M..U3, too.
Why? I preserve the merge that pulls in these commmits.
Bye, Jörg.
--
Die meisten Menschen wollen lieber durch Lob ruiniert
als durch Kritik gerettet werden.
[-- Attachment #2: Digital signature http://en.wikipedia.org/wiki/OpenPGP --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-03-21 13:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-20 0:03 [PATCH] New test for preserve merges and squash Jörg Sommer
2008-03-20 0:28 ` Junio C Hamano
2008-03-20 10:18 ` Jörg Sommer
2008-03-20 11:09 ` Johannes Schindelin
2008-03-20 13:01 ` [PATCH] New test for rebase with " Jörg Sommer
2008-03-20 23:46 ` Johannes Schindelin
2008-03-21 12:56 ` Jörg Sommer [this message]
2008-03-21 13:14 ` Why rebase with preserve merges asks for merged commits 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=20080321125650.GA4587@alea.gnuu.de \
--to=joerg@alea.gnuu.de \
--cc=Johannes.Schindelin@gmx.de \
--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).