From: Neal Kreitzinger <nkreitzinger@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Neal Kreitzinger <neal@rsss.com>, git@vger.kernel.org
Subject: Re: how do you review auto-resolved files
Date: Tue, 21 Feb 2012 17:22:09 -0600 [thread overview]
Message-ID: <4F442721.4080107@gmail.com> (raw)
In-Reply-To: <7vhayjga0a.fsf@alter.siamese.dyndns.org>
On 2/21/2012 3:19 PM, Junio C Hamano wrote:
> "Neal Kreitzinger"<neal@rsss.com> writes:
>
>> When git does a merges (merge/rebase/cherry-pick) it auto-resolves same-file
>> changes that do not conflict on the same line(s).
>>
>> Technical Question: What are the recommended commands for reviewing the
>> files that auto-resolved after a "merge"?
>
> Imagine that you are the maintainer of the mainline and are reviewing the
> work made on a side branch that you just merged, but pretend that the
> contribution came as a patch instead. How would you assess the damage to
> your mainline?
>
> You would use "git show --first-parent $commit" for that.
>
> And then look at what the sideline wanted to do to the old baseline:
>
> git log -p $commit^..$commit
>
> which would, unless the person who worked on the side branch did a shoddy
> job describing his work, explain what the side branch wanted to achieve
> and also _how_ it wanted to achieve it.
>
> And then re-read the first "git show" output with that knowledge, together
> with the knowledge you have on your mainline codebase, and decide if the
> solution used by the side branch is still valid. If it makes sense, you
> are done. If the advance in your mainline since the side branch forked
> invalidated some assumption the side branch made (e.g. a helper function
> the side branch used has changed its meaning, a helper function the side
> branch changed its meaning gained more callsite on the mainline, etc.),
> you have a semantic conflict that you would need to address.
>
> It is unclear what exactly you consider "auto-resolve" in your message, so
> I'd refrain from commenting on the "Philosophical" part, at least for now.
Context: (git-merge manpage definition of merge-conflict) "During a
merge, the working tree files are updated to reflect the result of the
merge... When both sides made changes to the same area, however, git
cannot randomly pick one side over the other, and asks you to resolve it
by leaving what both sides did to that area."
My definition for "auto-resolve": "During a merge, the working tree
files are updated to reflect the result of the merge... When both sides
made changes to different areas of the same file, git picks both sides
automatically, and leaves its up to you to make sure you review those
merge results for correctness after git has made the merge commit."
IOW, an "auto-resolve" specifically means that both sides (ours and
theirs) made changes to file(a) since the common-ancestor version of
fila(a), and git picked both sides without raising a merge-conflict.
(The reason I came up with the term "auto-resolve" is because in the
git-merge output the term "Auto-merging" can also indicate that only one
side (theirs) changed file(a) since the common-ancestor and that git is
just "fast-forwarding" theirs file(a) on top of common-ancestor file(a).)
v/r,
neal
next prev parent reply other threads:[~2012-02-21 23:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-21 20:41 how do you review auto-resolved files Neal Kreitzinger
2012-02-21 21:19 ` Junio C Hamano
2012-02-21 23:22 ` Neal Kreitzinger [this message]
2012-02-22 7:28 ` Jeff King
2012-02-22 15:24 ` Zbigniew Jędrzejewski-Szmek
2012-02-21 23:52 ` Junio C Hamano
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=4F442721.4080107@gmail.com \
--to=nkreitzinger@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=neal@rsss.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).