{"thread":{"id":"6480","subject":"modifying commit's author","startedAt":"2007-01-22T20:37:34Z","lastAt":"2007-01-23T07:38:12Z","messageCount":7,"participants":["J. Bruce Fields","Junio C Hamano","Robin Rosenberg","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32329","messageId":"20070122203734.GB23187@fieldses.org","threadId":"6480","inReplyTo":null,"subject":"modifying commit's author","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2007-01-22T20:37:34Z","receivedAt":"2007-01-22T20:37:34Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"If I got the author wrong on a commit, is there a quick way to fix it\n(e.g. by passing the right arguments or environment variables to commit\n--amend)?\n\n--b.\n"},{"id":"32331","messageId":"7v8xfuss84.fsf@assigned-by-dhcp.cox.net","threadId":"6480","inReplyTo":"20070122203734.GB23187@fieldses.org","subject":"Re: modifying commit's author","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-22T20:48:27Z","receivedAt":"2007-01-22T20:48:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"J. Bruce Fields\" <bfields@fieldses.org> writes:\n\n> If I got the author wrong on a commit, is there a quick way to fix it\n> (e.g. by passing the right arguments or environment variables to commit\n> --amend)?\n\nI usually do \"format-patch -$n; reset --hard HEAD~$n; edit\n00??-*.patch; am 00??-*.patch\" myself when I got into that\nsituation to rebuild the branch, and haven't personally felt\nneed for an option to --amend, but it might make sense to teach\ngit-commit --amend to allow --author option to override it; I\nthink it currently ignores --author when given without erroring\nout.\n\nIt may become a question if we would want to allow updating the\ntimestamp as well, but when people asked for --author I did not\nhear from anybody who wanted to have --authortime, so not being\nable to do so probably is Ok.\n"},{"id":"32332","messageId":"200701222150.16465.robin.rosenberg.lists@dewire.com","threadId":"6480","inReplyTo":"20070122203734.GB23187@fieldses.org","subject":"Re: modifying commit's author","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-01-22T20:50:16Z","receivedAt":"2007-01-22T20:50:16Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"måndag 22 januari 2007 21:37 skrev J. Bruce Fields:\n> If I got the author wrong on a commit, is there a quick way to fix it\n> (e.g. by passing the right arguments or environment variables to commit\n> --amend)?\n\nSet these:\nGIT_AUTHOR_EMAIL\nGIT_AUTHOR_NAME\nGIT_COMMITTER_EMAIL\nGIT_COMMITTER_NAME\n\n-- robin\n"},{"id":"32335","messageId":"20070122210201.GA6614@fieldses.org","threadId":"6480","inReplyTo":"7v8xfuss84.fsf@assigned-by-dhcp.cox.net","subject":"Re: modifying commit's author","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2007-01-22T21:02:01Z","receivedAt":"2007-01-22T21:02:01Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Mon, Jan 22, 2007 at 12:48:27PM -0800, Junio C Hamano wrote:\n> \"J. Bruce Fields\" <bfields@fieldses.org> writes:\n> \n> > If I got the author wrong on a commit, is there a quick way to fix it\n> > (e.g. by passing the right arguments or environment variables to commit\n> > --amend)?\n> \n> I usually do \"format-patch -$n; reset --hard HEAD~$n; edit\n> 00??-*.patch; am 00??-*.patch\" myself when I got into that\n> situation to rebuild the branch, and haven't personally felt\n> need for an option to --amend, but it might make sense to teach\n> git-commit --amend to allow --author option to override it; I\n> think it currently ignores --author when given without erroring\n> out.\n\nThat might be nice, but actually the git-am trick is more convenient\nthan I'd realized; thanks for the tip.\n\n--b.\n"},{"id":"32336","messageId":"7vwt3ercyk.fsf@assigned-by-dhcp.cox.net","threadId":"6480","inReplyTo":"7v8xfuss84.fsf@assigned-by-dhcp.cox.net","subject":"Re: modifying commit's author","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-22T21:03:31Z","receivedAt":"2007-01-22T21:03:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> \"J. Bruce Fields\" <bfields@fieldses.org> writes:\n>\n>> If I got the author wrong on a commit, is there a quick way to fix it\n>> (e.g. by passing the right arguments or environment variables to commit\n>> --amend)?\n>\n> I usually do \"format-patch -$n; reset --hard HEAD~$n; edit\n> 00??-*.patch; am 00??-*.patch\" myself when I got into that\n> situation to rebuild the branch, and haven't personally felt\n> need for an option to --amend, but it might make sense to teach\n> git-commit --amend to allow --author option to override it; I\n> think it currently ignores --author when given without erroring\n> out.\n>\n> It may become a question if we would want to allow updating the\n> timestamp as well, but when people asked for --author I did not\n> hear from anybody who wanted to have --authortime, so not being\n> able to do so probably is Ok.\n\nUntested, but something along this line.\n\n-- >8 --\n[PATCH] honor --author even with --amend, -C, and -c.\n\nEarlier code discarded GIT_AUTHOR_DATE taken from the base\ncommit when --author was specified.  This was often wrong as\nthat use is likely to fix the spelling of author's name.\n\n---\n\ndiff --git a/git-commit.sh b/git-commit.sh\nindex e23918c..6f4dcdb 100755\n--- a/git-commit.sh\n+++ b/git-commit.sh\n@@ -462,15 +462,7 @@ if test -f \"$GIT_DIR/MERGE_HEAD\" && test -z \"$no_edit\"; then\n fi >>\"$GIT_DIR\"/COMMIT_EDITMSG\n \n # Author\n-if test '' != \"$force_author\"\n-then\n-\tGIT_AUTHOR_NAME=`expr \"z$force_author\" : 'z\\(.*[^ ]\\) *<.*'` &&\n-\tGIT_AUTHOR_EMAIL=`expr \"z$force_author\" : '.*\\(<.*\\)'` &&\n-\ttest '' != \"$GIT_AUTHOR_NAME\" &&\n-\ttest '' != \"$GIT_AUTHOR_EMAIL\" ||\n-\tdie \"malformed --author parameter\"\n-\texport GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL\n-elif test '' != \"$use_commit\"\n+if test '' != \"$use_commit\"\n then\n \tpick_author_script='\n \t/^author /{\n@@ -501,6 +493,15 @@ then\n \texport GIT_AUTHOR_EMAIL\n \texport GIT_AUTHOR_DATE\n fi\n+if test '' != \"$force_author\"\n+then\n+\tGIT_AUTHOR_NAME=`expr \"z$force_author\" : 'z\\(.*[^ ]\\) *<.*'` &&\n+\tGIT_AUTHOR_EMAIL=`expr \"z$force_author\" : '.*\\(<.*\\)'` &&\n+\ttest '' != \"$GIT_AUTHOR_NAME\" &&\n+\ttest '' != \"$GIT_AUTHOR_EMAIL\" ||\n+\tdie \"malformed --author parameter\"\n+\texport GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL\n+fi\n \n PARENTS=\"-p HEAD\"\n if test -z \"$initial_commit\"\n"},{"id":"32337","messageId":"20070122210400.GB6614@fieldses.org","threadId":"6480","inReplyTo":"200701222150.16465.robin.rosenberg.lists@dewire.com","subject":"Re: modifying commit's author","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2007-01-22T21:04:00Z","receivedAt":"2007-01-22T21:04:00Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Mon, Jan 22, 2007 at 09:50:16PM +0100, Robin Rosenberg wrote:\n> måndag 22 januari 2007 21:37 skrev J. Bruce Fields:\n> > If I got the author wrong on a commit, is there a quick way to fix it\n> > (e.g. by passing the right arguments or environment variables to commit\n> > --amend)?\n> \n> Set these:\n> GIT_AUTHOR_EMAIL\n> GIT_AUTHOR_NAME\n> GIT_COMMITTER_EMAIL\n> GIT_COMMITTER_NAME\n\nThat doesn't seem to work in this case, since with the commands that\ntake an existing commit as a model (like commit --amend and commit -c),\nthe author information from the existing commit overrides those\nenvironment variables.  Which is normally what you want.\n\n--b.\n"},{"id":"32368","messageId":"45B5BB64.EC3AD29E@eudaptics.com","threadId":"6480","inReplyTo":"20070122203734.GB23187@fieldses.org","subject":"Re: modifying commit's author","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-01-23T07:38:12Z","receivedAt":"2007-01-23T07:38:12Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"\"J. Bruce Fields\" wrote:\n> \n> If I got the author wrong on a commit, is there a quick way to fix it\n> (e.g. by passing the right arguments or environment variables to commit\n> --amend)?\n\nUse cogito: cg commit --amend -e\nYou can edit the author name+email in the commit message.\n\n-- Hannes\n"}]}