From: "Michał Kiedrowicz" <michal.kiedrowicz@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: What's cooking in git.git (Apr 2012, #05; Thu, 12)
Date: Mon, 16 Apr 2012 23:32:18 +0200 [thread overview]
Message-ID: <20120416233218.54daa2f6@gmail.com> (raw)
In-Reply-To: <CA+55aFyAsF4jNvNMKC6divzAfyVmgrHvxJtnX0fjkpp_bLHkPQ@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Mon, Apr 16, 2012 at 11:02 AM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > Oddly, running that test in verbose mode seems to imply that it's the
> > *rebase* that succeeds, not the merges in that test. Maybe I'm reading
> > the test results wrong, I didn't really try to understand the test
> > itself ;(
>
> Yes, it's the rebase that succeeds. "git log -g" in the trash
> directory shows that we ended up successfully rebasing J2:
>
> commit 5fc34ec1a8ed96664198fefc74121cd052b10861
> Reflog: HEAD@{1} (C O Mitter <committer@example.com>)
> Reflog message: rebase -i (pick): Merge made by the 'recursive' strategy.
> Author: A U Thor <author@example.com>
> Date: Thu Apr 7 15:28:13 2005 -0700
>
> J2
>
> while a successful test will fail that.
>
> However, I don't actually see what changed.
>
> Oh - one thing to note is that the *patch* of that successful rebase
> is empty. That may be the big clue: we successfully finish the merge
> without noticing that it didn't change any state, and we should have
> failed it as an empty commit. Hmm?
>
> Linus
So, the difference is that `git merge --no-ff HEAD^` used to work, now
it doesn't because we reduce_heads() only if we allow fast-forward (and
even though there is just one remote we merge with, parents contains
two commits). So what about that trivial patch instead (discarding our
previous patches)?
---
diff --git a/builtin/merge.c b/builtin/merge.c
index 08e01e8..27e0026 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1346,6 +1346,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
allow_trivial = 0;
}
+ remoteheads = reduce_heads(remoteheads);
+
if (!remoteheads->next)
common = get_merge_bases(head_commit, remoteheads->item, 1);
else {
next prev parent reply other threads:[~2012-04-16 21:32 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 6:26 What's cooking in git.git (Apr 2012, #05; Thu, 12) Michal Kiedrowicz
2012-04-16 14:57 ` Linus Torvalds
2012-04-16 17:29 ` Junio C Hamano
2012-04-16 17:50 ` Linus Torvalds
2012-04-16 22:03 ` Junio C Hamano
2012-04-17 20:34 ` [PATCH 0/4] merge: reduce set of parents consistently Junio C Hamano
2012-04-17 20:34 ` [PATCH 1/4] git-merge: test octopus with redundant parents Junio C Hamano
2012-04-17 20:34 ` [PATCH 2/4] builtin/merge.c: remove "remoteheads" global variable Junio C Hamano
2012-04-17 20:34 ` [PATCH 3/4] builtin/merge.c: collect other parents early Junio C Hamano
2012-04-17 20:34 ` [PATCH 4/4] builtin/merge.c: reduce " Junio C Hamano
2012-04-16 17:36 ` What's cooking in git.git (Apr 2012, #05; Thu, 12) Junio C Hamano
2012-04-16 18:02 ` Linus Torvalds
2012-04-16 18:33 ` Linus Torvalds
2012-04-16 21:32 ` Michał Kiedrowicz [this message]
2012-04-17 1:22 ` Linus Torvalds
2012-04-17 18:25 ` [PATCH] git-merge: Reduce heads before trying to merge them Michał Kiedrowicz
2012-04-17 18:52 ` Junio C Hamano
2012-04-17 20:09 ` Linus Torvalds
2012-04-17 20:48 ` Junio C Hamano
2012-04-18 18:14 ` Michał Kiedrowicz
2012-04-18 20:20 ` Junio C Hamano
2012-04-19 5:19 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2012-04-12 22:41 What's cooking in git.git (Apr 2012, #05; Thu, 12) Junio C Hamano
2012-04-15 11:10 ` Clemens Buchacher
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=20120416233218.54daa2f6@gmail.com \
--to=michal.kiedrowicz@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=torvalds@linux-foundation.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).