git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: skillzero@gmail.com
Cc: git@vger.kernel.org
Subject: Re: git merge and cherry-pick and duplicated commits?
Date: Wed, 14 Jan 2009 12:16:56 -0800	[thread overview]
Message-ID: <7v4p011w3r.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <2729632a0901141033p47b4d8dah46f5bac27307d306@mail.gmail.com> (skillzero@gmail.com's message of "Wed, 14 Jan 2009 10:33:02 -0800")

skillzero@gmail.com writes:

> Related to this, is there a way to easily find the common merge base
> given a bunch of a branches? When I want to fix a bug, I want to say
> "Given branches A, B, C, D, and E, where should I fork my bug fix
> branch from so that I can merge this branch into all those branches
> without getting duplicate commits?".

You do not necessarily have to fork from, nor merge into, any of them.

If you fixed a bug, you would hopefully know where the bug was injected at
into your history.  You may have bisected it down to one commit $BAD.  You
can fork your fix on top of that $BAD commit:

	$ git checkout -b fix-bug-foo $BAD

All of the branches that share the commit have the bug, so your fix could
be merged to all of them if you really wanted to, and you should do so if
these A...E branches are meant to be consumed on their own.

But if the branches A...E you are about are for developing independent
topics, and if their theme won't get affected by the bug, it is much
better not to merge the fix in.  You will have the merge for the fix in
your integration branch anyway.  It is preferable not to contaminate an
independent topic branch whose purpose is to cook its own theme with an
unrelated bugfix, even if it is brought in as a merge.

  parent reply	other threads:[~2009-01-14 20:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14  2:40 git merge and cherry-pick and duplicated commits? skillzero
2009-01-14  5:31 ` Brian Gernhardt
2009-01-14  6:21   ` skillzero
2009-01-14  7:34     ` Johannes Sixt
2009-01-14  8:08       ` skillzero
2009-01-14  8:34         ` Johannes Sixt
2009-01-14 18:33           ` skillzero
2009-01-14 19:40             ` Peter Baumann
2009-01-14 20:16             ` Junio C Hamano [this message]
2009-01-15 23:09             ` Markus Heidelberg
2009-01-14  8:38         ` Boaz Harrosh
2009-01-14  8:41     ` Thomas Rast
2009-01-14 13:47       ` Alex Riesen
2009-01-14  7:33   ` skillzero
2009-01-14 15:53     ` Sitaram Chamarty
2009-01-14  8:31   ` Nanako Shiraishi

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=7v4p011w3r.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=skillzero@gmail.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).