git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Daniel Barkalow <barkalow@iabervon.org>, git@vger.kernel.org
Subject: Re: Tracking branch history
Date: Fri, 12 May 2006 23:40:51 -0400	[thread overview]
Message-ID: <20060513034051.GA21586@spearce.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0605121640210.3866@g5.osdl.org>

Linus Torvalds <torvalds@osdl.org> wrote:
> 
> On Fri, 12 May 2006, Daniel Barkalow wrote:
> >
> > One feature that might make git more intuitive to people is if we were to 
> > additionally track the history of what commit was the head of each branch 
> > over time. This is only vaguely related to the history of the content, but 
> > it's well-defined and sometimes significant.
> > 
> > E.g., if you know that two weeks ago, what you had worked, but it doesn't 
> > work now, you can use git-bisect to figure out what happened, but first 
> > you have to figure out what commit it was that you were using two weeks 
> > ago. Two weeks ago, we had that information, but we didn't keep it.
> 
> Note that this is possible, but it must be done literally as a separate 
> history from the commit history. 
> 
> 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).

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>

e.g.:

	cbb6d91d95e523c2b6a6b52577c4be28d18ace83 Shawn O. Pearce <spearce@spearce.org> 1137039378 -0500
	ae8c74e96a1e02bbfb7f1a9669b77d6f8ee6c3cf Shawn O. Pearce <spearce@spearce.org> 1136921470 -0500

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 wouldn't have git-update-ref create the log file. I'd would only
have it append if the log already exists.

Hmm, this actually looks like it would be really easy.  Maybe I'll
hack up an RFC patch this evening after dinner.

-- 
Shawn.

  parent reply	other threads:[~2006-05-13  3:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-12 23:18 Tracking branch history Daniel Barkalow
2006-05-12 23:45 ` Linus Torvalds
2006-05-13  0:03   ` Linus Torvalds
2006-05-13  4:27     ` Daniel Barkalow
2006-05-13  3:40   ` Shawn Pearce [this message]
2006-05-13  4:38     ` Linus Torvalds
2006-05-13  4:56     ` Junio C Hamano
2006-05-13  7:17       ` Shawn Pearce
2006-05-13  7:43         ` Shawn Pearce
2006-05-13 15:20           ` Linus Torvalds
2006-05-13 16:43             ` Junio C Hamano
2006-05-13 18:18               ` Shawn Pearce
2006-05-14 23:14                 ` Junio C Hamano
2006-05-15  3:15                   ` Shawn Pearce
2006-05-15  5:58                     ` Shawn Pearce
2006-05-15  6:27                       ` Junio C Hamano
2006-05-15  6:38                         ` Shawn Pearce
2006-05-15  9:53                           ` Shawn Pearce
2006-05-13 15:11         ` Linus Torvalds
2006-05-13 12:53 ` Elrond
2006-05-14 23:16   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060513034051.GA21586@spearce.org \
    --to=spearce@spearce.org \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).