unexpected "unresolved merge conflict" for a new file

3 messages, 2 authors, 2018-05-25 · open the first message on its own page

unexpected "unresolved merge conflict" for a new file

From: Michal Hocko <mhocko@kernel.org>
Date: 2018-05-24 11:37:12

Hi,
`git commit' fails on a newly added file with the following
*
* You have some suspicious patch lines:
*
* In Documentation/core-api/gfp_mask-from-fs-io.rst
* unresolved merge conflict (line 27)
Documentation/core-api/gfp_mask-from-fs-io.rst:27:=======

$ git status --porcelain 
A  Documentation/core-api/gfp_mask-from-fs-io.rst

$ git --version 
git version 2.17.0

from debian.

Btw. the suspicious line is
$ sed -n '27p' Documentation/core-api/gfp_mask-from-fs-io.rst
=======

I believe this is a bug because a new file cannot have a conflict by
definition and also there are no <<<<< in the file so there is no
unresolved conflict there. So I guess the heuristic should be more
clever.

Thanks!
-- 
Michal Hocko
SUSE Labs

Re: unexpected "unresolved merge conflict" for a new file

From: Jeff King <hidden>
Date: 2018-05-24 17:11:27

On Thu, May 24, 2018 at 01:36:57PM +0200, Michal Hocko wrote:
`git commit' fails on a newly added file with the following
*
* You have some suspicious patch lines:
*
* In Documentation/core-api/gfp_mask-from-fs-io.rst
* unresolved merge conflict (line 27)
Documentation/core-api/gfp_mask-from-fs-io.rst:27:=======
This message isn't generated by git itself, but rather by a pre-commit
hook. You can skip the hook by running "git commit --no-verify".

As for the false positive in the hook logic, I can't say more without
having seen the hook source. :) Do you know where you got it from?

(Googling for "suspicious patch lines" turns up some hits, but with
varying provenance).

-Peff

Re: unexpected "unresolved merge conflict" for a new file

From: Michal Hocko <mhocko@kernel.org>
Date: 2018-05-25 07:22:39

On Thu 24-05-18 13:11:20, Jeff King wrote:
On Thu, May 24, 2018 at 01:36:57PM +0200, Michal Hocko wrote:
quoted
`git commit' fails on a newly added file with the following
*
* You have some suspicious patch lines:
*
* In Documentation/core-api/gfp_mask-from-fs-io.rst
* unresolved merge conflict (line 27)
Documentation/core-api/gfp_mask-from-fs-io.rst:27:=======
This message isn't generated by git itself, but rather by a pre-commit
hook. You can skip the hook by running "git commit --no-verify".

As for the false positive in the hook logic, I can't say more without
having seen the hook source. :) Do you know where you got it from?

(Googling for "suspicious patch lines" turns up some hits, but with
varying provenance).
Ohh, I see. I must have installed this one loooong time ago. Attached
for reference. I will just drop it. Sorry about tht noise.
-- 
Michal Hocko
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help