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

Re: Current Issues #3

From
Shawn Pearce <spearce@spearce.org>
Date
May 22, 2006, 23:12 UTC
Message-ID
<20060522231257.GA21124@spearce.org>
In-Reply-To
<Pine.LNX.4.64.0605221738090.6713@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 21 quoted lines
> On Mon, 22 May 2006, Junio C Hamano wrote:
> 
> > * reflog
> > 
> >   I still haven't merged this series to "next" -- I do not have
> >   much against what the code does, but I am unconvinced if it is
> >   useful.  Also objections raised on the list that this can be
> >   replaced by making sure that a repository that has hundreds of
> >   tags usable certainly have a point.
> 
> I think it would make gitweb's summary view clearer, and Linus seemed 
> interested in being able to look up what happened in the fast forward 
> which was the first of several merges in a day.
> 
> It could be replaced by a repository with hundreds of machine-readable 
> tags with code to parse dates into queries for suitable tags. But I don't 
> think there's an advantage to using the tag mechanism here, because you 
> never want to look the history up by exactly which history it is (the 
> thing that a tag ref is good for); you'll be looking for whatever reflog 
> item is the newest not after a specified time, where the specified time is 
> almost never a time that a reflog item was created.

The thing is this might also be easily represented as a structure of tags; for example:

	refs/logs/heads/<ref>/<year>/<month>/<day> <hour>:<min>:<sec>:<seq>

where the tag is a tag of the commit which was valid in that ref at that time. Searching for an entry "around a particular time" isn't that much more difficult than parsing a file, you just have to walk backwards through the sorted directory listings then read the tag object which matches; that tag object will point at the tree/commit/tag which is was in that ref..

What's ugly about this is simply the disk storage: a ref file is an expensive thing (relatively speaking) on most UNIX file systems due to the inode overhead. If this was stored in a more compact format (such as a GIT tree) then this would cost very little.

So the alternative that I have been mentaly kicking around for the past two days is storing the GIT_DIR/refs directory within a standard GIT tree. This of course would need to be an option that gets enabled by the user as currently most tools expect the refs directory to actually be a directory, not a tree. The advantage here is that unlike proposed reflog it is a compact ref representation which could be used by other features, such as tagging a GIT commit with the unique name of the same change from another SCM. Or tagging your repository on every automated build, which runs once every 5 minutes.

-- 
Shawn.
Previous: Carl Worth
Message 8 of 8 in “Current Issues #3”
  1. Junio C HamanoMay 22, 2006
  2. Linus TorvaldsMay 22, 2006
  3. SeanMay 22, 2006
  4. Jakub NarebskiMay 23, 2006
  5. Martin WaitzMay 22, 2006
  6. Daniel BarkalowMay 22, 2006
  7. Carl WorthMay 22, 2006
  8. Shawn PearceMay 22, 2006

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.