git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: commit --amend --author error

From
Jeff King <peff@peff.net>
Date
Jan 14, 2015, 12:09 UTC
Message-ID
<20150114120943.GA30383@peff.net>
In-Reply-To
<54B50062.3090209@drmicha.warpmail.net>
On Tue, Jan 13, 2015 at 12:24:18PM +0100, Michael J Gruber wrote:
Show 14 quoted lines
> Gunnar Wagner schrieb am 13.01.2015 um 09:15:
> > I got APGL licensed code from someone else and want to post it on my 
> > github (without taking credit for the work)
> > 
> > tried   git commit --amend --author="Author name, www.website.com" but 
> > got an error message which said something like "original author not found"
> > Can it be that the --amen --author only work if the author is on github 
> > himself?
> > 
> 
> This has nothing to do with github.
> 
> The author has be in the form "authorname <authoremail>". The important
> parts for the format are the <>.

Yes, but the error message is a hint that there is something else going on. When there are no angle brackets, some DWIM magic kicks in: git tries to find a matching author by walking the project history from HEAD. So you can do (in git.git):

  $ git commit --allow-empty -m foo --author=gruber
  [detached HEAD 73ef08b] foo
   Author: Michael J Gruber <git@drmicha.warpmail.net>

Of course that does not work if you do not already have commits from the person in your repository:

  $ git commit --allow-empty -m foo --author=foobar
  fatal: No existing author found with 'foobar'
-Peff
Previous: Michael J GruberNext: Michael J Gruber
Message 3 of 21 in “commit --amend --author error”
  1. Gunnar WagnerJan 13, 2015
  2. Michael J GruberJan 13, 2015
  3. Jeff KingJan 14, 2015
  4. Michael J GruberJan 15, 2015
  5. commit: reword --author error messageMichael J Gruber, Jan 15, 2015
  6. Michael J GruberJan 15, 2015
  7. Jeff KingJan 15, 2015
  8. Michael J GruberJan 15, 2015
  9. Junio C HamanoJan 15, 2015
  10. Jeff KingJan 16, 2015
  11. Junio C HamanoJan 16, 2015
  12. Philip OakleyJan 16, 2015
  13. Junio C HamanoJan 16, 2015
  14. Eric SunshineJan 16, 2015
  15. Junio C HamanoJan 16, 2015
  16. [PATCHv2] commit: reword --author error messageMichael J Gruber, Jan 26, 2015
  17. Jeff KingJan 26, 2015
  18. Junio C HamanoJan 27, 2015
  19. Jeff KingJan 27, 2015
  20. Philip OakleyJan 27, 2015
  21. Ramsay JonesJan 27, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.