{"thread":{"id":"21348","subject":"date change of commit?","startedAt":"2009-10-25T11:35:23Z","lastAt":"2009-10-29T16:43:39Z","messageCount":7,"participants":["Alex K","Matthieu Moy","Miklos Vajna","Rogan Dawes","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"125878","messageId":"e4a904790910250435p3ff50dcfv5c0c6a86c13d17b@mail.gmail.com","threadId":"21348","inReplyTo":null,"subject":"date change of commit?","fromName":"Alex K","fromEmail":"spaceoutlet@gmail.com","sentAt":"2009-10-25T11:35:23Z","receivedAt":"2009-10-25T11:35:23Z","isPatch":false,"sender":{"key":"spaceoutlet@gmail.com","avatar":null},"body":"Hello,\n\nIs it possible to change the date of a commit?\n\nThank you,\n\nAlex\n"},{"id":"125904","messageId":"vpq1vkrqttt.fsf@bauges.imag.fr","threadId":"21348","inReplyTo":"e4a904790910250435p3ff50dcfv5c0c6a86c13d17b@mail.gmail.com","subject":"Re: date change of commit?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-10-25T17:14:38Z","receivedAt":"2009-10-25T17:14:38Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Alex K <spaceoutlet@gmail.com> writes:\n\n> Hello,\n>\n> Is it possible to change the date of a commit?\n\nSee git-filter-branch. This won't change the date of the existing\ncommit (which is impossible in Git), but will create another commit\nwhere only the date has been changed.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"125997","messageId":"e4a904790910270241g4a165023o30438c5d000b5de4@mail.gmail.com","threadId":"21348","inReplyTo":"vpq1vkrqttt.fsf@bauges.imag.fr","subject":"Re: date change of commit?","fromName":"Alex K","fromEmail":"spaceoutlet@gmail.com","sentAt":"2009-10-27T09:41:47Z","receivedAt":"2009-10-27T09:41:47Z","isPatch":false,"sender":{"key":"spaceoutlet@gmail.com","avatar":null},"body":"Thank you. And how would you use git-filter-branch to create another\nbranch with a different time stamp? Is it possible to commit under a\ndifferent time stamp than the one provided by your default local time?\n\n2009/10/25 Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>:\n> Alex K <spaceoutlet@gmail.com> writes:\n>\n>> Hello,\n>>\n>> Is it possible to change the date of a commit?\n>\n> See git-filter-branch. This won't change the date of the existing\n> commit (which is impossible in Git), but will create another commit\n> where only the date has been changed.\n>\n> --\n> Matthieu Moy\n> http://www-verimag.imag.fr/~moy/\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"126007","messageId":"20091027122156.GD6115@genesis.frugalware.org","threadId":"21348","inReplyTo":"e4a904790910270241g4a165023o30438c5d000b5de4@mail.gmail.com","subject":"Re: date change of commit?","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-10-27T12:21:56Z","receivedAt":"2009-10-27T12:21:56Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Tue, Oct 27, 2009 at 10:41:47AM +0100, Alex K <spaceoutlet@gmail.com> wrote:\n> Thank you. And how would you use git-filter-branch to create another\n> branch with a different time stamp? Is it possible to commit under a\n> different time stamp than the one provided by your default local time?\n\nYou can set GIT_AUTHOR_DATE and GIT_COMMITTER_DATE. Both expect a format\nlike: \"1112911993 -0700\" (unix timestamp + timezone info).\n"},{"id":"126267","messageId":"e4a904790910290555n61bca296g3624c1aced50ed85@mail.gmail.com","threadId":"21348","inReplyTo":"20091027122156.GD6115@genesis.frugalware.org","subject":"Re: date change of commit?","fromName":"Alex K","fromEmail":"spaceoutlet@gmail.com","sentAt":"2009-10-29T12:55:36Z","receivedAt":"2009-10-29T12:55:36Z","isPatch":false,"sender":{"key":"spaceoutlet@gmail.com","avatar":null},"body":"And how do you actually set those variables? Sorry to ask such a\ntrivial question but it's been an hour that i'm going through the doc\nfor such a simple feature. I thought those were environment variables\n... but they are not seen under git var -l. Thank you.\n\n2009/10/27 Miklos Vajna <vmiklos@frugalware.org>:\n> On Tue, Oct 27, 2009 at 10:41:47AM +0100, Alex K <spaceoutlet@gmail.com> wrote:\n>> Thank you. And how would you use git-filter-branch to create another\n>> branch with a different time stamp? Is it possible to commit under a\n>> different time stamp than the one provided by your default local time?\n>\n> You can set GIT_AUTHOR_DATE and GIT_COMMITTER_DATE. Both expect a format\n> like: \"1112911993 -0700\" (unix timestamp + timezone info).\n>\n"},{"id":"126274","messageId":"4AE9AAE7.2080404@dawes.za.net","threadId":"21348","inReplyTo":"e4a904790910290555n61bca296g3624c1aced50ed85@mail.gmail.com","subject":"Re: date change of commit?","fromName":"Rogan Dawes","fromEmail":"rogan@dawes.za.net","sentAt":"2009-10-29T14:47:03Z","receivedAt":"2009-10-29T14:47:03Z","isPatch":false,"sender":{"key":"rogan@dawes.za.net","avatar":null},"body":"Alex K wrote:\n> And how do you actually set those variables? Sorry to ask such a\n> trivial question but it's been an hour that i'm going through the doc\n> for such a simple feature. I thought those were environment variables\n> ... but they are not seen under git var -l. Thank you.\n> \n\nAs you suspected, they are environment variables.\n\ni.e. :\n\n$ GIT_AUTHOR_DATE=\"1112911993 -0700\" git commit x\n\nHope that helps.\n\nRogan\n\n> 2009/10/27 Miklos Vajna <vmiklos@frugalware.org>:\n>> On Tue, Oct 27, 2009 at 10:41:47AM +0100, Alex K <spaceoutlet@gmail.com> wrote:\n>>> Thank you. And how would you use git-filter-branch to create another\n>>> branch with a different time stamp? Is it possible to commit under a\n>>> different time stamp than the one provided by your default local time?\n>> You can set GIT_AUTHOR_DATE and GIT_COMMITTER_DATE. Both expect a format\n>> like: \"1112911993 -0700\" (unix timestamp + timezone info).\n>>\n"},{"id":"126293","messageId":"200910291743.53701.trast@student.ethz.ch","threadId":"21348","inReplyTo":"4AE9AAE7.2080404@dawes.za.net","subject":"Re: date change of commit?","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-10-29T16:43:39Z","receivedAt":"2009-10-29T16:43:39Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Rogan Dawes wrote:\n> Alex K wrote:\n> > And how do you actually set those variables? Sorry to ask such a\n> > trivial question but it's been an hour that i'm going through the doc\n> > for such a simple feature. I thought those were environment variables\n> \n> As you suspected, they are environment variables.\n> \n> i.e. :\n> \n> $ GIT_AUTHOR_DATE=\"1112911993 -0700\" git commit x\n\nSince this was in the context of git-filter-branch, I should point out\nthat you'll have to use the variables with --env-filter and (like the\nmanpage says) make sure you export them.\n\nSo to change the date of a single commit with SHA1 <sha1>, you could\nsay\n\ngit filter-branch --env-filter '\n  if [ $GIT_COMMIT = <sha1> ]; then\n    export GIT_AUTHOR_DATE=\"1112911993 -0700\"\n    export GIT_COMMITTER_DATE=\"1112911993 -0700\"\n  fi\n' <other_arguments>\n\nAlex K wrote:\n> for such a simple feature\n\nI'm not sure if you're referring to setting the variables or actually\nrewriting the commits here, but anyway:\n\nThe reason why the latter is so hard is that rewriting \"old\" history\nis a _huge_ hassle for people who already have the previous version of\nthat history.\n\nThat being said, _why_?  The dates are never a guarantee that\nsomething happened earlier or later precisely because they can easily\nbe modified at commit time.  So nobody should take them as more than a\nhint, and there's little use in faking hints.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"}]}