Re: commit --amend --author error
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- Jan 15, 2015, 14:21 UTC
- Message-ID
- <54B7CCCD.1070708@drmicha.warpmail.net>
- In-Reply-To
- <20150114120943.GA30383@peff.net>
Jeff King schrieb am 14.01.2015 um 13:09:
Show 25 quoted lines
> On Tue, Jan 13, 2015 at 12:24:18PM +0100, Michael J Gruber wrote: > >> 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>
(git commit --allow-almost-empty in the case of that author, hum)
Show 7 quoted lines
> 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
That is the full explanation, yes:
Neither can "Author name, www.website.com" be parsed as a complete valid "name <email>" nor can it be matched as part of an existing "name <email>" in the repo.
The OP clearly tried to do the first and got an error message about the second. Maybe we can do better here?
Michael