git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Files modified, even after: git reset --hard
@ 2021-07-25 15:04 Martin
  2021-07-25 15:40 ` Martin
  0 siblings, 1 reply; 16+ messages in thread
From: Martin @ 2021-07-25 15:04 UTC (permalink / raw)
  To: git

I have some files, that will show up modified. Always.

If I just switch to a commit, with clean worktree before, then those 
files will be modified.

I can not stash them.
git reset --hard does not change anything.

Diff shows the entire file is modified. I suspect its the line endings..

This happens on windows, and
   autocrlf=true

The checked out file (which is marked as modified) has the correct CrLf 
endings.

What I have not been able to find, is what line endings are stored in 
the blob.
Its an xml file, so they should be just Lf.
But I *suspect* that the blob contains either CrLf, or mixed line-endings.

Could that be? that if a file does have unexpected line endings in the 
commit's blob, that it shows as modified?

One the one hand, yes, If I commit, that file will change.
On the other hand, if I just check out (or do reset-hard) then I don't 
expect modified files....

So what should happen?

This also causes problems, because in order to for example rebase 
something, I first need to switch to some commit that can be checked out 
without modified files.
Or rebase will not work.

Also in that repro, I had problems that some rebases failed with (with 
and without --reapply-cherry-picks)
    error: add_cacheinfo failed
Those rebase where between an orphaned branch, and a "normal" branch.
And it is possible that the file only had the line ending issues in one 
of the 2 branches....
But that I was not able to further investigate.



//git for windows
git version 2.32.0.windows.2


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-07-27  0:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-25 15:04 Files modified, even after: git reset --hard Martin
2021-07-25 15:40 ` Martin
2021-07-25 17:48   ` Martin
2021-07-25 18:39     ` Martin
2021-07-26  0:33       ` Chris Torek
2021-07-26  1:34         ` Martin
2021-07-26  2:59           ` Chris Torek
2021-07-26 10:31             ` Martin
2021-07-26 11:11               ` Chris Torek
2021-07-26 13:57               ` Martin
2021-07-26 18:21                 ` Philip Oakley
2021-07-26 19:57             ` Martin
2021-07-26 22:03               ` Chris Torek
2021-07-27  0:55                 ` Martin
2021-07-26 10:39           ` Philip Oakley
2021-07-26 12:50             ` Martin

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).