git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git "Keeping Original Dates"
@ 2017-06-05 21:14 Hector Santos
  2017-06-05 21:25 ` Jason Pyeron
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Hector Santos @ 2017-06-05 21:14 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

I'm implementing GIT.  If there an option or compile/version that 
"keep" file timestamps?

-- 
Hector, Engineering & Technical Support
Santronics Software, Inc.
http://www.santronics.com (sales)
http://www.winserver.com (support)
http://www.winserver.com/AupInfo (Online AUP Help)
Office: 305-248-3204


[-- Attachment #2: winserver_support.vcf --]
[-- Type: text/x-vcard, Size: 145 bytes --]

begin:vcard
fn:Hector Santos
n:Santos;Hector
email;internet:winserver.support@winserver.com
tel;work:305-248-3204
version:2.1
end:vcard


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

* RE: Git "Keeping Original Dates"
  2017-06-05 21:14 Git "Keeping Original Dates" Hector Santos
@ 2017-06-05 21:25 ` Jason Pyeron
  2017-06-05 22:06   ` Ævar Arnfjörð Bjarmason
  2017-06-05 21:27 ` Ævar Arnfjörð Bjarmason
  2017-06-06  7:12 ` Konstantin Khomoutov
  2 siblings, 1 reply; 9+ messages in thread
From: Jason Pyeron @ 2017-06-05 21:25 UTC (permalink / raw)
  To: 'Hector Santos', git

> -----Original Message-----
> From: Hector Santos
> Sent: Monday, June 5, 2017 5:14 PM
> 
> I'm implementing GIT.  If there an option or compile/version that "keep"
file timestamps?

That is not in the tree data structure, see below.

root@blackfat /projects/tipsoftheday
$ git cat-file -p head
tree 4ca3c2a853c8e817d7de8563c331899cace8ee85
parent 2a33f293df6df0d3978612e41fb1ecd52e2450a5
author Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400
committer Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400

add JDK to CM

root@blackfat /projects/tipsoftheday
$ git cat-file -p 4ca3c2a853c8e817d7de8563c331899cace8ee85
040000 tree 76094b81b3877b5b27cd4fe518fa0708af3cefed    admin
040000 tree c66a88871c285e1485f92be0f8fa47185d94d0b3    client
040000 tree 460495af209a580e65b5d0b38132d774ddb283b7    database
040000 tree 264b191b036180039f3fd8c5d56c2b6800cb2ca2    doc
040000 tree dd128195971f7bafa56371aa6027d7c6bc80f351    middleware
040000 tree 7861fd39923950d501d4e39aeac4762f7daaca6b    reports
040000 tree 2ad3dedf0313ae775321c88c53741a4b4a7e87b0    tools

I wish it was an allowable extension, the date could be between the mode and
object type. 

v/r,

Jason Pyeron


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

* Re: Git "Keeping Original Dates"
  2017-06-05 21:14 Git "Keeping Original Dates" Hector Santos
  2017-06-05 21:25 ` Jason Pyeron
@ 2017-06-05 21:27 ` Ævar Arnfjörð Bjarmason
  2017-06-06  1:22   ` Jeff King
  2017-06-06  7:12 ` Konstantin Khomoutov
  2 siblings, 1 reply; 9+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-05 21:27 UTC (permalink / raw)
  To: Hector Santos; +Cc: Git Mailing List

On Mon, Jun 5, 2017 at 11:14 PM, Hector Santos
<winserver.support@winserver.com> wrote:
> I'm implementing GIT.  If there an option or compile/version that "keep"
> file timestamps?

The git datamodel stores files as a list of names and whether or not
they have the executable bit.

If you need to set the ctime/mtime/whatever on the other side you'd do
that via some script you'd ship with your repository.

This may not answer your question, but it isn't very clear.

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

* Re: Git "Keeping Original Dates"
  2017-06-05 21:25 ` Jason Pyeron
@ 2017-06-05 22:06   ` Ævar Arnfjörð Bjarmason
  2017-06-05 23:36     ` Hector Santos
  0 siblings, 1 reply; 9+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-05 22:06 UTC (permalink / raw)
  To: Hector Santos, Git Mailing List

On Mon, Jun 5, 2017 at 11:25 PM, Jason Pyeron <jpyeron@pdinc.us> wrote:
>> -----Original Message-----
>> From: Hector Santos
>> Sent: Monday, June 5, 2017 5:14 PM
>>
>> I'm implementing GIT.  If there an option or compile/version that "keep"
> file timestamps?
>
> That is not in the tree data structure, see below.
>
> root@blackfat /projects/tipsoftheday
> $ git cat-file -p head
> tree 4ca3c2a853c8e817d7de8563c331899cace8ee85
> parent 2a33f293df6df0d3978612e41fb1ecd52e2450a5
> author Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400
> committer Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400
>
> add JDK to CM
>
> root@blackfat /projects/tipsoftheday
> $ git cat-file -p 4ca3c2a853c8e817d7de8563c331899cace8ee85
> 040000 tree 76094b81b3877b5b27cd4fe518fa0708af3cefed    admin
> 040000 tree c66a88871c285e1485f92be0f8fa47185d94d0b3    client
> 040000 tree 460495af209a580e65b5d0b38132d774ddb283b7    database
> 040000 tree 264b191b036180039f3fd8c5d56c2b6800cb2ca2    doc
> 040000 tree dd128195971f7bafa56371aa6027d7c6bc80f351    middleware
> 040000 tree 7861fd39923950d501d4e39aeac4762f7daaca6b    reports
> 040000 tree 2ad3dedf0313ae775321c88c53741a4b4a7e87b0    tools
>
> I wish it was an allowable extension, the date could be between the mode and
> object type.

