{"thread":{"id":"46122","subject":"Git \"Keeping Original Dates\"","startedAt":"2017-06-05T21:19:39Z","lastAt":"2017-06-06T16:09:58Z","messageCount":9,"participants":["Hector Santos","Ævar Arnfjörð Bjarmason","Jason Pyeron","Jeff King","Konstantin Khomoutov","Theodore Ts'o"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"321565","messageId":"5935C999.5060801@winserver.com","threadId":"46122","inReplyTo":null,"subject":"Git \"Keeping Original Dates\"","fromName":"Hector Santos","fromEmail":"winserver.support@winserver.com","sentAt":"2017-06-05T21:14:01Z","receivedAt":"2017-06-05T21:19:39Z","isPatch":false,"sender":{"key":"winserver.support@winserver.com","avatar":null},"body":"I'm implementing GIT.  If there an option or compile/version that \n\"keep\" file timestamps?\n\n-- \nHector, Engineering & Technical Support\nSantronics Software, Inc.\nhttp://www.santronics.com (sales)\nhttp://www.winserver.com (support)\nhttp://www.winserver.com/AupInfo (Online AUP Help)\nOffice: 305-248-3204\n\n\n\nbegin:vcard\nfn:Hector Santos\nn:Santos;Hector\nemail;internet:winserver.support@winserver.com\ntel;work:305-248-3204\nversion:2.1\nend:vcard\n\n"},{"id":"321566","messageId":"CACBZZX4t+dJA-G9r+LuskmkpR5oR7+YMUSCZgL3GCgPcKkda2Q@mail.gmail.com","threadId":"46122","inReplyTo":"5935C999.5060801@winserver.com","subject":"Re: Git \"Keeping Original Dates\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-06-05T21:27:45Z","receivedAt":"2017-06-05T21:28:11Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Jun 5, 2017 at 11:14 PM, Hector Santos\n<winserver.support@winserver.com> wrote:\n> I'm implementing GIT.  If there an option or compile/version that \"keep\"\n> file timestamps?\n\nThe git datamodel stores files as a list of names and whether or not\nthey have the executable bit.\n\nIf you need to set the ctime/mtime/whatever on the other side you'd do\nthat via some script you'd ship with your repository.\n\nThis may not answer your question, but it isn't very clear.\n"},{"id":"321567","messageId":"1C2B896999CB4549BCAC61EB369E932E@blackfat","threadId":"46122","inReplyTo":"5935C999.5060801@winserver.com","subject":"RE: Git \"Keeping Original Dates\"","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2017-06-05T21:25:48Z","receivedAt":"2017-06-05T21:41:18Z","isPatch":false,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"> -----Original Message-----\n> From: Hector Santos\n> Sent: Monday, June 5, 2017 5:14 PM\n> \n> I'm implementing GIT.  If there an option or compile/version that \"keep\"\nfile timestamps?\n\nThat is not in the tree data structure, see below.\n\nroot@blackfat /projects/tipsoftheday\n$ git cat-file -p head\ntree 4ca3c2a853c8e817d7de8563c331899cace8ee85\nparent 2a33f293df6df0d3978612e41fb1ecd52e2450a5\nauthor Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400\ncommitter Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400\n\nadd JDK to CM\n\nroot@blackfat /projects/tipsoftheday\n$ git cat-file -p 4ca3c2a853c8e817d7de8563c331899cace8ee85\n040000 tree 76094b81b3877b5b27cd4fe518fa0708af3cefed    admin\n040000 tree c66a88871c285e1485f92be0f8fa47185d94d0b3    client\n040000 tree 460495af209a580e65b5d0b38132d774ddb283b7    database\n040000 tree 264b191b036180039f3fd8c5d56c2b6800cb2ca2    doc\n040000 tree dd128195971f7bafa56371aa6027d7c6bc80f351    middleware\n040000 tree 7861fd39923950d501d4e39aeac4762f7daaca6b    reports\n040000 tree 2ad3dedf0313ae775321c88c53741a4b4a7e87b0    tools\n\nI wish it was an allowable extension, the date could be between the mode and\nobject type. \n\nv/r,\n\nJason Pyeron\n\n"},{"id":"321568","messageId":"CACBZZX7VpmEjbzwGd+S15xVLRrkYRxqcf0LUKF1B7pAsd7Lr4w@mail.gmail.com","threadId":"46122","inReplyTo":"1C2B896999CB4549BCAC61EB369E932E@blackfat","subject":"Re: Git \"Keeping Original Dates\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-06-05T22:06:18Z","receivedAt":"2017-06-05T22:06:45Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Jun 5, 2017 at 11:25 PM, Jason Pyeron <jpyeron@pdinc.us> wrote:\n>> -----Original Message-----\n>> From: Hector Santos\n>> Sent: Monday, June 5, 2017 5:14 PM\n>>\n>> I'm implementing GIT.  If there an option or compile/version that \"keep\"\n> file timestamps?\n>\n> That is not in the tree data structure, see below.\n>\n> root@blackfat /projects/tipsoftheday\n> $ git cat-file -p head\n> tree 4ca3c2a853c8e817d7de8563c331899cace8ee85\n> parent 2a33f293df6df0d3978612e41fb1ecd52e2450a5\n> author Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400\n> committer Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400\n>\n> add JDK to CM\n>\n> root@blackfat /projects/tipsoftheday\n> $ git cat-file -p 4ca3c2a853c8e817d7de8563c331899cace8ee85\n> 040000 tree 76094b81b3877b5b27cd4fe518fa0708af3cefed    admin\n> 040000 tree c66a88871c285e1485f92be0f8fa47185d94d0b3    client\n> 040000 tree 460495af209a580e65b5d0b38132d774ddb283b7    database\n> 040000 tree 264b191b036180039f3fd8c5d56c2b6800cb2ca2    doc\n> 040000 tree dd128195971f7bafa56371aa6027d7c6bc80f351    middleware\n> 040000 tree 7861fd39923950d501d4e39aeac4762f7daaca6b    reports\n> 040000 tree 2ad3dedf0313ae775321c88c53741a4b4a7e87b0    tools\n>\n> I wish it was an allowable extension, the date could be between the mode and\n> object type.\n\nYes it's not part of the tree structure, but in this case you can\nsimply set/update the mtime to the date of the last commit that\nmodified the file.\n\nIt can be a bit expensive to bootstrap that, and git doesn't help you\nalong at all, you need to do it via hooks or some script you run, but\nthat's a neat way to shove it into the datamodel if you need this for\nsome reason.\n"},{"id":"321579","messageId":"5935EB1A.5010100@winserver.com","threadId":"46122","inReplyTo":"CACBZZX7VpmEjbzwGd+S15xVLRrkYRxqcf0LUKF1B7pAsd7Lr4w@mail.gmail.com","subject":"Re: Git \"Keeping Original Dates\"","fromName":"Hector Santos","fromEmail":"winserver.support@winserver.com","sentAt":"2017-06-05T23:36:58Z","receivedAt":"2017-06-05T23:37:12Z","isPatch":false,"sender":{"key":"winserver.support@winserver.com","avatar":null},"body":"\nOn 6/5/2017 6:06 PM, Ævar Arnfjörð Bjarmason wrote:\n> On Mon, Jun 5, 2017 at 11:25 PM, Jason Pyeron <jpyeron@pdinc.us> wrote:\n>>> -----Original Message-----\n>>> From: Hector Santos\n>>> Sent: Monday, June 5, 2017 5:14 PM\n>>>\n>>> I'm implementing GIT.  If there an option or compile/version that \"keep\"\n>> file timestamps?\n>>\n>> That is not in the tree data structure, see below.\n>>\n>> root@blackfat /projects/tipsoftheday\n>> $ git cat-file -p head\n>> tree 4ca3c2a853c8e817d7de8563c331899cace8ee85\n>> parent 2a33f293df6df0d3978612e41fb1ecd52e2450a5\n>> author Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400\n>> committer Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400\n>>\n>> add JDK to CM\n>>\n>> root@blackfat /projects/tipsoftheday\n>> $ git cat-file -p 4ca3c2a853c8e817d7de8563c331899cace8ee85\n>> 040000 tree 76094b81b3877b5b27cd4fe518fa0708af3cefed    admin\n>> 040000 tree c66a88871c285e1485f92be0f8fa47185d94d0b3    client\n>> 040000 tree 460495af209a580e65b5d0b38132d774ddb283b7    database\n>> 040000 tree 264b191b036180039f3fd8c5d56c2b6800cb2ca2    doc\n>> 040000 tree dd128195971f7bafa56371aa6027d7c6bc80f351    middleware\n>> 040000 tree 7861fd39923950d501d4e39aeac4762f7daaca6b    reports\n>> 040000 tree 2ad3dedf0313ae775321c88c53741a4b4a7e87b0    tools\n>>\n>> I wish it was an allowable extension, the date could be between the mode and\n>> object type.\n> Yes it's not part of the tree structure, but in this case you can\n> simply set/update the mtime to the date of the last commit that\n> modified the file.\n>\n> It can be a bit expensive to bootstrap that, and git doesn't help you\n> along at all, you need to do it via hooks or some script you run, but\n> that's a neat way to shove it into the datamodel if you need this for\n> some reason.\n>\n>\n\nDo you see any technical issues with using programmable hooks or \nsomething like this would have to be patched in? I am giving it a \nserious thought to exploring a fix to the Git Daemon over the wire \ncompletion issues on Windows. It appears to be a Half Close socket issue.\n\n-- \nHector, Engineering & Technical Support\nSantronics Software, Inc.\nhttp://www.santronics.com (sales)\nhttp://www.winserver.com (support)\nhttp://www.winserver.com/AupInfo (Online AUP Help)\nOffice: 305-248-3204\n\n\n\nbegin:vcard\nfn:Hector Santos\nn:Santos;Hector\nemail;internet:winserver.support@winserver.com\ntel;work:305-248-3204\nversion:2.1\nend:vcard\n\n"},{"id":"321588","messageId":"20170606012159.yqypreouvmmrfifd@sigill.intra.peff.net","threadId":"46122","inReplyTo":"CACBZZX4t+dJA-G9r+LuskmkpR5oR7+YMUSCZgL3GCgPcKkda2Q@mail.gmail.com","subject":"Re: Git \"Keeping Original Dates\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-06T01:22:00Z","receivedAt":"2017-06-06T01:22:08Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 05, 2017 at 11:27:45PM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> On Mon, Jun 5, 2017 at 11:14 PM, Hector Santos\n> <winserver.support@winserver.com> wrote:\n> > I'm implementing GIT.  If there an option or compile/version that \"keep\"\n> > file timestamps?\n> \n> The git datamodel stores files as a list of names and whether or not\n> they have the executable bit.\n> \n> If you need to set the ctime/mtime/whatever on the other side you'd do\n> that via some script you'd ship with your repository.\n\nThere are existing scripts which implement this approach, like\nmetastore:\n\n  https://github.com/przemoc/metastore\n\nI haven't used it, but I think it's fairly mature, as it has been around\nsince the early days of Git.\n\n-Peff\n"},{"id":"321593","messageId":"593616E3.6050903@winserver.com","threadId":"46122","inReplyTo":"20170606012159.yqypreouvmmrfifd@sigill.intra.peff.net","subject":"Re: Git \"Keeping Original Dates\"","fromName":"Hector Santos","fromEmail":"winserver.support@winserver.com","sentAt":"2017-06-06T02:43:47Z","receivedAt":"2017-06-06T02:43:58Z","isPatch":false,"sender":{"key":"winserver.support@winserver.com","avatar":null},"body":"\nOn 6/5/2017 9:22 PM, Jeff King wrote:\n> There are existing scripts which implement this approach, like\n> metastore:\n>\n>    https://github.com/przemoc/metastore\n>\n> I haven't used it, but I think it's fairly mature, as it has been around\n> since the early days of Git.\n>\n> -Peff\n>\n\nI wasn't considering other \"metadata\" other than time stamps, but I \nsuppose the metadata would include the time stamps, file attributes \nand possibly \"alternate file streams\" as well?\n\nThanks anyway, I will explore it.\n\n-- \nHector, Engineering & Technical Support\nSantronics Software, Inc.\nhttp://www.santronics.com (sales)\nhttp://www.winserver.com (support)\nhttp://www.winserver.com/AupInfo (Online AUP Help)\nOffice: 305-248-3204\n\n\n\nbegin:vcard\nfn:Hector Santos\nn:Santos;Hector\nemail;internet:winserver.support@winserver.com\ntel;work:305-248-3204\nversion:2.1\nend:vcard\n\n"},{"id":"321599","messageId":"20170606071236.x72rag2brfnxi7ii@tigra","threadId":"46122","inReplyTo":"5935C999.5060801@winserver.com","subject":"Re: Git \"Keeping Original Dates\"","fromName":"Konstantin Khomoutov","fromEmail":"kostix+git@007spb.ru","sentAt":"2017-06-06T07:12:36Z","receivedAt":"2017-06-06T07:12:43Z","isPatch":false,"sender":{"key":"kostix+git@007spb.ru","avatar":null},"body":"On Mon, Jun 05, 2017 at 05:14:01PM -0400, Hector Santos wrote:\n> I'm implementing GIT.  If there an option or compile/version that \"keep\"\n> file timestamps?\n\nJust in case you've missed it, there's an explanation of why Git behaves\nthe way it does in this regard [1].\n\n1.  https://git.wiki.kernel.org/index.php/Git_FAQ#Why_isn.27t_Git_preserving_modification_time_on_files.3F\n\n"},{"id":"321626","messageId":"20170606160949.cripodprbwxdi4dv@thunk.org","threadId":"46122","inReplyTo":"5935EB1A.5010100@winserver.com","subject":"Re: Git \"Keeping Original Dates\"","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2017-06-06T16:09:49Z","receivedAt":"2017-06-06T16:09:58Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Mon, Jun 05, 2017 at 07:36:58PM -0400, Hector Santos wrote:\n> Do you see any technical issues with using programmable hooks or something\n> like this would have to be patched in? I am giving it a serious thought to\n> exploring a fix to the Git Daemon over the wire completion issues on\n> Windows. It appears to be a Half Close socket issue.\n\nYou can certainly do it with so kind of hook script.  \n\nThis is how I do thing to maintain the modtimes for a set of patches\nthat I maintain using guilt (git://repo.or.cz/guilt.git).  The\nfollowing is done using Linux, but I imagine you could translate it\ninto something that would work with powershell, or cygwin, or just use\nthe Windows Subsystem for Linux.\n\n#!/bin/sh\nstat -c \"touch -d @%Y %n\" * | sort -k 3 | grep -v \"~$\" | sort -k3 > timestamps\n\nI have this shell script saved as ~/bin/save-timestamps.  The generated file\nhas lines which look this:\n\ntouch -d @1496078695 fix-fdatasync-after-extent-manipulation-operations\ntouch -d @1496081597 status\ntouch -d @1496082752 series\n\n... and when you execute the command, it will restore the timestamps\nto the value checked into the git repository.  If you want to only\nrestore the timestamp of a single file, you can do something like this:\n\ngrep timestamps ^fix-fdatasync-after-extent | bash\n\nCheers,\n\n\t\t\t\t\t\t- Ted\n"}]}