From: "Neal Kreitzinger" <neal@rsss.com>
To: git@vger.kernel.org
Subject: how do you review auto-resolved files
Date: Tue, 21 Feb 2012 14:41:57 -0600 [thread overview]
Message-ID: <ji0vik$e48$1@dough.gmane.org> (raw)
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"?
It seems like the commands might be different depending on the type of
merge: git-merge, git-rebase, git-cherry-pick. I imagine there are three
steps to the "review auto-resolutions" procedure:
(1) Determine the list of files that were changed on both sides (same-file
edits) and which of those were auto-resolved during the merge. (Preferably
excluding those files that merge-conflicted since you already know how you
manually resolved those.)
(2) Review the auto-resolved files in full context to verify whether the
auto-resolutions are desirable.
(3) Manually remediate the merge-result (auto-resolution) or redo the
merge-of-that-file for any files with undesirable auto-resolutions. Perhaps
an edit of the auto-resolved file is sufficient for simple remediations, but
for more challenging remediations a manual redo of the merge-of-that-file
would be desired.
Please advise on the proven (tried and tested) ways that others are using to
verify/ensure that their auto-resolve results are correct.
Procedural/Philosophical Question: What are the pros and cons of
auto-resolved files?
Currently, we address the problem up-front instead of after-the-fact by
enforcing merge-conflicts on every same-file edit by means of a
"user-date-stamp" on "line 1" of every source file changed by performing
keyword expansion (# $User$ $Date$) in our pre-commit hook. I don't think
keyword expansion or forcing merge-conflicts for every same-file edit is a
common practice among git users. Therefore, this seems like somewhat of a
kludgey hack. Furthermore, I assume that all git users are somehow
reviewing their auto-resolutions. (There is no way I would assume that git
merged my same-file edits correctly. It's great that git
does-the-right-thing most-of-the-time, but that doesn't change the fact that
I still have to review everything for undesirable resolutions.)
In light of this, it seems that there is no advantage to letting git
auto-resolve same-file changes because the review process after-the-fact
would actually be more error-prone and tedious than just manually-merging
same-file edits up-front. If I force you to resolve merge-conflicts
up-front then I'm ensuring the merge-resolution is deliberate (and hopefully
intelligent). If I expect/assume you are going to review the
auto-resolutions after-the-fact then you can neglect this because you:
- have become complacent that git usually does-what-you-want so "you don't
really need to do it",
- are lazy and do it half-way,
- forget to do it,
- think "git magically does your work for you",
- don't know how to do it,
- don't even realize that anything auto-resolved or what auto-resolved,
- decide you don't have to do it because that is what testing if for,
- you think that your time is so valuable that an ounce-of-prevention on
your part is not worth a pound-of-cure on the part of others.
Please comment on the pros and cons of "manual-merge up-front for same-file
edits" vs. "review-and-remediate after-the-fact for auto-resolutions of
same-file edits".
Thanks in advance for your replies!
v/r,
neal
next reply other threads:[~2012-02-21 20:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-21 20:41 Neal Kreitzinger [this message]
2012-02-21 21:19 ` how do you review auto-resolved files Junio C Hamano
2012-02-21 23:22 ` Neal Kreitzinger
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='ji0vik$e48$1@dough.gmane.org' \
--to=neal@rsss.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.