From: "Philip Oakley" <philipoakley@iee.org>
To: "Mike Stump" <mikestump@comcast.net>,
"Jakub Narębski" <jnareb@gmail.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>, <git@vger.kernel.org>
Subject: Re: cherry picking and merge
Date: Fri, 1 Aug 2014 19:57:04 +0100 [thread overview]
Message-ID: <4EA0D79811C348C6893039D315E6E190@PhilipOakley> (raw)
In-Reply-To: 5AF18A76-DD3B-4B9A-BF70-EFE4BB852C3D@comcast.net
From: "Mike Stump" <mikestump@comcast.net>
> On Aug 1, 2014, at 9:27 AM, Jakub Narębski <jnareb@gmail.com> wrote:
>>
>> Note that you should try to avoid cherry-picking, as they do not
>> leave trace in the graph of revisions.
>
> Fine, then I want a new command to merge in a change into my branch
> from another branch and I want merge to account for the motion and not
> duplicate it when I merge that branch back into master. Funny thing
> is, cherry and merge seem to be documented mostly to do exactly what I
> want.
>
>> For example if you are creating a bugfix, instead of putting it
>> directly on maint, and then cherry-picking to master, it is better
>> to create a separate feature branch for this fix
>
> You’re assuming that I’m the author of master, I’m not, I’m merely a
> contributor. This tail doesn’t wag that dog. What that means is that
> I cannot change the world to work around a simple bug in git.
>
>> There is also git-imerge, third party tool that is intended to help
>> merging changes (and make it possible to do it in incremental way).
>
> Then remove git merge and replace it with git-imerge. :-) Anyway, I
> read that, and I can see some beauty of that that might be nice in
> complex merges. The problem is, I want git merge to work.
>
>
> I was curious if svn handles this better the same or worse, and it did
> it just fine. I know that a while ago, svn could not handle this, it
> would do what git does currently. Apparently they figured out it was
> a bug and fixed it. Have you guys figured out it is a bug yet? The
> first step in solving a problem, is admitting you have a problem.
--
But that goes both ways, and is a philosophical issue about what is to
be expected in various cases. For some central control use styles, the
ideas behind _distributed_ version control are anathema and (Git) just
grinds away at the policies that are expected.
That said, Git doesn't claim to be perfect (and can't because of the
'relativity' that comes with being distributed - truth has to give way
to a web of trust). Also the artefacts that Git validates are at a
different level of abstraction i.e. the whole project as a commit,
rather than just a few/one file at a time.
In your example (when generalised) the problem is deciding when, in the
change sequence, the cherry pick is to be backed out, especially if
there are conflicts in the change sequence that would need fixing
anyway, and in a long change sequence that would be a lot of conflict
fix-ups, hence the current choice of getting the merge conflicts all
resolved in the one go.
The alternate case, mentioned/implied by Brian, is to use a rebase
(probably after duplicating the branch so as to retain the original if
required) so as to see each patch/changeset being applied, and doing
any/many conflit resolutions as they appear, before finally doing any
merge of the new line of development back into the mainline (which again
presumes your earlier resolutions don't cause more conflicts on that
merge). But do note that I've hidden the problem of deciding where the
rebase start point should be, relative to the merge point, because
that's actually where the original problem is hidden (which bits merge
with what!)
git-imerge is a visual tool to show which bits merge cleanly with what
between two change sequences.
Selecting a compatible workflow is a problem of usage, rather than a
problem in Git. If Git has a problem, it's that it has too many ways of
doing things, leaving most of us with too much rope entangled round our
neck.
--
Philip
next prev parent reply other threads:[~2014-08-01 18:57 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 0:58 cherry picking and merge Mike Stump
2014-08-01 2:43 ` brian m. carlson
2014-08-01 16:27 ` Jakub Narębski
2014-08-01 17:48 ` Mike Stump
2014-08-01 18:57 ` Philip Oakley [this message]
2014-08-01 22:10 ` Mike Stump
2014-08-02 10:39 ` Philip Oakley
2014-08-02 16:29 ` Philip Oakley
[not found] ` <CANQwDwc4YPdK+a0Oc-jWPTRyM5GiP-CMuRY1inxJY41GwUGBvQ@mail.gmail.com>
2014-08-01 19:01 ` Fwd: " Jakub Narębski
2014-08-01 22:24 ` Mike Stump
2014-08-02 11:44 ` Philip Oakley
2014-08-06 15:43 ` Jakub Narębski
2014-08-06 18:41 ` Mike Stump
2014-08-01 20:12 ` Sam Vilain
2014-08-01 23:06 ` Mike Stump
2014-08-01 23:40 ` Nico Williams
2014-08-02 0:18 ` Alex Davidson
2014-08-06 19:11 ` Mike Stump
2014-08-06 19:44 ` Rebase safely (Re: cherry picking and merge) Nico Williams
2014-08-06 20:13 ` Nico Williams
[not found] ` <A769B84E-42D1-44AC-B0A8-0F4E68AB71FB@comcast.net>
2014-08-07 5:11 ` Nico Williams
2014-08-08 17:34 ` Mike Stump
2014-08-08 18:27 ` Nico Williams
2014-08-08 16:23 ` Fwd: " Mike Stump
2014-08-01 16:56 ` cherry picking and merge Mike Stump
2014-08-21 17:36 ` Keller, Jacob E
2014-08-21 17:58 ` Keller, Jacob E
2014-08-01 19:22 ` Nico Williams
2014-08-01 22:13 ` Mike Stump
2014-08-01 22:19 ` Nico Williams
2014-08-01 20:02 ` Jonathan Nieder
2014-08-01 20:50 ` Jonathan Nieder
2014-08-01 20:55 ` Nico Williams
2014-08-01 21:44 ` Junio C Hamano
2014-08-01 22:00 ` Nico Williams
2014-08-01 22:09 ` Junio C Hamano
2014-08-06 15:58 ` Jakub Narębski
2014-08-06 16:26 ` Nico Williams
2014-08-06 23:16 ` Junio C Hamano
2014-08-06 23:20 ` Junio C Hamano
2014-08-01 23:47 ` Mike Stump
2014-08-01 22:35 ` Mike Stump
2014-08-01 22:42 ` Jonathan Nieder
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=4EA0D79811C348C6893039D315E6E190@PhilipOakley \
--to=philipoakley@iee.org \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=mikestump@comcast.net \
--cc=sandals@crustytoothpaste.net \
/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