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

Re: git repository modified after migration

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2016, 18:07 UTC
Message-ID
<xmqq8u3uvfha.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<5694A4E6.6020508@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 21 quoted lines
> Junio C Hamano venit, vidit, dixit 11.01.2016 19:19:
>> Michael J Gruber <git@drmicha.warpmail.net> writes:
>> 
>>> This happens whenever the "stat" information changes, e.g. due to
>>> changed device numbering and such. "git reset --hard" would have been
>>> the quickiest way to reset the stat cache/index - after git diff, of
>>> course ;)
>> 
>> That does not quite explain why 'git status' reported modified files
>> in the first place.  It would have refreshed the cached stat info in
>> the index as the first thing to do.  "git status" I think is the
>> recommended way these days ("update-index --refresh" for us old
>> timers) to nondestructively correct the cached stat information
>> discrepancy caused by "cp -R".
>> 
>> If you need to resort to "reset --hard", then there is something
>> else going on.
>
> Back than when I had the same problem with git repos on removable file
> systems (if I remember correctly) git status did not correct that
> information. It may be different now.

I do not recall we did anything specific to help removable devices, so if the report is coming from a filesystem on a removable device we may be seeing the same symptom.

I somehow doubt that is the case, though.

A not-entirely-inplausible theory is that the index in the original repository somehow marks modified entries as clean, fooling "status" that is run in the original repository into reporting that nothing changed. Because "cp -R" into a different location forces the content-level checking, "status" run in the copy notices that they are indeed different and tells the true story. If that is the case, it would be interesting to see how the index got into that state.

Previous: Michael J Gruber
Message 6 of 6 in “git repository modified after migration”
  1. Yang YuDec 25, 2015
  2. Michael J GruberJan 11, 2016
  3. Yang YuJan 11, 2016
  4. Junio C HamanoJan 11, 2016
  5. Michael J GruberJan 12, 2016
  6. Junio C HamanoJan 12, 2016

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.