git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* When a merge turns into a conflict
@ 2007-12-06  4:49 Anand Kumria
  2007-12-06  5:51 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Anand Kumria @ 2007-12-06  4:49 UTC (permalink / raw)
  To: git


Hi,

I've just had an odd experience with git (1.5.3.1) and wondered if this 
was a known issue.

One of my co-developers has a project, with a README.txt file.  I branch 
from it and begin some edits:

	- make it more AsciiDoc like (ala git)

	- put in the README.txt a few patches that need to be applied

I had no issues 'git add' the file, and performing changes.

However when my colleague came to merge my patches in; git complained 
that the file had conflict because:

	a. it found the ========= AsciiDoc header line

	b. it found the diff markers in the file

I do not know git well enough to know if this is a heurestic that can be 
tweaked via the config file or something else. I am presently learning 
git-filter-branch so I can prepare something to show -- but I just wanted 
to flag and see if anyone else had had the same issue.

Thanks,
Anand

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

* Re: When a merge turns into a conflict
  2007-12-06  4:49 When a merge turns into a conflict Anand Kumria
@ 2007-12-06  5:51 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2007-12-06  5:51 UTC (permalink / raw)
  To: Anand Kumria; +Cc: git

Anand Kumria <wildfire@progsoc.org> writes:

> However when my colleague came to merge my patches in; git complained 
> that the file had conflict because:
>
> 	a. it found the ========= AsciiDoc header line

Perhaps .git/hooks/pre-commit hook is enabled for the person who needed
to merge, fix conflicts and make a commit.

We ship the hook _disabled_ by default, but that hook inspects the
change (relative to the HEAD, which means "difference this merge brings
in relative to the state before I started the merge") and complains if
it finds lines that:

 * have trailing whitespaces,

 * have a SP immediately before HT in the indentation, or

 * matches 7 or more <, >, or = at the beginning (i.e. <<<<<<<, =======,
   or >>>>>>>, typically are conflict markers).

And the last heuristics does trigger on an AsciiDoc text.

The easiest (and standard) workaround in such a case is, after
inspecting the change yourself to make sure you are bitten by false
positive, to commit with --no-verify option:

	git commit --no-verify

This bypasses the pre-commit hook.

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

end of thread, other threads:[~2007-12-06  5:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-06  4:49 When a merge turns into a conflict Anand Kumria
2007-12-06  5:51 ` Junio C Hamano

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).