git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: When a merge turns into a conflict

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 6, 2007, 05:51 UTC
Message-ID
<7v7ijsid4w.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<pan.2007.12.06.04.49.25@progsoc.org>
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.
Previous: Anand Kumria
Message 2 of 2 in “When a merge turns into a conflict”
  1. Anand KumriaDec 6, 2007
  2. Junio C HamanoDec 6, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.