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

Re: Tracking branch history

From
Linus Torvalds <torvalds@osdl.org>
Date
May 13, 2006, 04:38 UTC
Message-ID
<Pine.LNX.4.64.0605122136100.3866@g5.osdl.org>
In-Reply-To
<20060513034051.GA21586@spearce.org>
On Fri, 12 May 2006, Shawn Pearce wrote:
Show 14 quoted lines
> 
> Why not intergrate this into git-update-ref.  Almost every tool which
> deals with a GIT repository (aside from my pure-Java Eclipse plugin
> which is still a major work-in-process) performs ref changes through
> git-udpate-ref.  So just have it append the ref's history to a file:
> 
> 	.git/log/refs/heads/$branch
> 
> where the history records are stored as:
> 
> 	40 byte commit-ish SHA1
> 	<SP>
> 	<committer>
> 	<LF>

Sure. Except it's not really "committer", in the ordinary sense (there's no "commit" for a fast-forward). But yes, re-using that format (with date and all) makes sense.

> Of course a major issue here is locking the log file during the ref
> update, but it looks like it might just be safe to append the entry
> to the log file right after the re_verify and before the rename.

I'd suggest just opening it with O_APPEND, and doing the update with a single write() system call. Let the OS do the locking for you.

		Linus
Previous: Shawn PearceNext: Junio C Hamano
Message 6 of 21 in “Tracking branch history”
  1. Daniel BarkalowMay 12, 2006
  2. Linus TorvaldsMay 12, 2006
  3. Linus TorvaldsMay 13, 2006
  4. Daniel BarkalowMay 13, 2006
  5. Shawn PearceMay 13, 2006
  6. Linus TorvaldsMay 13, 2006
  7. Junio C HamanoMay 13, 2006
  8. Shawn PearceMay 13, 2006
  9. Shawn PearceMay 13, 2006
  10. Linus TorvaldsMay 13, 2006
  11. Junio C HamanoMay 13, 2006
  12. Shawn PearceMay 13, 2006
  13. Junio C HamanoMay 14, 2006
  14. Shawn PearceMay 15, 2006
  15. Shawn PearceMay 15, 2006
  16. Junio C HamanoMay 15, 2006
  17. Shawn PearceMay 15, 2006
  18. Shawn PearceMay 15, 2006
  19. Linus TorvaldsMay 13, 2006
  20. ElrondMay 13, 2006
  21. Junio C HamanoMay 14, 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.