From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Subject: Bug-ish: CRLF endings and conflict markers
Date: Thu, 11 Jan 2007 09:41:17 +0000 [thread overview]
Message-ID: <200701110941.22024.andyparkins@gmail.com> (raw)
Hello,
I am sure the response to this will be "tough", however I'll mention it
anyway. It wasn't a problem for me, as I know git is LF endings only, but
others might be a bit confused.
* Track a file that has CR-LF endings. Not a problem, git works fine with
these and treats the CR as an extra character at the end of the line.
* Have two branches make conflicting changes to that file
* Merge, conflict
* Open the file
* Find that (almost) every line now displays with a "^M" at the end. vim has
found some lines that don't have CR-LF ends so dropped back to UNIX mode.
* Be careful that your conflict resolution doesn't introduce any new lines as
they will not have CR-LF endings.
The "(almost)" above refers of course to the conflict markers. These have LF
endings only so force the editor into UNIX mode. Assuming a binary safe
editor, things will be fine if the conflict resolution is simply to remove
the markers, and edit the existing lines. However, if the user adds any
lines during conflict resolution, those new lines will only have LF ends.
This is a problem for compilers that are expecting CR-LF input.
Note: this is not on Windows (spit), this is simply editing a CR-LF file on
UNIX.
The best solution is probably to use the line ending of the conflicted lines.
I've had a look, but I can only fine builtin-rerere.c that generates the
markers - would that be the place to make this change?
Andy
--
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
next reply other threads:[~2007-01-11 9:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-11 9:41 Andy Parkins [this message]
2007-01-11 9:46 ` Bug-ish: CRLF endings and conflict markers Johannes Schindelin
2007-01-11 11:36 ` Andy Parkins
2007-01-11 9:50 ` Shawn O. Pearce
2007-01-11 9:59 ` Johannes Schindelin
2007-01-11 10:16 ` Shawn O. Pearce
2007-01-11 10:26 ` Johannes Schindelin
2007-01-11 10:41 ` Shawn O. Pearce
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=200701110941.22024.andyparkins@gmail.com \
--to=andyparkins@gmail.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