From: "Neal Kreitzinger" <neal@rsss.com>
To: git@vger.kernel.org
Subject: force "unmerged" for same-file auto-merges
Date: Tue, 23 Mar 2010 20:44:05 -0500 [thread overview]
Message-ID: <hobqoc$5h3$1@dough.gmane.org> (raw)
Scenario: "same-file auto-merge": when two different people change the
same file in their separate repos. Their changes do not conflict in the
sense that they are changes to the same lines. However, their changes do
conflict in the sense that the resulting merged logic is incorrect.
Concern:
The same-file auto-merge results are overlooked (not reviewed) by the
programmer because there is nothing preventing a git-commit immediately
after the auto-merge completes.
Desired Solution:
Perform same-file auto-merge and produce auto-merge results, but mark all
such auto-merged files as "unmerged" so that they must be reviewed/resolved
before a git-commit. The "unmerged" status allows git-mergetool to be run
(e.g. kdiff3) so that the merged lines can be reviewed. In this way, all
auto-merged files are reviewed.
Does anyone know if there are configuration and/or command-line options in
git that can accomplish this in a fairly straightforward manner? For
example, something like this:
Example config:
$ cat gitconfig
[merge]
samefileauto = forceconflict
Example command:
$ git merge -s sameautoforceconflict branchx
Example results:
$ git merge -s sameautoforceconflict branchx
Merging:
11a99zz examplecommitb
virtual branchx
found 1 common ancestor(s):
22b88yy examplecommita
Auto-merging examplepgm
Merge made by recursive.
examplepgm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
$git status
examplepgm: needs merge
# On branch branchx
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# unmerged: examplepgm
#
no changes added to commit (use "git add" and/or "git commit -a")
v/r,
Neal
next reply other threads:[~2010-03-24 1:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 1:44 Neal Kreitzinger [this message]
2010-03-26 1:04 ` force "unmerged" for same-file auto-merges Neal Kreitzinger
2010-03-27 17:22 ` Dilip M
2010-03-26 19:29 ` Junio C Hamano
2010-03-27 8:56 ` Sitaram Chamarty
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='hobqoc$5h3$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 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).