{"thread":{"id":"42095","subject":"git rebase -i without altering the committer date","startedAt":"2016-04-20T20:24:45Z","lastAt":"2016-04-21T07:17:02Z","messageCount":6,"participants":["Shaun Jackman","Junio C Hamano","Andreas Schwab","Johannes Sixt","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"283994","messageId":"etPan.5717e605.4004d424.12d1@sjackman03-imac.phage.bcgsc.ca","threadId":"42095","inReplyTo":null,"subject":"git rebase -i without altering the committer date","fromName":"Shaun Jackman","fromEmail":"sjackman@gmail.com","sentAt":"2016-04-20T20:24:45Z","receivedAt":"2016-04-20T20:24:45Z","isPatch":false,"sender":{"key":"sjackman@gmail.com","avatar":null},"body":"I'd like to insert a commit between two commits without changing the committer date or author date of that commit or the subsequent commits. I'd planned on using `git rebase -i` to insert the commit. I believe it retains the author date, but changes the committer date to the current time. I've seen the options `--committer-date-is-author-date` and `--ignore-date`, but I don't believe either of those options does what I want. If no such option currently exists to leave the committer and author date unchanged, is there any chance that this functionality could please be implemented?\n\nFor a relevant SO question, see \nHow to make a git rebase and keep the commit timestamp?\nhttp://stackoverflow.com/questions/30790645/how-to-make-a-git-rebase-and-keep-the-commit-timestamp\n\nThanks, \nShaun\n\n-- \nhttp://sjackman.ca\n"},{"id":"283996","messageId":"xmqqd1pkuidw.fsf@gitster.mtv.corp.google.com","threadId":"42095","inReplyTo":"etPan.5717e605.4004d424.12d1@sjackman03-imac.phage.bcgsc.ca","subject":"Re: git rebase -i without altering the committer date","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-20T20:36:59Z","receivedAt":"2016-04-20T20:36:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shaun Jackman <sjackman@gmail.com> writes:\n\n> I'd like to insert a commit between two commits without changing\n> the committer date or author date of that commit or the subsequent\n> commits. I'd planned on using `git rebase -i` to insert the\n> commit. I believe it retains the author date, but changes the\n> committer date to the current time. I've seen the options\n> `--committer-date-is-author-date` and `--ignore-date`, but I don't\n> believe either of those options does what I want. If no such\n> option currently exists to leave the committer and author date\n> unchanged, is there any chance that this functionality could\n> please be implemented?\n\nYou can mark the commit as \"edit\", use \"git commit --amend\" when\n\"rebase -i\" stops and gives control back to you, and say \"rebase\n--continue\".  That way, you can use your favourite trick to lie\nabout committer date (or identity or other aspects) when running\n\"git commit --amend\" and its effect will be left in the resulting\nhistory, I would think.\n"},{"id":"284004","messageId":"etPan.5717f1cf.1fc1bca8.12d1@sjackman03-imac.phage.bcgsc.ca","threadId":"42095","inReplyTo":"xmqqd1pkuidw.fsf@gitster.mtv.corp.google.com","subject":"Re: git rebase -i without altering the committer date","fromName":"Shaun Jackman","fromEmail":"sjackman@gmail.com","sentAt":"2016-04-20T21:15:03Z","receivedAt":"2016-04-20T21:15:03Z","isPatch":false,"sender":{"key":"sjackman@gmail.com","avatar":null},"body":"On April 20, 2016 at 13:37:01, Junio C Hamano (gitster@pobox.com(mailto:gitster@pobox.com)) wrote:\n> Shaun Jackman writes: \n> \n> > I'd like to insert a commit between two commits without changing \n> > the committer date or author date of that commit or the subsequent \n> > commits. I'd planned on using `git rebase -i` to insert the \n> > commit. I believe it retains the author date, but changes the \n> > committer date to the current time. I've seen the options \n> > `--committer-date-is-author-date` and `--ignore-date`, but I don't \n> > believe either of those options does what I want. If no such \n> > option currently exists to leave the committer and author date \n> > unchanged, is there any chance that this functionality could \n> > please be implemented? \n> \n> You can mark the commit as \"edit\", use \"git commit --amend\" when \n> \"rebase -i\" stops and gives control back to you, and say \"rebase \n> --continue\". That way, you can use your favourite trick to lie \n> about committer date (or identity or other aspects) when running \n> \"git commit --amend\" and its effect will be left in the resulting \n> history, I would think. \n\nThanks for the suggestion, Junio. That would retain the committer date for the commit being inserted. I believe that the subsequent commits would have their committer date modified to the current time by the `git rebase --continue`.\n\nCheers,\nShaun\n"},{"id":"284008","messageId":"87ega0eyvy.fsf@linux-m68k.org","threadId":"42095","inReplyTo":"etPan.5717e605.4004d424.12d1@sjackman03-imac.phage.bcgsc.ca","subject":"Re: git rebase -i without altering the committer date","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2016-04-20T21:47:13Z","receivedAt":"2016-04-20T21:47:13Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Shaun Jackman <sjackman@gmail.com> writes:\n\n> I'd like to insert a commit between two commits without changing the committer date or author date of that commit or the subsequent commits. I'd planned on using `git rebase -i` to insert the commit. I believe it retains the author date, but changes the committer date to the current time. I've seen the options `--committer-date-is-author-date` and `--ignore-date`, but I don't believe either of those options does what I want. If no such option currently exists to leave the committer and author date unchanged, is there any chance that this functionality could please be implemented?\n\nThe easiest way to implement that is to add a graft to redirect the\nparent of the second commit to the inserted commit, then use git\nfilter-branch to make the graft permanent.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"284018","messageId":"571863CE.6090002@kdbg.org","threadId":"42095","inReplyTo":"87ega0eyvy.fsf@linux-m68k.org","subject":"Re: git rebase -i without altering the committer date","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-04-21T05:23:26Z","receivedAt":"2016-04-21T05:23:26Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 20.04.2016 um 23:47 schrieb Andreas Schwab:\n> Shaun Jackman <sjackman@gmail.com> writes:\n>\n>> I'd like to insert a commit between two commits without changing\n>> the committer date or author date of that commit or the subsequent\n>> commits.\n>\n> The easiest way to implement that is to add a graft to redirect the\n> parent of the second commit to the inserted commit, then use git\n> filter-branch to make the graft permanent.\n\nThis only inserts a new project state, but does not propagate the \nchanges brought in by the new commit to the subsequent commits. This \npropagation of changes could also be done with filter-branch, but it may \nbe difficult depending on circumstances.\n\n-- Hannes\n"},{"id":"284020","messageId":"alpine.DEB.2.20.1604210914420.2826@virtualbox","threadId":"42095","inReplyTo":"571863CE.6090002@kdbg.org","subject":"Re: git rebase -i without altering the committer date","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-04-21T07:17:02Z","receivedAt":"2016-04-21T07:17:02Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 21 Apr 2016, Johannes Sixt wrote:\n\n> Am 20.04.2016 um 23:47 schrieb Andreas Schwab:\n> > Shaun Jackman <sjackman@gmail.com> writes:\n> >\n> > > I'd like to insert a commit between two commits without changing\n> > > the committer date or author date of that commit or the subsequent\n> > > commits.\n> >\n> > The easiest way to implement that is to add a graft to redirect the\n> > parent of the second commit to the inserted commit, then use git\n> > filter-branch to make the graft permanent.\n> \n> This only inserts a new project state, but does not propagate the changes\n> brought in by the new commit to the subsequent commits. This propagation of\n> changes could also be done with filter-branch, but it may be difficult\n> depending on circumstances.\n\nI agree that rebase -i is the wrong wrench for this job. Either use\nfilter-branch or fast-export/edit/fast-import.\n\nOr take a step back and ask yourself why you need to fool anybody about\nthe commit date... ;-D\n\nCiao,\nJohannes\n"}]}