git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: tboegi@web.de
To: git@vger.kernel.org, eevee.reply@veekun.com
Cc: "Torsten Bögershausen" <tboegi@web.de>
Subject: [PATCH v1 1/1] convert:  git cherry-pick -Xrenormalize did not work
Date: Tue, 29 Nov 2016 17:30:23 +0100	[thread overview]
Message-ID: <20161129163023.23403-1-tboegi@web.de> (raw)
In-Reply-To: <6a7e155-f399-c9f8-c69e-8164e0735dfb@veekun.com>

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]

Whenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX,
SAFE_CRLF_RENORMALIZE must be turned into CRLF_SAFE_FALSE.

Reported-by: Eevee (Lexy Munroe) <eevee@veekun.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---

Thanks for reporting.
Here is a less invasive patch.
Please let me know, if the patch is OK for you
(email address, does it work..)

 convert.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/convert.c b/convert.c
index be91358..526ec1d 100644
--- a/convert.c
+++ b/convert.c
@@ -286,7 +286,9 @@ static int crlf_to_git(const char *path, const char *src, size_t len,
 			checksafe = SAFE_CRLF_FALSE;
 		else if (has_cr_in_index(path))
 			convert_crlf_into_lf = 0;
-	}
+	} else if (checksafe == SAFE_CRLF_RENORMALIZE)
+		checksafe = SAFE_CRLF_FALSE;
+
 	if (checksafe && len) {
 		struct text_stat new_stats;
 		memcpy(&new_stats, &stats, sizeof(new_stats));
-- 
2.10.0


       reply	other threads:[~2016-11-29 16:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6a7e155-f399-c9f8-c69e-8164e0735dfb@veekun.com>
2016-11-29 16:30 ` tboegi [this message]
2016-11-29 18:42   ` [PATCH v1 1/1] convert: git cherry-pick -Xrenormalize did not work Junio C Hamano
2016-11-29 20:16     ` Torsten Bögershausen
2016-11-29 20:45       ` Junio C Hamano
2016-11-30 17:02 ` [PATCH v2 " tboegi
2016-12-01 18:27   ` Junio C Hamano
2016-12-01 20:07   ` Jacob Keller
2016-12-01 20:24     ` Junio C Hamano
2016-12-02 12:20       ` Torsten Bögershausen

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161129163023.23403-1-tboegi@web.de \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).