Hi Kairui,
On Mon, Dec 27, 2021 at 01:12:08PM +0800, Kairui Song wrote:
Kairui Song ryncsn@gmail.com 于2021年12月27日周一 13:06写道:
Hi Coiby and Tao
[...]
A little suggestion, maybe just follow the Linux kernel commit format will be a better idea, a full sha1 id is a bit too long. Quote from linux kernel document:
""" If your patch fixes a bug in a specific commit, e.g. you found an issue using git bisect, please use the ‘Fixes:’ tag with the first 12 characters of the SHA-1 ID, and the one line summary. For example:
Fixes: e21d2170f366 ("video: remove unnecessary platform_set_drvdata()")
The following git config settings can be used to add a pretty format for outputting the above style in the git log or git show commands:
[core] abbrev = 12 [pretty] fixes = Fixes: %h ("%s") """
Hmm, after a quick git log check, seems we have been using full sha1 id format in the past for quite several times, you can ignore my reply then.
Thanks for the suggestion! After I did my homework about abbrev length, we should use the default 7 for kexec-tools.
According to the git commit dce9648 ("Make the default abbrev length configurable") [1] by Linus,
"The default of 7 comes from fairly early in git development, when seven hex digits was a lot (it covers about 250+ million hash values). Back then I thought that 65k revisions was a lot (it was what we were about to hit in BK), and each revision tends to be about 5-10 new objects or so, so a million objects was a big number."
Currently, the kexec-tools repo has only 1452 commits,
$ git rev-list --count rawhide 1452
and the first commit 0d17a66 ("Setup of module kexec-tools") was done on Aug 29 2005 and the shortest and yet unique SHA1 has only 4 hex digits,
$ git rev-parse --short=3 0d17a66 0d17
So the default 7 is good enough.
Btw, besides the mistake of using the full SHA1, I also put "commit" inside the Fixes tag i.e. I used "Fixes: commit xxx". Maybe I'll add a style code for kexec-tools and add one rule for Fixes tag in the future.
[1] https://github.com/git/git/commit/dce96489162b05ae3463741f7f0365ff56f0de36