git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cherry-pick -Xrenormalize fails with formerly CRLF files
@ 2016-11-28  6:19 Eevee (Lexy Munroe)
  2016-11-28 15:54 ` Torsten Bögershausen
  0 siblings, 1 reply; 3+ messages in thread
From: Eevee (Lexy Munroe) @ 2016-11-28  6:19 UTC (permalink / raw)
  To: git

I'm working with a repo that used to be all CRLF.  At some point it was 
changed to all LF, with `text=auto` in .gitattributes for the sake of 
Windows devs.  I'm on Linux and have never touched any twiddles relating 
to line endings.  I'm trying to cherry-pick some commits from before the 
switchover.

Straightforward cherry-picking causes entire files at a time to 
conflict, which I've seen before when switching from tabs to spaces.  So 
I tried -Xrenormalize and got:

     fatal: CRLF would be replaced by LF in [path]

The error comes from check_safe_crlf, which warns if checksafe is 
CRLF_SAFE_WARN and dies if it's (presumably) CRLF_SAFE_FAIL.  The funny 
thing is that it's CRLF_SAFE_RENORMALIZE.

I don't know what the semantics of this value are, but the caller 
(crlf_to_git) explicitly checks for CRLF_SAFE_RENORMALIZE and changes it 
to CRLF_SAFE_FALSE instead.  But that check only happens if crlf_action 
is CRLF_AUTO*, and for me it's CRLF_TEXT_INPUT.

I moved the check to happen regardless of the value of crlf_action, and 
at least in this case, git appears to happily do the right thing.  So I 
think this is a bug, but line endings are such a tangle that I'm really 
not sure.  :)

The repository in question is ZDoom: https://github.com/rheit/zdoom
I'm trying to cherry-pick commits from the 3dfloors3 branch (e.g., 
9fb2daf58e9d512170859302a1ac0ea9c2ec5993) onto a slightly outdated 
master, 6384e81d0f135a2c292ac3e874f6fe26093f45b1.

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

end of thread, other threads:[~2016-11-29  0:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-28  6:19 cherry-pick -Xrenormalize fails with formerly CRLF files Eevee (Lexy Munroe)
2016-11-28 15:54 ` Torsten Bögershausen
2016-11-29  0:27   ` Eevee (Lexy Munroe)

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