Re: Tracking branch history

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 12 May 2006, Shawn Pearce wrote:
> 
> 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
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]