{"thread":{"id":"39051","subject":"rebase --root conflicts with --committer-date-is-author-date","startedAt":"2015-04-11T18:29:55Z","lastAt":"2015-04-16T22:15:11Z","messageCount":3,"participants":["Elliot Wolk","Junio C Hamano","Chris Webb"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"259242","messageId":"55296823.4010409@gmail.com","threadId":"39051","inReplyTo":null,"subject":"rebase --root conflicts with --committer-date-is-author-date","fromName":"Elliot Wolk","fromEmail":"elliot.wolk@gmail.com","sentAt":"2015-04-11T18:29:55Z","receivedAt":"2015-04-11T18:29:55Z","isPatch":false,"sender":{"key":"elliot.wolk@gmail.com","avatar":null},"body":"============\nversion:\n\ngit version 2.1.4\nLinux wolke-w520 3.19.3-towo.1-siduction-amd64 #1 SMP PREEMPT siduction \n3.19-9 (2015-03-26) x86_64 GNU/Linux\n============\nsummary:\n\nif i do `git rebase --committer-date-is-author-date --root', the \ncommitter date is set to now, instead of set to the author date.\nwhen rebasing onto the first commit, it works perfectly well.\n============\nreproduce:\n\nset -x\ncd\nmkdir test\ncd test\ngit init\necho line >> a; git add a; git commit -m 'jan1' --date '2015-01-01'\necho line >> a; git add a; git commit -m 'jan2' --date '2015-01-02'\necho line >> a; git add a; git commit -m 'jan3' --date '2015-01-03'\ngit log --format=format:%s-%cD-%aD%n\ngit rebase --committer-date-is-author-date HEAD^^\ngit log --format=format:%s-%cD-%aD%n\ngit rebase --committer-date-is-author-date --root\ngit log --format=format:%s-%cD-%aD%n\ngit rebase --committer-date-is-author-date HEAD^^\ngit log --format=format:%s-%cD-%aD%n\ngit rebase --committer-date-is-author-date --root\ngit log --format=format:%s-%cD-%aD%n\n============\nexpected:\n\njan3-Sat, 03 Jan 2015 13:28:06 -0500-Sat, 3 Jan 2015 13:28:06 -0500\njan2-Sat, 02 Jan 2015 13:28:06 -0500-Fri, 2 Jan 2015 13:28:06 -0500\njan1-Sat, 01 Jan 2015 13:28:06 -0500-Thu, 1 Jan 2015 13:28:06 -0500\n============\nactual:\n\njan3-Sat, 11 Apr 2015 14:28:06 -0400-Sat, 3 Jan 2015 13:28:06 -0500\njan2-Sat, 11 Apr 2015 14:28:06 -0400-Fri, 2 Jan 2015 13:28:06 -0500\njan1-Sat, 11 Apr 2015 14:28:06 -0400-Thu, 1 Jan 2015 13:28:06 -0500\n\n{full output: http://pastie.org/10086950}\n============\nsorry if dupe/wrong-venue/poorly-formatted/incomprehensible. i tried.\n"},{"id":"259252","messageId":"xmqqwq1h50na.fsf@gitster.dls.corp.google.com","threadId":"39051","inReplyTo":"55296823.4010409@gmail.com","subject":"Re: rebase --root conflicts with --committer-date-is-author-date","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-04-12T06:19:37Z","receivedAt":"2015-04-12T06:19:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I think that the reason for this behaviour is that \"rebase --root\"\nimplicitly forces \"rebase -i\" to run (instead of the 'format-patch\npiped to am'), and --committer-date-is-author-date is not supported\nby the \"rebase -i\" codepath at all.\n\nI see Thomas did \"rebase --root\" support in v1.6.2 era both in the\nnormal and interactive rebase codepaths, but df5df20c (rebase -i:\nsupport --root without --onto, 2012-06-26) started forcing --root\nrebase to always use the \"rebase -i\" codepath.\n\nTeaching \"rebase -i\" to support --committer-date-is-author-date like\nthe normal rebase codepath is one thing, but I wonder why we force\n\"rebase -i\" on people who merely wanted to do \"--root\".  The way\ndf5df20c (rebase -i: support --root without --onto, 2012-06-26)\nexplains it does not read like a valid justification, at least to\nme.  It says:\n\n    Implicitly use rebase -i for non-interactive rebase of --root\n    without an --onto argument now that rebase -i can correctly do\n    this.\n\nwhich is \"because we can\", not \"because it is a good thing to do for\nsuch and such reasons\".  This is an ancient change in v1.7.12 days.\n\nChris, do you remember if there was a reason why it was a bad idea\nto teach the normal rebase codepath to handle \"--root\"?  I think we\nwould have needed to allow \"am\" to apply a creation patch and start\na new history on an unborn branch in order to do so, but I am not\nsure if there was a valid reason why such a change to \"am\" would\nhave been a bad idea.\n\nThanks.\n\nElliot Wolk <elliot.wolk@gmail.com> writes:\n\n> ============\n> version:\n>\n> git version 2.1.4\n> Linux wolke-w520 3.19.3-towo.1-siduction-amd64 #1 SMP PREEMPT\n> siduction 3.19-9 (2015-03-26) x86_64 GNU/Linux\n> ============\n> summary:\n>\n> if i do `git rebase --committer-date-is-author-date --root', the\n> committer date is set to now, instead of set to the author date.\n> when rebasing onto the first commit, it works perfectly well.\n> ============\n> reproduce:\n>\n> set -x\n> cd\n> mkdir test\n> cd test\n> git init\n> echo line >> a; git add a; git commit -m 'jan1' --date '2015-01-01'\n> echo line >> a; git add a; git commit -m 'jan2' --date '2015-01-02'\n> echo line >> a; git add a; git commit -m 'jan3' --date '2015-01-03'\n> git log --format=format:%s-%cD-%aD%n\n> git rebase --committer-date-is-author-date HEAD^^\n> git log --format=format:%s-%cD-%aD%n\n> git rebase --committer-date-is-author-date --root\n> git log --format=format:%s-%cD-%aD%n\n> git rebase --committer-date-is-author-date HEAD^^\n> git log --format=format:%s-%cD-%aD%n\n> git rebase --committer-date-is-author-date --root\n> git log --format=format:%s-%cD-%aD%n\n> ============\n> expected:\n>\n> jan3-Sat, 03 Jan 2015 13:28:06 -0500-Sat, 3 Jan 2015 13:28:06 -0500\n> jan2-Sat, 02 Jan 2015 13:28:06 -0500-Fri, 2 Jan 2015 13:28:06 -0500\n> jan1-Sat, 01 Jan 2015 13:28:06 -0500-Thu, 1 Jan 2015 13:28:06 -0500\n> ============\n> actual:\n>\n> jan3-Sat, 11 Apr 2015 14:28:06 -0400-Sat, 3 Jan 2015 13:28:06 -0500\n> jan2-Sat, 11 Apr 2015 14:28:06 -0400-Fri, 2 Jan 2015 13:28:06 -0500\n> jan1-Sat, 11 Apr 2015 14:28:06 -0400-Thu, 1 Jan 2015 13:28:06 -0500\n>\n> {full output: http://pastie.org/10086950}\n> ============\n> sorry if dupe/wrong-venue/poorly-formatted/incomprehensible. i tried.\n"},{"id":"259545","messageId":"43BA47EB-FA7B-4D33-8ECA-F8051B16E78E@arachsys.com","threadId":"39051","inReplyTo":"xmqqwq1h50na.fsf@gitster.dls.corp.google.com","subject":"Re: rebase --root conflicts with --committer-date-is-author-date","fromName":"Chris Webb","fromEmail":"chris@arachsys.com","sentAt":"2015-04-16T22:15:11Z","receivedAt":"2015-04-16T22:15:11Z","isPatch":false,"sender":{"key":"chris@arachsys.com","avatar":"https://avatars.githubusercontent.com/u/299056?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n\n> Chris, do you remember if there was a reason why it was a bad idea\n> to teach the normal rebase codepath to handle \"--root\"?  I think we\n> would have needed to allow \"am\" to apply a creation patch and start\n> a new history on an unborn branch in order to do so, but I am not\n> sure if there was a valid reason why such a change to \"am\" would\n> have been a bad idea.\n\nHi. It's a long time ago, but I don't remember any reason and it feels\nsensible that am should be able to create an unborn branch in the same way\ninteractive rebase can.\n\nI suspect I had done the necessary work for rebase -i but not for am, and\nincorrectly assumed that interactive rebase was in any case a superset of\nnon-interactive.\n\nBest wishes,\n\nChris.\n"}]}