{"thread":{"id":"26359","subject":"Keeping the file modification date with git","startedAt":"2011-01-28T19:49:39Z","lastAt":"2011-01-28T22:25:52Z","messageCount":2,"participants":["Ronan Keryell","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"160005","messageId":"87bp30vmek.fsf@an-dro.info.enstb.org","threadId":"26359","inReplyTo":null,"subject":"Keeping the file modification date with git","fromName":"Ronan Keryell","fromEmail":"ronan.keryell@hpc-project.com","sentAt":"2011-01-28T19:49:39Z","receivedAt":"2011-01-28T19:49:39Z","isPatch":false,"sender":{"key":"ronan.keryell@hpc-project.com","avatar":null},"body":"After heavily using git for code development, we plan to use it for\nadministrative storage and I need to keep the modification date\nof the files.\n\nSince I'm fond of git, I don't want to go back to some other tools I\npreviously used but that keep the modification date... :-)\n\nSo I'm envisioning different solutions:\n\n- it is already done. I have missed this. :-) But would be great. :-)\n\n- giving up. Not an option :-)\n\n- it is added to git core functions because it is quite useful for some\n  people. Too time-consuming for me since I'm not a git developer... But\n  someone else could do this...\n\n- add this concept aside. For example, just as there are .gitignore or\n  .gitattributes files, we could have a .gitdates that would store in a\n  human-readable manner the modification time of the files in its\n  directory.\n\n  A nice side effect is that if we have conflicts on modification times\n  during merge, we could just resolve conflict in the date file. :-) Of\n  course, having merge tools aware of this could help the user to deal\n  with this.\n\n  By the way, we could consider modification time as a special attribute\n  in .gitattributes to avoid yet another .git file? But I guess that the\n  date information may be huge for a big directory, so it may be better\n  to keep in a dedicated sorted file, to be processed efficiently\n  without messing .gitattributes\n\n  The implementation could be done with helper functions called from\n  various hooks such as:\n\n    - updating the .gitdates could be done in the pre-commit hook so\n      that they are added to the commit when needed;\n\n    - when a checkout is done, the date of some files may be update. I\n      cannot see any hook for this...\n\n  Well there are many things that should be triggered in the git\n  plumbing or the user should have to launch explicitly some helper\n  functions (for example to commit only a date change, since from the git\n  point of view, nothing has changed and the commit is not done...).\n\n  I have no idea about the execution time we would have on a big\n  repository with many files, with a naive implementation to test the\n  concept...\n\nAny comments on the different approaches?\n\nThanks,\n-- \n  Ronan KERYELL                      |\\/  GSM:    (+33|0) 6 13 14 37 66\n  HPC Project                        |/)  Fax:    (+33|0) 1 46 01 05 46\n  9 Route du Colonel Marcel Moraine  K    E-mail: rk@hpc-project.com\n  92360 Meudon La Forêt              |\\   skype:keryell\n  FRANCE                             | \\  http://hpc-project.com\n"},{"id":"160012","messageId":"20110128222552.GA10372@sigill.intra.peff.net","threadId":"26359","inReplyTo":"87bp30vmek.fsf@an-dro.info.enstb.org","subject":"Re: Keeping the file modification date with git","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-01-28T22:25:52Z","receivedAt":"2011-01-28T22:25:52Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jan 28, 2011 at 08:49:39PM +0100, Ronan Keryell wrote:\n\n> After heavily using git for code development, we plan to use it for\n> administrative storage and I need to keep the modification date\n> of the files.\n> [...]\n> So I'm envisioning different solutions:\n> \n> - it is already done. I have missed this. :-) But would be great. :-)\n\nNope. The tree format does not have a date field.\n\n> - giving up. Not an option :-)\n\nRight. :)\n\n> - it is added to git core functions because it is quite useful for some\n>   people. Too time-consuming for me since I'm not a git developer... But\n>   someone else could do this...\n\nNope. That would require changing one of the fundamental data structures\nof git (the tree object) and is not likely to happen for a variety of\nreasons (mostly it becomes a performance hit and a compatibility issue\nwhen the majority of people don't even care about this issue).\n\n> - add this concept aside. For example, just as there are .gitignore or\n>   .gitattributes files, we could have a .gitdates that would store in a\n>   human-readable manner the modification time of the files in its\n>   directory.\n\nYep, this is a good solution. Check out metastore:\n\n  http://david.hardeman.nu/software.php\n\n-Peff\n"}]}