]> git.ipfire.org Git - thirdparty/git.git/commit
cat-file: add mailmap support to -s option
authorSiddharth Asthana <siddharthasthana31@gmail.com>
Tue, 20 Dec 2022 06:01:12 +0000 (11:31 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Dec 2022 06:20:45 +0000 (15:20 +0900)
commit49050a043bf767d370e7288cb6cca0ca21f13404
treed61bbc259d2655f6b22176c35bba41099c13f3b8
parent63bba4fdd86d80ef061c449daa97a981a9be0792
cat-file: add mailmap support to -s option

Even though the cat-file command with `-s` option does not complain when
`--use-mailmap` option is given, the latter option is ignored. Compute
the size of the object after replacing the idents and report it instead.

In order to make `-s` option honour the mailmap mechanism we have to
read the contents of the commit/tag object. Make use of the call to
`oid_object_info_extended()` to get the contents of the object and store
in `buf`. `buf` is later freed in the function.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: John Cai <johncai86@gmail.com>
Helped-by: Taylor Blau <me@ttaylorr.com>
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Siddharth Asthana <siddharthasthana31@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-cat-file.txt
builtin/cat-file.c
t/t4203-mailmap.sh