{"thread":{"id":"11154","subject":"When a merge turns into a conflict","startedAt":"2007-12-06T04:49:27Z","lastAt":"2007-12-06T05:51:59Z","messageCount":2,"participants":["Anand Kumria","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"62096","messageId":"pan.2007.12.06.04.49.25@progsoc.org","threadId":"11154","inReplyTo":null,"subject":"When a merge turns into a conflict","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2007-12-06T04:49:27Z","receivedAt":"2007-12-06T04:49:27Z","isPatch":false,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"\nHi,\n\nI've just had an odd experience with git (1.5.3.1) and wondered if this \nwas a known issue.\n\nOne of my co-developers has a project, with a README.txt file.  I branch \nfrom it and begin some edits:\n\n\t- make it more AsciiDoc like (ala git)\n\n\t- put in the README.txt a few patches that need to be applied\n\nI had no issues 'git add' the file, and performing changes.\n\nHowever when my colleague came to merge my patches in; git complained \nthat the file had conflict because:\n\n\ta. it found the ========= AsciiDoc header line\n\n\tb. it found the diff markers in the file\n\nI do not know git well enough to know if this is a heurestic that can be \ntweaked via the config file or something else. I am presently learning \ngit-filter-branch so I can prepare something to show -- but I just wanted \nto flag and see if anyone else had had the same issue.\n\nThanks,\nAnand\n"},{"id":"62108","messageId":"7v7ijsid4w.fsf@gitster.siamese.dyndns.org","threadId":"11154","inReplyTo":"pan.2007.12.06.04.49.25@progsoc.org","subject":"Re: When a merge turns into a conflict","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-06T05:51:59Z","receivedAt":"2007-12-06T05:51:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Anand Kumria <wildfire@progsoc.org> writes:\n\n> However when my colleague came to merge my patches in; git complained \n> that the file had conflict because:\n>\n> \ta. it found the ========= AsciiDoc header line\n\nPerhaps .git/hooks/pre-commit hook is enabled for the person who needed\nto merge, fix conflicts and make a commit.\n\nWe ship the hook _disabled_ by default, but that hook inspects the\nchange (relative to the HEAD, which means \"difference this merge brings\nin relative to the state before I started the merge\") and complains if\nit finds lines that:\n\n * have trailing whitespaces,\n\n * have a SP immediately before HT in the indentation, or\n\n * matches 7 or more <, >, or = at the beginning (i.e. <<<<<<<, =======,\n   or >>>>>>>, typically are conflict markers).\n\nAnd the last heuristics does trigger on an AsciiDoc text.\n\nThe easiest (and standard) workaround in such a case is, after\ninspecting the change yourself to make sure you are bitten by false\npositive, to commit with --no-verify option:\n\n\tgit commit --no-verify\n\nThis bypasses the pre-commit hook.\n"}]}