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

end-of-line diff checkout direction dependence problem

From
TVThomas Vieten <tvie@ivision.de>
Date
Jun 30, 2015, 14:12 UTC
Message-ID
<5592A3D9.3080706@ivision.de>

We face a very inconvenient problem with end-of-line diffs which are not "real". We know the end-of-line problem very well as we thought. But now we found a new phenomenon and nobody mentioning it.

Consider the following repository structure:
           -----------|----|------------->branch1
         /
master
         \
----------|-------|---------|--------------->branch2

The branches are based on master/head. We just consider one branch here, e.g. branch1 .

Working with the head of branch1 gives no problems. No end-of-line diffs. Also going back in the direction of master - no problems. Only in the case if we do a checkout from branch1 to master, then all of a sudden end-of-line diffs appear. The files might be changed, but the end-of-line attributes in gitattributes are not changed in the branch.

It seems to be the case that since the last change to the files which pop up with eol differences, gittattributes where changed and touch their extensions.

With the operation
git ls-files -z | xargs -0 rm -f  # delete all the files of this version 
- here master/head
git reset --hard                  # force checkout of master/head and 
reset index

The problem disappears! No eol problems anymore. Something like a brute force checkout.

Also checking out versions in the direction of branch1 give never end-of-line diffs.

What has changed somewhen are the gitattributes.

We estimate that this becomes a problem when applying the diffs from branch1 in the direction of the master. Finally then the diffs result in a different state from the master.

But when the master is checked out freshly, this difference does not appear.
Very, very annoying.

We check now every time when these end-of-line diffs appear, if they are really end of line diffs

git diff --ignore-space-at-eol
and then try the procedure above.

But to have a dependence from the direction of the checkout is somewhat irritating.

If this is not a bug - then how to avoid it ?
bye for now
Thomas
-- 
++++++++++++++++++++++++++++++++++++++++++++++++++++++
iVISION GmbH		|Industrial Inspection Systems
Jülicherstr. 336 B	|
D-52070 Aachen		|
Tel: +49-(0)241-961233	|
FAX: +49-(0)241-980 2064|
www.ivision.de
tvie@ivision.de
++++++++++++++++++++++++++++++++++++++++++++++++++++++
Next: Torsten Bögershausen
Message 1 of 4 in “end-of-line diff checkout direction dependence problem”
  1. Thomas VietenJun 30, 2015
  2. Torsten BögershausenJun 30, 2015
  3. Thomas VietenJul 2, 2015
  4. Torsten BögershausenJul 6, 2015

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.