Re: [PATCH v1 1/1] convert: git cherry-pick -Xrenormalize did not work
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- Nov 29, 2016, 20:16 UTC
- Message-ID
- <20161129201600.GA14333@tb-raspi>
- In-Reply-To
- <xmqq7f7mgmb9.fsf@gitster.mtv.corp.google.com>
On Tue, Nov 29, 2016 at 10:42:18AM -0800, Junio C Hamano wrote:
Show 20 quoted lines
> tboegi@web.de writes: > > > From: Torsten Bögershausen <tboegi@web.de> > > > > Working with a repo that used to be all CRLF. At some point it > > was changed to all LF, with `text=auto` in .gitattributes. > > Trying to cherry-pick a commit from before the switchover fails: > > > > $ git cherry-pick -Xrenormalize <commit> > > fatal: CRLF would be replaced by LF in [path] > > OK. That's a very clear description of the symptom that can be > observed from the surface. > > > Whenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX, > > SAFE_CRLF_RENORMALIZE must be turned into CRLF_SAFE_FALSE. > > Aside from needing s/CRLF_SAFE/SAFE_CRLF/, this however lacks > "Otherwise, because of X and Y, Z ends up doing W" to explain > the "must be" part. Care to explain it a bit more?
Thanks for the review - how about this:
convert: git cherry-pick -Xrenormalize did not work
Working with a repo that used to be all CRLF. At some point it was changed to all LF, with `text=auto` in .gitattributes. Trying to cherry-pick a commit from before the switchover fails:
$ git cherry-pick -Xrenormalize <commit>
fatal: CRLF would be replaced by LF in [path]Commit 65237284 "unify the "auto" handling of CRLF" introduced a regression:
Whenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX, SAFE_CRLF_RENORMALIZE was feed into check_safe_crlf(). This is wrong because here everything else than SAFE_CRLF_WARN is treated as SAFE_CRLF_FAIL.
Solution: Turn SAFE_CRLF_RENORMALIZE into SAFE_CRLF_FALSE before calling check_safe_crlf().
Reported-by: Eevee (Lexy Munroe) <eevee@veekun.com> Signed-off-by: Torsten Bögershausen <tboegi@web.de>