Yes it's not part of the tree structure, but in this case you can
simply set/update the mtime to the date of the last commit that
modified the file.

It can be a bit expensive to bootstrap that, and git doesn't help you
along at all, you need to do it via hooks or some script you run, but
that's a neat way to shove it into the datamodel if you need this for
some reason.

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

* Re: Git "Keeping Original Dates"
  2017-06-05 22:06   ` Ævar Arnfjörð Bjarmason
@ 2017-06-05 23:36     ` Hector Santos
  2017-06-06 16:09       ` Theodore Ts'o
  0 siblings, 1 reply; 9+ messages in thread
From: Hector Santos @ 2017-06-05 23:36 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason, Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 2241 bytes --]


On 6/5/2017 6:06 PM, Ævar Arnfjörð Bjarmason wrote:
> On Mon, Jun 5, 2017 at 11:25 PM, Jason Pyeron <jpyeron@pdinc.us> wrote:
>>> -----Original Message-----
>>> From: Hector Santos
>>> Sent: Monday, June 5, 2017 5:14 PM
>>>
>>> I'm implementing GIT.  If there an option or compile/version that "keep"
>> file timestamps?
>>
>> That is not in the tree data structure, see below.
>>
>> root@blackfat /projects/tipsoftheday
>> $ git cat-file -p head
>> tree 4ca3c2a853c8e817d7de8563c331899cace8ee85
>> parent 2a33f293df6df0d3978612e41fb1ecd52e2450a5
>> author Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400
>> committer Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400
>>
>> add JDK to CM
>>
>> root@blackfat /projects/tipsoftheday
>> $ git cat-file -p 4ca3c2a853c8e817d7de8563c331899cace8ee85
>> 040000 tree 76094b81b3877b5b27cd4fe518fa0708af3cefed    admin
>> 040000 tree c66a88871c285e1485f92be0f8fa47185d94d0b3    client
>> 040000 tree 460495af209a580e65b5d0b38132d774ddb283b7    database
>> 040000 tree 264b191b036180039f3fd8c5d56c2b6800cb2ca2    doc
>> 040000 tree dd128195971f7bafa56371aa6027d7c6bc80f351    middleware
>> 040000 tree 7861fd39923950d501d4e39aeac4762f7daaca6b    reports
>> 040000 tree 2ad3dedf0313ae775321c88c53741a4b4a7e87b0    tools
>>
>> I wish it was an allowable extension, the date could be between the mode and
>> object type.
> Yes it's not part of the tree structure, but in this case you can
> simply set/update the mtime to the date of the last commit that
> modified the file.
>
> It can be a bit expensive to bootstrap that, and git doesn't help you
> along at all, you need to do it via hooks or some script you run, but
> that's a neat way to shove it into the datamodel if you need this for
> some reason.
>
>

Do you see any technical issues with using programmable hooks or 
something like this would have to be patched in? I am giving it a 
serious thought to exploring a fix to the Git Daemon over the wire 
completion issues on Windows. It appears to be a Half Close socket issue.

-- 
Hector, Engineering & Technical Support
Santronics Software, Inc.
http://www.santronics.com (sales)
http://www.winserver.com (support)
http://www.winserver.com/AupInfo (Online AUP Help)
Office: 305-248-3204


[-- Attachment #2: winserver_support.vcf --]
[-- Type: text/x-vcard, Size: 145 bytes --]

begin:vcard
fn:Hector Santos
n:Santos;Hector
email;internet:winserver.support@winserver.com
tel;work:305-248-3204
version:2.1
end:vcard


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

* Re: Git "Keeping Original Dates"
  2017-06-05 21:27 ` Ævar Arnfjörð Bjarmason
@ 2017-06-06  1:22   ` Jeff King
  2017-06-06  2:43     ` Hector Santos
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff King @ 2017-06-06  1:22 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Hector Santos, Git Mailing List

On Mon, Jun 05, 2017 at 11:27:45PM +0200, Ævar Arnfjörð Bjarmason wrote:

> On Mon, Jun 5, 2017 at 11:14 PM, Hector Santos
> <winserver.support@winserver.com> wrote:
> > I'm implementing GIT.  If there an option or compile/version that "keep"
> > file timestamps?
> 
> The git datamodel stores files as a list of names and whether or not
> they have the executable bit.
> 
> If you need to set the ctime/mtime/whatever on the other side you'd do
> that via some script you'd ship with your repository.

