Re: [PATCH v2 2/2] git-merge-file: do not add LF at EOF while applying unrelated change
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 2, 2014, 14:08 UTC
- Message-ID
- <alpine.DEB.1.00.1407021604510.14982@s15462909.onlinehome-server.info>
- In-Reply-To
- <20140702044427.GA7325@wheezy.local>
Hi Max,
On Wed, 2 Jul 2014, Max Kirillov wrote:
> On Mon, Jun 30, 2014 at 04:55:10PM +0200, Johannes Schindelin wrote: > > I just wish the tests were a little easier to understand... > > What could be improved with them?
Oh, I would name the files more appropriately, for example. That is, instead of test1.txt I would call it mixed-endings.txt or lf-only.txt or some such.
And instead of the Latin version of Psalm 23, I would put lines into the files that describe their own role in the test, i.e.
unchanged ends with a carriage return ends with a line feed unchanged
or similar.
Please keep in mind that this critique is most likely on my *own* work, for all I know *I* introduced those files.
Show 6 quoted lines
> By the way, for "\r\n" eol it did even worse, adding just "\n". And I > guess it still adds just "\n" for union merge. Should file merge > consider the core.eol? I think it should, and for the conflict markers > also, it looks ugly when whole file has "\r\n" but the conflict markers > have "\n". But then git-merge-file could not be used outside of > repository, I guess.
Oh, why not? It could read the configuration if it's inside a working directory, and just read /etc/gitconfig and $HOME/.gitconfig when outside...
> In general, I wish file merging (and diffing) were more tolerant of the > line endings in input. Because in windows environment, when people have > different core.autocrlf, it becomes quite frustrating to always get > conflicts and changes.
Amen!
Ciao, Dscho