git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* keyword expansion
@ 2005-04-25  0:23 Thomas Glanzmann
  2005-04-25 17:56 ` mod-times (was: keyword expansion) tony.luck
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Glanzmann @ 2005-04-25  0:23 UTC (permalink / raw)
  To: GIT

Hello,
I am aware that keyword expansion is at the moment at the very bottom of
the todo list. However I need it. Has someone something ready to use? I
am looking for the following informations:

	- Time stamp of the last modification of a file
	- last Committer/Author of the file

What I want is a script which runs after an export that checks for
keywords in files and expands them using informations extracted out of
the tree.  I would be gratefull for any pointers/shell snippsets.

I just migrated my mutt vendor tracking tree to git and it works quiet
well. Thanks for all the effort!

Greetings,
	Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* mod-times (was: keyword expansion)
  2005-04-25  0:23 keyword expansion Thomas Glanzmann
@ 2005-04-25 17:56 ` tony.luck
  2005-04-25 18:10   ` Thomas Glanzmann
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: tony.luck @ 2005-04-25 17:56 UTC (permalink / raw)
  To: Thomas Glanzmann; +Cc: git

> I am aware that keyword expansion is at the moment at the very bottom of
> the todo list. However I need it. Has someone something ready to use? I
> am looking for the following informations:
> 
> 	- Time stamp of the last modification of a file

One way to do this would be to rip on some of the core fundamentals of GIT
and store the time that an object was created inside the object. E.g.

   blob size secs-since-1970 ...

Then "read-tree" could fill this into the cache, and checkout-cache could
set the mod-time on the file when it creates it, which would mean that you
could see the timestamp for a file simply by using "ls -l file".

I think we'd need some other justifications before this would stand any
hope of getting in though, since it makes such a huge incompatible change
to the basic GIT format :-)  Maybe queue the idea for GIT2.0?

-Tony

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mod-times (was: keyword expansion)
  2005-04-25 17:56 ` mod-times (was: keyword expansion) tony.luck
@ 2005-04-25 18:10   ` Thomas Glanzmann
  2005-04-25 18:13   ` Geert Bosch
  2005-04-26  0:34   ` Linus Torvalds
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Glanzmann @ 2005-04-25 18:10 UTC (permalink / raw)
  To: git

Hi,


> > 	- Time stamp of the last modification of a file

> One way to do this would be to rip on some of the core fundamentals of GIT
> and store the time that an object was created inside the object. E.g.

I think I have nearly something finished. Using rev-tree, cat-file and
ls-tree -r written in perl.

>    blob size secs-since-1970 ...

I dislike the idea because of reasons Torvalds has already mentioned
when talking about file renames and cvs annotate. And it also would fit
only this special case.

Having a 'git export' with real timestamps would be fun, but when I
think it over I don't really need it. And if I need it it would be a
matter of 20 minutes. :-)

	Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mod-times (was: keyword expansion)
  2005-04-25 17:56 ` mod-times (was: keyword expansion) tony.luck
  2005-04-25 18:10   ` Thomas Glanzmann
@ 2005-04-25 18:13   ` Geert Bosch
  2005-04-26  0:34   ` Linus Torvalds
  2 siblings, 0 replies; 5+ messages in thread
From: Geert Bosch @ 2005-04-25 18:13 UTC (permalink / raw)
  To: tony.luck; +Cc: Thomas Glanzmann, git


On Apr 25, 2005, at 13:56, tony.luck@intel.com wrote:
>> 	- Time stamp of the last modification of a file
>
> One way to do this would be to rip on some of the core fundamentals of 
> GIT
> and store the time that an object was created inside the object. E.g.
>
>    blob size secs-since-1970 ...
>
> Then "read-tree" could fill this into the cache, and checkout-cache 
> could
> set the mod-time on the file when it creates it, which would mean that 
> you
> could see the timestamp for a file simply by using "ls -l file".

Of course this negates the idea of content-based storage, since you
want two copies of the same content with different time-stamps to share
the same blob.

   -Geert


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mod-times (was: keyword expansion)
  2005-04-25 17:56 ` mod-times (was: keyword expansion) tony.luck
  2005-04-25 18:10   ` Thomas Glanzmann
  2005-04-25 18:13   ` Geert Bosch
@ 2005-04-26  0:34   ` Linus Torvalds
  2 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2005-04-26  0:34 UTC (permalink / raw)
  To: tony.luck; +Cc: Thomas Glanzmann, git



On Mon, 25 Apr 2005 tony.luck@intel.com wrote:
> 
> One way to do this would be to rip on some of the core fundamentals of GIT
> and store the time that an object was created inside the object. E.g.
> 
>    blob size secs-since-1970 ...

You really don't want that.

The thing is, somebody doing a "touch" on a file should _not_ cause that 
tree to be committed as a new tree.

Trying to save mtime in a git archive is about a million times worse than 
saving the whole "mode" information, and there we already ended up cutting 
it down to just one bit, exactly because it was horrible not to.

So this is not about git formats, this is about it just not being 
practical to do. Git simply isn't a good thing to store mtime in.

			Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-04-26  0:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-25  0:23 keyword expansion Thomas Glanzmann
2005-04-25 17:56 ` mod-times (was: keyword expansion) tony.luck
2005-04-25 18:10   ` Thomas Glanzmann
2005-04-25 18:13   ` Geert Bosch
2005-04-26  0:34   ` Linus Torvalds

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).