git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug-ish: CRLF endings and conflict markers

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 11, 2007, 10:26 UTC
Message-ID
<Pine.LNX.4.63.0701111123280.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<20070111101653.GC28309@spearce.org>
Hi,
On Thu, 11 Jan 2007, Shawn O. Pearce wrote:
Show 14 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > On Thu, 11 Jan 2007, Shawn O. Pearce wrote:
> > 
> > > That said I don't really care about this problem that much. The problem 
> > > that I care about is its far too easy to convert the lineendings in a 
> > > file (e.g. CRLF->LF, LF->CRLF).  This causes the entire file to differ, 
> > > making merges very difficult.  I really should just fix it (in the one 
> > > place where it matters to me) by modifying the pre-commit hook to look 
> > > for such a case and abort.
> > 
> > Why not just introduce a config variable, and do the conversion in-flight?
> 
> That's a lot of work and goes very much against the Git mindset that
> we never alter content, just store it as-is.

While that is correct, we also _use_ the content, and very much alter it all the time. A diff, for example, is nothing but altered content.

> All I want is to make the user realize what they have done.  "Hey dummy, 
> you just changed the entire file and the only difference I see for most 
> lines is simply the addition/removal of a CR.  You shouldn't do that!".  
> The pre-commit hook is the perfect place for that.

This sounds sensible. I mistook your task to be integrator for people you can't smack.

Show 5 quoted lines
> > Or, alternatively, do the merge ignoring white space? (Of course, this 
> > is somewhat pointless when merging whitespace fixes...)
> 
> Lets not go down that road.  That's just asking for trouble. And it 
> sounds like a lot of work from what you pointed out in another message.

But to the contrary, ignoring white space in xdl_merge() is just a question of passing XDF_IGNORE_WHITESPACE_CHANGE as part of the xpparam's.

Ciao, Dscho

Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 7 of 8 in “Bug-ish: CRLF endings and conflict markers”
  1. Andy ParkinsJan 11, 2007
  2. Johannes SchindelinJan 11, 2007
  3. Andy ParkinsJan 11, 2007
  4. Shawn O. PearceJan 11, 2007
  5. Johannes SchindelinJan 11, 2007
  6. Shawn O. PearceJan 11, 2007
  7. Johannes SchindelinJan 11, 2007
  8. Shawn O. PearceJan 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.