git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Merge without marking conflicts in working tree
@ 2014-11-17 22:38 Aaron Schrab
  2014-11-17 23:19 ` Junio C Hamano
  2014-11-17 23:20 ` Andreas Schwab
  0 siblings, 2 replies; 3+ messages in thread
From: Aaron Schrab @ 2014-11-17 22:38 UTC (permalink / raw
  To: git

Is there a way to do a merge but only record conflicts in the index, not 
update the working versions of files with conflict markers?

Like many people, I use git to manage configuration files for my shell, 
editor, git itself, and a number of other things.  The vast majority of 
times that I update things no conflicts are occur and everything just 
works, so I'd like to avoid extra work in this case.  But occasionally a 
conflict will occur, and if it's in a file that will be read while 
trying to resolve the conflict this can make things more difficult.

I'd like to find a way to have the conflict recorded in just the index 
without touching the working tree.  I could then use my usual tools to 
resolve the conflict without the errors caused by the conflict markers.  
I generally use vim+fugitive to resolve conflicts anyway, and typically 
the first step I take is to replace the working-tree version with the 
merge-base version, completely ignoring any conflict markers.

If there isn't currently a way to do this, I was thinking of 
implementing something like an "ours" value for merge.conflictstyle 
configuration.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Merge without marking conflicts in working tree
  2014-11-17 22:38 Merge without marking conflicts in working tree Aaron Schrab
@ 2014-11-17 23:19 ` Junio C Hamano
  2014-11-17 23:20 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2014-11-17 23:19 UTC (permalink / raw
  To: Aaron Schrab; +Cc: git

Aaron Schrab <aaron@schrab.com> writes:

> Is there a way to do a merge but only record conflicts in the index,
> not update the working versions of files with conflict markers?

Not with Porcelain, but "read-tree -m <ancestor> <ours> <theirs>"
should give you something close to it.

"merge-recursive" is probably beyond salvaging and coaxing --cached
option (i.e. tell a command that usually works both on the index and
on the working tree to only work on the index) into it would be too
messy to think about.  Restructuring it so that it first computes
the end result only in the index and then optionally allows it to
check out to the working tree has been something I've wanted to do
for a long time, but there is only limited amount of time in a day
and the list is never dormant, so... X-<.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Merge without marking conflicts in working tree
  2014-11-17 22:38 Merge without marking conflicts in working tree Aaron Schrab
  2014-11-17 23:19 ` Junio C Hamano
@ 2014-11-17 23:20 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2014-11-17 23:20 UTC (permalink / raw
  To: git

Aaron Schrab <aaron@schrab.com> writes:

> Is there a way to do a merge but only record conflicts in the index, not
> update the working versions of files with conflict markers?
>
> Like many people, I use git to manage configuration files for my shell,
> editor, git itself, and a number of other things.  The vast majority of
> times that I update things no conflicts are occur and everything just
> works, so I'd like to avoid extra work in this case.  But occasionally a
> conflict will occur, and if it's in a file that will be read while trying
> to resolve the conflict this can make things more difficult.

You could perform the merge in a separate working directory.  The only
extra step required is a checkout to deploy the new revision, which
could be triggered automatically by a hook.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-17 23:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-17 22:38 Merge without marking conflicts in working tree Aaron Schrab
2014-11-17 23:19 ` Junio C Hamano
2014-11-17 23:20 ` Andreas Schwab

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).