From: Martin <git@mfriebe.de>
To: git@vger.kernel.org
Subject: Files modified, even after: git reset --hard
Date: Sun, 25 Jul 2021 17:04:08 +0200 [thread overview]
Message-ID: <dd4aca2c-9ca2-e489-d78f-9d2a5580f1a5@mfriebe.de> (raw)
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
next reply other threads:[~2021-07-25 15:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-25 15:04 Martin [this message]
2021-07-25 15:40 ` Files modified, even after: git reset --hard 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
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=dd4aca2c-9ca2-e489-d78f-9d2a5580f1a5@mfriebe.de \
--to=git@mfriebe.de \
--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;
as well as URLs for NNTP newsgroup(s).