From: "Torsten Bögershausen" <tboegi@web.de>
To: eevee.reply@veekun.com
Cc: git@vger.kernel.org
Subject: Re: cherry-pick -Xrenormalize fails with formerly CRLF files
Date: Mon, 28 Nov 2016 15:54:15 +0000 [thread overview]
Message-ID: <20161128155415.GA9966@tb-raspi> (raw)
In-Reply-To: <777ee899-4cfb-e3b4-da0d-793fde35e412@veekun.com>
On Sun, Nov 27, 2016 at 10:19:35PM -0800, Eevee (Lexy Munroe) wrote:
> 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]
>
Which version of Git are you using, what does
git --version
say?
> 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. :)
>
I am not sure either.
Could you send me the diff you made ?
git diff
I am happy to look into it, (in the amount of time I have).
> 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.
This is what I tried:
user@pc:~/NoBackup> cd zdoom/ 9fb2daf58e9d512170859302a1ac0ea9c2ec5993 t9fb2daf5Note: checking out '9fb2daf58e9d512170859302a1ac0ea9c2ec5993'.02a1ac0ea9c2ec5993
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 9fb2daf... - Force use of GL nodes when 3D floors are present. - Move MAPINFO line modification flags into P_AdjustLine().
user@pc:~/NoBackup/zdoom> git format-patch HEAD^..HEAD --stdout >9fb2daf.patch
user@pc:~/NoBackup/zdoom> git format-patch HEAD^..HEAD --stdout | tr -d "\r" >9fb2daf-noCRLF.patch
user@pc:~/NoBackup/zdoom> git checkout 6384e81d0f135a2c292ac3e874f6fe26093f45b1
Previous HEAD position was 9fb2daf... - Force use of GL nodes when 3D floors are present. - Move MAPINFO line modification flags into P_AdjustLine().
HEAD is now at 6384e81... - Add support for Skulltag ACS IsNetworkGame.
user@pc:~/NoBackup/zdoom> git cherry-pick 9fb2daf58e9d512170859302a1ac0ea9c2ec5993'.02a1ac0ea9c2ec5993
>
user@pc:~/NoBackup/zdoom> git cherry-pick 9fb2daf58e9d512170859302a1ac0ea9c2ec5993
error: could not apply 9fb2daf... - Force use of GL nodes when 3D floors are present.
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
user@pc:~/NoBackup/zdoom> git status
HEAD detached at 6384e81
You are currently cherry-picking commit 9fb2daf.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: src/p_setup.cpp
Untracked files:
(use "git add <file>..." to include in what will be committed)
9fb2daf-noCRLF.patch
9fb2daf.patch
no changes added to commit (use "git add" and/or "git commit -a")
user@pc:~/NoBackup/zdoom> git cherry-pick --abort
user@pc:~/NoBackup/zdoom> git am < 9fb2daf-noCRLF.patch
Applying: - Force use of GL nodes when 3D floors are present. - Move MAPINFO line modification flags into P_AdjustLine().
error: patch failed: src/p_setup.cpp:1798
error: src/p_setup.cpp: patch does not apply
Patch failed at 0001 - Force use of GL nodes when 3D floors are present. - Move MAPINFO line modification flags into P_AdjustLine().
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
The patch did not apply, but for different reasons.
Could you send us, what exactly you did, to help me out ?
next prev parent reply other threads:[~2016-11-28 15:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-28 6:19 cherry-pick -Xrenormalize fails with formerly CRLF files Eevee (Lexy Munroe)
2016-11-28 15:54 ` Torsten Bögershausen [this message]
2016-11-29 0:27 ` Eevee (Lexy Munroe)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161128155415.GA9966@tb-raspi \
--to=tboegi@web.de \
--cc=eevee.reply@veekun.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).