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

Re: Tracking branch history

From
Shawn Pearce <spearce@spearce.org>
Date
May 15, 2006, 06:38 UTC
Message-ID
<20060515063849.GA28337@spearce.org>
In-Reply-To
<7vac9jx0nq.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 21 quoted lines
> Shawn Pearce <spearce@spearce.org> writes:
> 
> > This is all well and good but its sort of useless without the diffcore
> > being able to lookup what SHA1 was valid on a given branch at a given
> > point in time.  :-)
> >
> > I'm thinking about extending the 'extended SHA1' syntax to accept
> > a date (or date expression) as a suffix:
> >
> > 	HEAD@'2 hours ago'
> > 	HEAD@'2006-04-20'
> > 	HEAD@'2006-04-20 14:12'
> >
> > etc... This would be merged into get_sha1 (sha1_name.c) so its
> > usable pretty much anywhere.  Does this seem reasonable?  If so
> > I'll work up a patch for it.
> 
> HEAD?
> 
> Are you going to hook into symbolic-ref as well to track branch
> switching?
I hadn't planned on it.  I was going to resolve the symref HEAD
down to the real ref (e.g. refs/heads/sp/ref-log) and then do the
date range searching on the real branch.  I didn't think it was
interesting to track what HEAD is.  But I think it would be very
common for the user to use HEAD rather than their actual branch
ref names when forming an expression.
 
[snip]
Show 18 quoted lines
> The time-warp format would make sense for individual branches,
> like refs/heads/master, though.
> 
> sha1_name.c and sha1_file.c were supposed to be real core, but
> get_sha1() is looking more and more Porcelainish these days, and
> I do not have much problem with being able to say "tip of this
> branch, two hours ago".
> 
> I am not sure about the syntax though.  We would want to be able
> to say "start from the commit that was at the tip of 'master'
> branch two days ago, grab its tree and look at arch/sparc64
> directory", so things like
> 
>             "master@2006-05-14 14:12"
>             "master@2006-05-14 14:12^{tree}"
>             "master@two days ago:arch/sparc64"
> 
> would need to be supported.

Yea, I realize that. I'm currently looking at get_sha1_1 and how I can put the date resolution in before the ^, ~ and :. :-)

-- 
Shawn.
Previous: Junio C HamanoNext: Shawn Pearce
Message 17 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.