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

Re: Sort of a feature proposal

From
Avery Pennarun <apenwarr@gmail.com>
Date
May 7, 2008, 16:03 UTC
Message-ID
<32541b130805070903l195d84bn2ec22e97c81c42df@mail.gmail.com>
In-Reply-To
<alpine.LFD.1.10.0805071139010.23581@xanadu.home>
On 5/7/08, Nicolas Pitre <nico@cam.org> wrote:
Show 14 quoted lines
> On Wed, 7 May 2008, David Kastrup wrote:
>  > Hi, I have some large git repositories on a USB drive (ext3 file
>  > system).  That means that when replugging the drive, the recorded st_dev
>  > data in the index is off, meaning that the whole repo directory
>  > structure gets reread as the stat data of all directories has changed.
>  >
>  > That's a nuisance.  Can't we have some heuristic or configuration option
>  > where we, say, record the st_dev of the _index_ file, and if that has
>  > changed, we propagate that change to the st_dev of its contents?  I'd
>  > like to see something that works more efficiently than rescanning the
>  > whole disk every time I hibernate my computer.
>
> Maybe simply ignoring st_dev is the solution?  I hardly can see what
>  value it had to the other stat fields.

If I understand correctly, you can be sure a file hasn't changed if it has exactly the same (dev,inode,ctime,length) attributes. If you don't track the dev, you can't be certain whether file attributes look identical but it was actually on another disk, and therefore might have different content after all.

It's obviously a pretty rare case, but nobody likes a version control system that works properly "almost" all the time :)

Have fun,
Avery
Previous: Stephen R. van den BergNext: Linus Torvalds
Message 4 of 8 in “Sort of a feature proposal”
  1. David KastrupMay 7, 2008
  2. Nicolas PitreMay 7, 2008
  3. Stephen R. van den BergMay 7, 2008
  4. Avery PennarunMay 7, 2008
  5. Linus TorvaldsMay 7, 2008
  6. David KastrupMay 7, 2008
  7. Dmitry PotapovMay 7, 2008
  8. David KastrupMay 7, 2008

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.