There are existing scripts which implement this approach, like
metastore:

  https://github.com/przemoc/metastore

I haven't used it, but I think it's fairly mature, as it has been around
since the early days of Git.

-Peff

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

* Re: Git "Keeping Original Dates"
  2017-06-06  1:22   ` Jeff King
@ 2017-06-06  2:43     ` Hector Santos
  0 siblings, 0 replies; 9+ messages in thread
From: Hector Santos @ 2017-06-06  2:43 UTC (permalink / raw)
  To: Jeff King, Ævar Arnfjörð Bjarmason; +Cc: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 715 bytes --]


On 6/5/2017 9:22 PM, Jeff King wrote:
> There are existing scripts which implement this approach, like
> metastore:
>
>    https://github.com/przemoc/metastore
>
> I haven't used it, but I think it's fairly mature, as it has been around
> since the early days of Git.
>
> -Peff
>

I wasn't considering other "metadata" other than time stamps, but I 
suppose the metadata would include the time stamps, file attributes 
and possibly "alternate file streams" as well?

Thanks anyway, I will explore it.

-- 
Hector, Engineering & Technical Support
Santronics Software, Inc.
http://www.santronics.com (sales)
http://www.winserver.com (support)
http://www.winserver.com/AupInfo (Online AUP Help)
Office: 305-248-3204


[-- Attachment #2: winserver_support.vcf --]
[-- Type: text/x-vcard, Size: 145 bytes --]

begin:vcard
fn:Hector Santos
n:Santos;Hector
email;internet:winserver.support@winserver.com
tel;work:305-248-3204
version:2.1
end:vcard


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

* Re: Git "Keeping Original Dates"
  2017-06-05 21:14 Git "Keeping Original Dates" Hector Santos
  2017-06-05 21:25 ` Jason Pyeron
  2017-06-05 21:27 ` Ævar Arnfjörð Bjarmason
@ 2017-06-06  7:12 ` Konstantin Khomoutov
  2 siblings, 0 replies; 9+ messages in thread
From: Konstantin Khomoutov @ 2017-06-06  7:12 UTC (permalink / raw)
  To: Hector Santos; +Cc: git

On Mon, Jun 05, 2017 at 05:14:01PM -0400, Hector Santos wrote:
> I'm implementing GIT.  If there an option or compile/version that "keep"
> file timestamps?

Just in case you've missed it, there's an explanation of why Git behaves
the way it does in this regard [1].

1.  https://git.wiki.kernel.org/index.php/Git_FAQ#Why_isn.27t_Git_preserving_modification_time_on_files.3F


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

* Re: Git "Keeping Original Dates"
  2017-06-05 23:36     ` Hector Santos
@ 2017-06-06 16:09       ` Theodore Ts'o
  0 siblings, 0 replies; 9+ messages in thread
From: Theodore Ts'o @ 2017-06-06 16:09 UTC (permalink / raw)
  To: Hector Santos; +Cc: Ævar Arnfjörð Bjarmason, Git Mailing List

On Mon, Jun 05, 2017 at 07:36:58PM -0400, Hector Santos wrote:
> Do you see any technical issues with using programmable hooks or something
> like this would have to be patched in? I am giving it a serious thought to
> exploring a fix to the Git Daemon over the wire completion issues on
> Windows. It appears to be a Half Close socket issue.

You can certainly do it with so kind of hook script.  

This is how I do thing to maintain the modtimes for a set of patches
that I maintain using guilt (git://repo.or.cz/guilt.git).  The
following is done using Linux, but I imagine you could translate it
into something that would work with powershell, or cygwin, or just use
the Windows Subsystem for Linux.

#!/bin/sh
stat -c "touch -d @%Y %n" * | sort -k 3 | grep -v "~$" | sort -k3 > timestamps

I have this shell script saved as ~/bin/save-timestamps.  The generated file
has lines which look this:

touch -d @1496078695 fix-fdatasync-after-extent-manipulation-operations
touch -d @1496081597 status
touch -d @1496082752 series

... and when you execute the command, it will restore the timestamps
to the value checked into the git repository.  If you want to only
restore the timestamp of a single file, you can do something like this:

grep timestamps ^fix-fdatasync-after-extent | bash

Cheers,

						- Ted

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

end of thread, other threads:[~2017-06-06 16:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 21:14 Git "Keeping Original Dates" Hector Santos
2017-06-05 21:25 ` Jason Pyeron
2017-06-05 22:06   ` Ævar Arnfjörð Bjarmason
2017-06-05 23:36     ` Hector Santos
2017-06-06 16:09       ` Theodore Ts'o
2017-06-05 21:27 ` Ævar Arnfjörð Bjarmason
2017-06-06  1:22   ` Jeff King
2017-06-06  2:43     ` Hector Santos
2017-06-06  7:12 ` Konstantin Khomoutov

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).