Re: git and time

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

 




On Thu, 28 Sep 2006, Matthew L Foster wrote:
> 
> It should be possible to export git data, through say a web interface, 
> in a such a way that local time order is consistent with commit order.

I really don't think the thing you ask for exists.

Don't get me wrong. You _can_ have a local time for each commit that 
tracks "when did this commit show up in this particular branch". Git 
already supports that, even if gitweb cannot show it, and in fact showing 
it would be very hard (since the exact same commit can often exist in 
multiple different branches, you'd have to show multiple times: in Junios 
"git" tree you often have a commit that showed up in the "next" branch 
three weeks ago, but in the "master" branch only yesterday).

The _problem_ with this is that it makes the whole concept of time 
meaningless. It's pointless. You can do it, but I guarantee you that once 
you actually use it for a while, you'll want to go back. There are several 
reasons for that:

 - it means that the -same- exact project, when looked at frm two 
   different sites that mirror it, have totally different times. In other 
   words, the times have become pointless for something like gitweb.

 - it means that all times will be seriously "compressed", in that you'll 
   find hundreds (or thousands) of commits that just have the same 
   timestamp. You could try to "spread them out" by just making up some 
   totally arbitrary mapping function, but that would basically have 
   absolutely no basis in anything that has any relationship to "reality"

So it just doesn't make any sense.

The only thing that makes sense is that in your private repository (that 
is _not_ exported to others through "gitweb" or something like that), you 
can ask yourself the question:

	"What did my tree look like yesterday before I went out for a 
	 beer, and came back drunk as a toad, and screwed everything up?"

And the thing is, you can do that already. Just say

	git log "master@{18 hours ago}"

and git will hopefully show you (assuming you had enabled ref-logging as 
described earlier in this thread) exactly what you wanted.

See? 

But it does not make sense in _any_ other setting. Certainly not gitweb.

			Linus
-
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]