{"thread":{"id":"36097","subject":"git merge --date --author","startedAt":"2014-03-07T10:30:15Z","lastAt":"2014-03-10T12:52:52Z","messageCount":5,"participants":["Yann Droneaud","Michael Haggerty","Andreas Schwab","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"236257","messageId":"1394188215.3257.17.camel@localhost.localdomain","threadId":"36097","inReplyTo":null,"subject":"git merge --date --author","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2014-03-07T10:30:15Z","receivedAt":"2014-03-07T10:30:15Z","isPatch":false,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Hi,\n\nI was trying to rebuild some history and found myself trying to use some\noptions with git merge which are available in git commit:\n\n git merge \\\n     --date \"2013-12-31 23:59:59 +0000\" \\\n     --author \"Happy New Year <happy.new-year@gregorian.calendar>\" \\\n     current-year\n\nBut unfortunately, unlike git commit, git merge doesn't support either\n--date or --author.\n\nI can work around with environment variables:\n\n GIT_AUTHOR_DATE=\"2013-12-31 23:59:59 +0000\" \\\n GIT_AUTHOR_NAME=\"Happy New Year\" \\\n GIT_AUTHOR_EMAIL=\"happy.new-year@gregorian.calendar\"  \\\n git merge current-year\n\nBut I'd like to know if there's a specific reason for git merge to not\nsupport --date and --author ?\n\nRegards.\n\n-- \nYann Droneaud\nOPTEYA\n"},{"id":"236258","messageId":"5319B04D.6080906@alum.mit.edu","threadId":"36097","inReplyTo":"1394188215.3257.17.camel@localhost.localdomain","subject":"Re: git merge --date --author","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2014-03-07T11:41:01Z","receivedAt":"2014-03-07T11:41:01Z","isPatch":false,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 03/07/2014 11:30 AM, Yann Droneaud wrote:\n> I was trying to rebuild some history and found myself trying to use some\n> options with git merge which are available in git commit:\n> \n>  git merge \\\n>      --date \"2013-12-31 23:59:59 +0000\" \\\n>      --author \"Happy New Year <happy.new-year@gregorian.calendar>\" \\\n>      current-year\n> \n> But unfortunately, unlike git commit, git merge doesn't support either\n> --date or --author.\n> \n> I can work around with environment variables:\n> \n>  GIT_AUTHOR_DATE=\"2013-12-31 23:59:59 +0000\" \\\n>  GIT_AUTHOR_NAME=\"Happy New Year\" \\\n>  GIT_AUTHOR_EMAIL=\"happy.new-year@gregorian.calendar\"  \\\n>  git merge current-year\n\nYou can also use\n\n    git merge --no-commit [...]\n    git commit --date ... --author ...\n\n> But I'd like to know if there's a specific reason for git merge to not\n> support --date and --author ?\n\nNone that I can think of, except that nobody has implemented it.  Don't\nforget that the merge invocation might not lead immediately to a commit\n(if there is a conflict, or if --no-commit is used) so the metadata that\nis passed to its command line would have to be tucked away safely\nsomewhere until the merge commit is finally ready to be created.\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"},{"id":"236261","messageId":"87y50mxj0b.fsf@igel.home","threadId":"36097","inReplyTo":"1394188215.3257.17.camel@localhost.localdomain","subject":"Re: git merge --date --author","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2014-03-07T12:58:44Z","receivedAt":"2014-03-07T12:58:44Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Yann Droneaud <ydroneaud@opteya.com> writes:\n\n> But I'd like to know if there's a specific reason for git merge to not\n> support --date and --author ?\n\nIt's rather unusual that a merge is performed on behalf of a different\nauthor.\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":"236272","messageId":"xmqqvbvpu757.fsf@gitster.dls.corp.google.com","threadId":"36097","inReplyTo":"87y50mxj0b.fsf@igel.home","subject":"Re: git merge --date --author","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-07T19:43:16Z","receivedAt":"2014-03-07T19:43:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> Yann Droneaud <ydroneaud@opteya.com> writes:\n>\n>> But I'd like to know if there's a specific reason for git merge to not\n>> support --date and --author ?\n>\n> It's rather unusual that a merge is performed on behalf of a different\n> author.\n\nYes.  Michael's \"Nobody bothered to implement it\" is also correct\nbut the reason why nobody bothered to most likely is due to \"why\nwould you want to lie?\".\n\nIf the use case is to rebuild history, you would need to be able to\nalso lie about the committer, so\n\n>> git merge \\\n>>     --date \"2013-12-31 23:59:59 +0000\" \\\n>>     --author \"Happy New Year <happy.new-year@gregorian.calendar>\" \\\n>>     current-year\n\nin such a history-rebuild script would not be sufficient.  The\nscript can set necessary environment variables to lie about both\nauthor and commiter, though, of course.\n"},{"id":"236401","messageId":"1394455972.3257.51.camel@localhost.localdomain","threadId":"36097","inReplyTo":"xmqqvbvpu757.fsf@gitster.dls.corp.google.com","subject":"Re: git merge --date --author","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2014-03-10T12:52:52Z","receivedAt":"2014-03-10T12:52:52Z","isPatch":false,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Hi,\n\nLe vendredi 07 mars 2014 à 11:43 -0800, Junio C Hamano a écrit :\n> Andreas Schwab <schwab@linux-m68k.org> writes:\n> \n> > Yann Droneaud <ydroneaud@opteya.com> writes:\n> >\n> >> But I'd like to know if there's a specific reason for git merge to not\n> >> support --date and --author ?\n> >\n> > It's rather unusual that a merge is performed on behalf of a different\n> > author.\n> \n> Yes.  Michael's \"Nobody bothered to implement it\" is also correct\n> but the reason why nobody bothered to most likely is due to \"why\n> would you want to lie?\".\n> \n\nWhen was Git changed in some kind of TSA agent one has to bribe to get\nallowed to cross^Wcommit ? Why git lawyer is not implemented ? I want a\nfair trial !\n\nAnd before adding to Git a perfect lie detector (how will it able to\nmake the difference between truth and lie ? then, will it be able to\nmake the difference between good and bad ?, oh god, no !), I would\nprefer to have it detect bugs before one could commit instead.\n\nYou seems to think I'm lying, but I'm not a liar: I just need to make\nsome arrangements with the history under another identity, as I could be\nlegally bound to. So it may sound like a lie for you, but ultimately,\nit's the plain truth.\n\nSo as the tool is not in position to distinguish lie from truth, I'd\nprefer to not see this concept brought here.\n\n> If the use case is to rebuild history, you would need to be able to\n> also lie about the committer, so\n> \n> >> git merge \\\n> >>     --date \"2013-12-31 23:59:59 +0000\" \\\n> >>     --author \"Happy New Year <happy.new-year@gregorian.calendar>\" \\\n> >>     current-year\n> \n> in such a history-rebuild script would not be sufficient.  The\n> script can set necessary environment variables to lie about both\n> author and commiter, though, of course.\n> \n\nThanks for reminding this: I have to use GIT_COMMITER_DATE,\nGIT_COMMITER_NAME and GIT_COMMITER_EMAIL.\n\nAs I'm not calling for adding --date and --author, I will continue to\nuse the environment variables: they're good enough for the job.\n\nRegards.\n\n-- \nYann Droneaud\nOPTEYA\n"}]}