Re: Tracking branch history

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

 




On Fri, 12 May 2006, Linus Torvalds wrote:
> 
> IOW, a good (?) way to do it is to literally have a commit hook that 
> basically just does
> 
> 	echo $new >> .git/$branch-commit-history
> 
> possibly together with a datestamp thing (ie it could be something like
> "echo $new "$USER" $(date)" rather than just the commit SHA1).

Btw, the real problem with this is how to use it.

The only really valid use I see is to use it for date-based things, ie if 
given a date, look up the most recent commit ID that is older than the 
date in question. No other op seems to really make sense, but that one 
does.

Now, the one other operation that is semantically sensible is to use the 
list of commits to figure out a "path" through the commit space. However, 
that path won't actually even be well-defined (a fast-forward pull/merge 
can and often /will/ update the history in a way where it's impossible to 
select one particular path to the previous commit listed in the commit 
log).

The other thing that makes the "path" thing hard is that it's just 
fundamentally a pretty hard thing to calculate, even when it would result 
in one unambiguous path. I _believe_ that it comes close to what "git 
bisect" does, and that the bisect algorithm could probably be used to 
always create _a_ path between each commit (is just pick successive 
half-way-points - the commit list _should_ always have a direct dominance 
relationship, but the bisection algorithm should do something half-way 
sane even if you "jump about" by "git reset" or something).

It might be interesting to see if it's somethign that can be done 
reasonably efficiently.

			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]