commit --amend --author error
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?
Gunnar Wagner schrieb am 13.01.2015 um 09:15:
Quoted 8 lines
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 <>.
Michael
Quoted 10 lines · Michael J Gruber
Gunnar Wagner schrieb am 13.01.2015 um 09:15:
Quoted 8 lines
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?
Quoted 4 lines
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 <[email protected]>
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
Jeff King schrieb am 14.01.2015 um 13:09:
Quoted 17 lines · Michael J Gruber
Quoted 11 lines
Gunnar Wagner schrieb am 13.01.2015 um 09:15:
Quoted 8 lines
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?Quoted 4 lines
This has nothing to do with github.
The author has be in the form "authorname <authoremail>". The important parts for the format are the <>.
Quoted 8 lines
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 <[email protected]>
(git commit --allow-almost-empty in the case of that author, hum)
Quoted 7 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
PATCH 1/1 commit: reword --author error message
If an --author argument is specified but does not contain a '>' then git tries to find the argument within the exiting authors; and gives the error message "No existing author found with '%s'" if there is no match.
This is confusing for users who try to specify a valid complete author name.
Rename the error message to make it clearer that the failure has two reasons in this case:
"Bad --author parameter '%s': neither completely wellformed nor part of an existing one"
(This codepath is touched only when we know already that the argument cannot be a completely wellformed author ident.)
--- builtin/commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/commit.c +1 -1
@@ -1056,7 +1056,7 @@ static const char *find_author_by_nickname(const char *name)clear_mailmap (&mailmap);return strbuf_detach (&buf,NULL ); } -die (_ ("No existing author found with '%s'" ), name); +die (_ ("Bad --author parameter '%s': neither completely wellformed nor part of an existing one" ), name); }
Signature · 1 line
2.3.0.rc0.202.g6f441c7
Re: [PATCH] commit: reword --author error message
Quoted 11 lines · Michael J Gruber
If an --author argument is specified but does not contain a '>' then git tries to find the argument within the exiting authors; and gives the error message "No existing author found with '%s'" if there is no match.
This is confusing for users who try to specify a valid complete author name.
Rename the error message to make it clearer that the failure has two reasons in this case:
"Bad --author parameter '%s': neither completely wellformed nor part of an existing one"
I really like the intent of this patch, but I actually find the new message even more confusing.
Is this a time when we could use hint() to give a multi-line explanation (and probably a matching advice.* config)? Like:
hint: If the --author parameter contains angle brackets ("<>"), it
hint: is treated as a literal name/email pair to use. If not, then
hint: the history is searched for an existing matching author.
or something?
-Peff
Re: [PATCH] commit: reword --author error message
Jeff King schrieb am 15.01.2015 um 15:31:
Quoted 9 lines · Michael J Gruber
Quoted 8 lines
If an --author argument is specified but does not contain a '>' then git tries to find the argument within the exiting authors; and gives the error message "No existing author found with '%s'" if there is no match.
This is confusing for users who try to specify a valid complete author name.
Quoted 7 lines
Quoted 4 lines
Rename the error message to make it clearer that the failure has two reasons in this case:
"Bad --author parameter '%s': neither completely wellformed nor part of an existing one"I really like the intent of this patch, but I actually find the new message even more confusing.
The main observation is that the current error message is given only when both interpretations (complete ident, match ident) fail, and the error message conveys only one when it should do both. I don't care about the wording either.
Quoted 11 lines
Is this a time when we could use
hint()to give a multi-line explanation (and probably a matching advice.* config)? Like:hint: If the --author parameter contains angle brackets ("<>"), it
hint: is treated as a literal name/email pair to use. If not, then
hint: the history is searched for an existing matching author.or something?
-Peff
Well, this basically copies the man page paragraph for that option. I don't want to set a(nother) precedent for doing this and create yet another config knob.
The alternative would be to just say "Bad --author parameter '%s'" (or "Invalid..."), as we do in most cases, and force the user to check the man page for the definition of "valid". I'm beginning to prefer this minimalistic approach...
Michael
Re: [PATCH] commit: reword --author error message
In reply to Michael J GruberMichael J Gruber schrieb am 15.01.2015 um 15:23:
Quoted 3 lines
If an --author argument is specified but does not contain a '>' then git tries to find the argument within the exiting authors; and gives the error message "No existing author found with '%s'" if there is no match.
Oh well, I'm bracing already for the comments on that entertaining typo... Can I buy an 's', please?
Quoted 30 lines
This is confusing for users who try to specify a valid complete author name.
Rename the error message to make it clearer that the failure has two reasons in this case:
"Bad --author parameter '%s': neither completely wellformed nor part of an existing one"(This codepath is touched only when we know already that the argument cannot be a completely wellformed author ident.)
Signed-off-by Michael J Gruber <[email protected]>--- builtin/commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)builtin/commit.c +1
-1@@ -1056,7 +1056,7 @@ static const char *find_author_by_nickname(const char *name)clear_mailmap (&mailmap);return strbuf_detach (&buf,NULL ); } -die (_ ("No existing author found with '%s'" ), name); +die (_ ("Bad --author parameter '%s': neither completely wellformed nor part of an existing one" ), name); }
Re: [PATCH] commit: reword --author error message
In reply to Michael J GruberQuoted 6 lines · Michael J Gruber
If an --author argument is specified but does not contain a '>' then git tries to find the argument within the exiting authors; and gives the error message "No existing author found with '%s'" if there is no match.
This is confusing for users who try to specify a valid complete author name.
I suspect that you meant s/a valid/an invalid/, as if it is valid, it cannot not contain '>' (after all, '>' is merely a rough approximation to check if it is "Name <email>" format).
Quoted 4 lines
Rename the error message to make it clearer that the failure has two reasons in this case:
"Bad --author parameter '%s': neither completely wellformed nor part of an existing one"
You are trying to help a user who thought "Who www.where.com" was a valid thing to pass to --author; "it is not completely wellformed" is not very helpful without making her realize what in that bogus string is not "completely well-formed".
Perhaps
"--author '%s' is not 'Name <email>' and no existing author matches that string"
or somesuch?
Re: [PATCH] commit: reword --author error message
Quoted 10 lines · Junio C Hamano
Quoted 4 lines
Rename the error message to make it clearer that the failure has two reasons in this case:
"Bad --author parameter '%s': neither completely wellformed nor part of an existing one"You are trying to help a user who thought "Who www.where.com" was a valid thing to pass to --author; "it is not completely wellformed" is not very helpful without making her realize what in that bogus string is not "completely well-formed".
Quoted 5 lines
Perhaps
"--author '%s' is not 'Name <email>' and no existing author matches that string"
or somesuch?
Yeah, I think that is OK. It is kind of clunky to read, but it contains all of the necessary information to lead the user in the right direction.
-Peff
Re: [PATCH] commit: reword --author error message
Quoted 14 lines · Jeff King
Quoted 12 lines · Junio C Hamano
Quoted 4 lines
Rename the error message to make it clearer that the failure has two reasons in this case:
"Bad --author parameter '%s': neither completely wellformed nor part of an existing one"You are trying to help a user who thought "Who www.where.com" was a valid thing to pass to --author; "it is not completely wellformed" is not very helpful without making her realize what in that bogus string is not "completely well-formed".
Perhaps
Quoted 7 lines
Quoted 3 lines
"--author '%s' is not 'Name <email>' and no existing author matches that string"
or somesuch?
Yeah, I think that is OK. It is kind of clunky to read, but it contains all of the necessary information to lead the user in the right direction.
Indeed it is clunky and not in the usual format.
This might be better, perhaps?
die(_("--author '%s': not 'Name <email>' and matches no existing author"));Re: [PATCH] commit: reword --author error message
From: "Junio C Hamano" <[email protected]>
Quoted 25 lines
Quoted 14 lines · Jeff King
Quoted 12 lines · Junio C Hamano
Quoted 4 lines
Rename the error message to make it clearer that the failure has two reasons in this case:
"Bad --author parameter '%s': neither completely wellformed nor part of an existing one"You are trying to help a user who thought "Who www.where.com" was a valid thing to pass to --author; "it is not completely wellformed" is not very helpful without making her realize what in that bogus string is not "completely well-formed".
Perhaps
Quoted 8 lines
Quoted 4 lines
"--author '%s' is not 'Name <email>' and no existing author
matches that string"or somesuch?
Yeah, I think that is OK. It is kind of clunky to read, but it contains all of the necessary information to lead the user in the right direction.
Quoted 6 lines
Indeed it is clunky and not in the usual format.
This might be better, perhaps?
die(_("--author '%s': not 'Name <email>' and matches no existing
author"));
/Bikeshed
die(_("--author '%s': not 'Name <email>', nor matches any existing
author"));
The 'not/and' construct didn't feel right here in the UK, but then many don't understand 'nor' either. --
Philip
Re: [PATCH] commit: reword --author error message
Quoted 2 lines · Philip Oakley
die(_("--author '%s': not 'Name <email>', nor matches any existing
author"));
Sounds good. Thanks.
Re: [PATCH] commit: reword --author error message
Quoted 6 lines · Junio C Hamano
Quoted 2 lines · Philip Oakley
die(_("--author '%s': not 'Name <email>', nor matches any existing
author"));Sounds good. Thanks.
To further bikeshed (particularly if "nor" is in the mix):
neither 'Name <email>' nor a match for an existing author
Re: [PATCH] commit: reword --author error message
Quoted 11 lines · Eric Sunshine
Quoted 6 lines · Junio C Hamano
Quoted 2 lines · Philip Oakley
die(_("--author '%s': not 'Name <email>', nor matches any existing
author"));Sounds good. Thanks.
To further bikeshed (particularly if "nor" is in the mix):
neither 'Name <email>' nor a match for an existing author
Short and sweet ;-)
PATCH v2 1/1 commit: reword --author error message
If an --author argument is specified but does not contain a '>' then git tries to find the argument within the existing authors; and gives the error message "No existing author found with '%s'" if there is no match.
This is confusing for users who try to specify a valid complete author name.
Rename the error message to make it clearer that the failure has two reasons in this case.
(This codepath is touched only when we know already that the argument cannot be a completely wellformed author ident.)
---
There's really not much by me in this patch any more... Everyone on cc contributed - bikeshedding in its best, productive form!
BTW: How do you pull cc/msgid from the list into format-patch/send-email most effectively? (granted that I move away from gmane/nntp, which is likely)
builtin/commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/commit.c +1 -1
@@ -1056,7 +1056,7 @@ static const char *find_author_by_nickname(const char *name)clear_mailmap (&mailmap);return strbuf_detach (&buf,NULL ); } -die (_ ("No existing author found with '%s'" ), name); +die (_ ("--author '%s': neither 'Name <email>' nor a match for an existing author" ), name); }
Signature · 1 line
2.3.0.rc1.222.gae238f2
Re: [PATCHv2] commit: reword --author error message
builtin/commit.c static const char *find_author_by_nickname(const char *name) · line 1059
Quoted 2 lines · Michael J Gruber
builtin/commit.c +1
-1-die (_ ("No existing author found with '%s'" ), name); +die (_ ("--author '%s': neither 'Name <email>' nor a match for an existing author" ), name);
I had to add to the bikeshed, but I had to read this several times to make sense of it. It is grammatically:
X [is] neither Y nor Z
except that by eliding the verb ("is"), I somehow had trouble making sense of Z ("a match...") as a noun.
I came up with:
--author '%s': neither 'Name <email>' nor matches an existing author
only to see that it was suggested earlier in the thread as a predecessor to this. ;)
I wonder if adding back in the missing verb, rather than a colon, would also make more sense:
--author '%s' is neither 'Name <email>' nor a match for an existing author
Quoted 2 lines
BTW: How do you pull cc/msgid from the list into format-patch/send-email most effectively? (granted that I move away from gmane/nntp, which is likely)
Here's what I do:
http://article.gmane.org/gmane.comp.version-control.git/262367
-Peff
Re: [PATCHv2] commit: reword --author error message
Quoted 17 lines · Jeff King
builtin/commit.c static const char *find_author_by_nickname(const char *name) · line 1059
Quoted 2 lines · Michael J Gruber
builtin/commit.c +1
-1-die (_ ("No existing author found with '%s'" ), name); +die (_ ("--author '%s': neither 'Name <email>' nor a match for an existing author" ), name);I had to add to the bikeshed, but I had to read this several times to make sense of it. It is grammatically:
X [is] neither Y nor Z
except that by eliding the verb ("is"), I somehow had trouble making sense of Z ("a match...") as a noun.
I came up with:
--author '%s': neither 'Name <email>' nor matches an existing author
Quoted 8 lines
only to see that it was suggested earlier in the thread as a predecessor to this. ;)
I wonder if adding back in the missing verb, rather than a colon, would also make more sense:
--author '%s' is neither 'Name <email>' nor a match for an existing author
I usually don't like to add anything to the bikeshed, but ...
This sounds odd to me, so maybe:
--author '%s' is neither in the form of 'Name <email>' nor a match for an existing author
although that is getting a bit long! :-D
ATB,
Ramsay Jones
Re: [PATCHv2] commit: reword --author error message
In reply to Jeff KingQuoted 7 lines · Jeff King
... I somehow had trouble making
sense of Z ("a match...") as a noun.I wonder if adding back in the missing verb, rather than a colon, would also make more sense:
--author '%s' is neither 'Name <email>' nor a match for an existing author
Then
Quoted 1 line
--author '%s' is not 'Name <email>' and matches no existing author
would be the shortest, sweetest and hopefully grammatical, perhaps?
Re: [PATCHv2] commit: reword --author error message
Quoted 8 lines · Junio C Hamano
Quoted 6 lines · Jeff King
... I somehow had trouble making
sense of Z ("a match...") as a noun.I wonder if adding back in the missing verb, rather than a colon, would also make more sense:
Quoted 7 lines
Quoted 1 line
--author '%s' is neither 'Name <email>' nor a match for an existing author
Then
Quoted 1 line
--author '%s' is not 'Name <email>' and matches no existing author
would be the shortest, sweetest and hopefully grammatical, perhaps?
Yes, that one make perfect sense to me.
-Peff
Re: [PATCHv2] commit: reword --author error message
From: "Jeff King" <[email protected]>
Quoted 13 lines · Junio C Hamano
Quoted 12 lines
Quoted 8 lines · Jeff King
... I somehow had trouble making
sense of Z ("a match...") as a noun.I wonder if adding back in the missing verb, rather than a colon, would also make more sense:
--author '%s' is neither 'Name <email>' nor a match for an
existing author
Quoted 9 lines
Quoted 6 lines
Then
Quoted 2 lines
--author '%s' is not 'Name <email>' and matches no existing
authorwould be the shortest, sweetest and hopefully grammatical, perhaps?
Yes, that one make perfect sense to me.
Agreed.
Philip