Re: diff/Checking out by date specification

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

 



On Mon, 30 Jun 2008, Toby Corkindale wrote:

> Jeff King wrote:
> > On Mon, Jun 30, 2008 at 12:24:03PM +1000, Toby Corkindale wrote:
> > 
> > > `man git-rev-parse` seems to indicate that one can look at the state of
> > > the repository by date (absolute or relative), and use this for diff or
> > > checkout, etc.
> > > It includes examples such as "{yesterday}" and "{1979-02-26 18:30:00}".
> > 
> > It's a little bit more complex than that. The branch@{time} syntax means
> > "what was in _my_ branch at that time". And if you just cloned, your
> > branch doesn't go back very far.
> > 
> > If you want to say "find commits that happened before time T", you want
> > --until or --since (or their aliases --before and --after).
> > 
> > Would the documentation patch below have helped with the confusion?
> 
> Ah, I see.
> Thanks, yes, that would have made the issue clearer.
> 
> I think it would be good if you could give a couple of examples, such as:
> How would I go about checking out the code at the state it was in at, say,
> 2008-01-01?
> Or how one can get a diff between 2008-01-01 and 2008-01-08?

That's not well-defined, except in a particular location. It's pretty 
likely that there were some changes that were made by different people 
late in 2007, and languished in their local repositories, and were never 
merged with each other until after some further changes had been made and 
the holiday was over. So there isn't a single state of the code as of 
2008-01-01 to compare against.

The usual case for wanting the diff between 2008-01-01 and 2008-01-08 is 
that you encountered some version on each of those dates, and you want to 
know what the difference is between them, and reflogs work for that, but 
it's also possible that what you want is the states that were somewhere 
else at that point, and I don't think we have a good solution for that 
currently unless you can run git commands there to look at the reflog for 
that location.

But, in general, with a distributed system like git, you'll do better to 
look at the history graph around that time with gitk and find the states 
you're actually interested in by other features or a combination of 
features.

	-Daniel
*This .sig left intentionally blank*
--
To unsubscribe from this list: 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]

  Powered by Linux