Thread (16 messages) flat view 16 messages, 3 authors, 2021-07-27

Re: Files modified, even after: git reset --hard

From: Martin <hidden>
Date: 2021-07-25 18:39:25

On 25/07/2021 19:48, Martin wrote:
Actually, git replace has a weird effect.

so I have "commit A" introducing the problem. Then many commits until 
"commit Y" fixing it.

If I do
switch -f --detach A
git add --renormalize the_file
git commit -m foo
git show   // get the new blob for the file
git show A  // get the old blob for the file
git replace  old_blob  new_blob

switch -f --detach A

Then "the_file" is still shown as modified.
Only
  git diff the_file
now returns empty
(where as before it returned the entire file)

On the plus side
  switch -f --detach B
has the same change, still modified, but no diff.
So one replace would solve the entire 1000 commits that are currently 
affected

Any idea, what causes the "modified" after the replace?
Ok, it seem that
   git switch
simple did not update the file.

- After the commit I am on a dangling commit, which is a direct child of 
"A".
- I insert the reprace
- I switch from that dangling to "A"

-> diff is empty
-> but status is not ok

If I now switch to a far away commit. And then switch back to "A". Then 
git status is also ok.


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help