ZheNing Hu [off-list ref] writes:
If `--own-identity` is mouthful, is there a better name?
I originally had "perhaps XXXX?" in the message you are responding
to, but I hoped that the message, especially the examples at the
end, would be sufficient to make you realize that the option itself
is not such a great idea (an additional ":@gitster" in whatever
syntax used would be even shorter than "--own-identity", and
obviously more flexible in that it can name other people).
If you really want to have this option, perhaps call it "--self"? I
still do not think it is a good idea, though.
Junio C Hamano [off-list ref] 于2021年3月19日周五 下午11:36写道:
ZheNing Hu [off-list ref] writes:
quoted
If `--own-identity` is mouthful, is there a better name?
I originally had "perhaps XXXX?" in the message you are responding
to, but I hoped that the message, especially the examples at the
end, would be sufficient to make you realize that the option itself
is not such a great idea (an additional ":@gitster" in whatever
syntax used would be even shorter than "--own-identity", and
obviously more flexible in that it can name other people).
If you really want to have this option, perhaps call it "--self"? I
still do not think it is a good idea, though.
Fine, If this option is really not particularly useful, I am willing
to give it up.
I am looking for how to extract each author or committer from the log.
I just know I can use:
$ git log --pretty="%an %ae" | sort | uniq
get all unique author <email> from a git repo.
Is there any function in the source code of git to get them?
I notice Ævar Arnfjörð Bjarmason mentioned `.mailmap`, I have seen the
`.mailmap` under git repo. Would it be better to extract the author
or committer
from the .mailmap than to extract it from git log?
If so, the operation of the trailer may depend on the contents of `.mailmap`.
If there is no `.mailmap` in the user git repo, then the identity in the trailer
cannot be parsed.
Thanks.
On Sat, Mar 20, 2021 at 10:54:38AM +0800, ZheNing Hu wrote:
I am looking for how to extract each author or committer from the log.
I just know I can use:
$ git log --pretty="%an %ae" | sort | uniq
get all unique author <email> from a git repo.
Is there any function in the source code of git to get them?
If I understand Junio's suggestion correctly, it is very similar to how
"commit --author" works. See how it calls find_author_by_nickname(),
which finds the first commit matching the name, and then pulls out the
full name from format_commit_message().
-Peff