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

Re: Creating something like increasing revision numbers

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Oct 19, 2009, 02:41 UTC
Message-ID
<alpine.LNX.2.00.0910182140440.14365@iabervon.org>
In-Reply-To
<20091019013320.GD17397@gamma.logic.tuwien.ac.at>
On Mon, 19 Oct 2009, Norbert Preining wrote:
Show 22 quoted lines
> Hi Daniel,
> 
> On So, 18 Okt 2009, Daniel Barkalow wrote:
> > > - how would one access this "sequence" number on the server
> > 
> > There isn't currently anything built in that counts up like that; however, 
> > it shouldn't be too hard to add something, because the reflog gets an 
> > entry at the same times the sequence number would increase. In fact, you 
> 
> Ok.
> 
> > > - is there a way to determine at which of this "sequence" numbers a specific
> > >   file has been changed last?
> > 
> > There isn't a built-in way, but you can find the current hash for a 
> > filename with "git ls-tree -r <branch> <filename>", and find the hash as 
> > of N changes ago with "git ls-tree -r <branch>@{<N>} <filename>". You're 
> > looking for the smallest N where they don't match. (And you probably 
> > don't want to be a binary search or the like, because that might miss that 
> 
> That sounds like we cannot use that, because we have to do that for about
> 80k files and that on each (at least daily) rebuilt. That is not feasable.

It's likely to be much more efficient (and maybe sufficiently efficient) to do them all in a single pass. In fact, it should be easy enough to keep a cache of the latest numbers for the files, and update that to change the value for those files that differ between the old commit and the new commit in the post-update hook.

	-Daniel
*This .sig left intentionally blank*
Previous: Norbert PreiningNext: Nicolas Pitre
Message 19 of 23 in “Creating something like increasing revision numbers”
  1. Norbert PreiningOct 18, 2009
  2. Johan HerlandOct 18, 2009
  3. Norbert PreiningOct 18, 2009
  4. Johan HerlandOct 18, 2009
  5. alexandrulOct 18, 2009
  6. Nicolas PitreOct 19, 2009
  7. Junio C HamanoOct 18, 2009
  8. Norbert PreiningOct 19, 2009
  9. alexandrulOct 18, 2009
  10. demerphqOct 18, 2009
  11. Norbert PreiningOct 18, 2009
  12. demerphqOct 18, 2009
  13. alexandrulOct 18, 2009
  14. Jon SmirlOct 18, 2009
  15. Daniel BarkalowOct 18, 2009
  16. Norbert PreiningOct 19, 2009
  17. Daniel BarkalowOct 19, 2009
  18. Norbert PreiningOct 19, 2009
  19. Daniel BarkalowOct 19, 2009
  20. Nicolas PitreOct 19, 2009
  21. Norbert PreiningOct 19, 2009
  22. Johannes SixtOct 19, 2009
  23. David AguilarOct 21, 2009

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.