Add short author date to Fixes tag
Hi Steven, Greg,
[I'll reply to several sub-threads at once.]
[Message-ID: <[email protected]>]
Quoted 10 lines · Steven Rostedt
Quoted 2 lines · Geert Uytterhoeven
$ git help fixes 'fixes' is aliased to 'show --format='Fixes: %h ("%s")' -s'Hmm, I've just been manually adding the Fixes tags ;-) That's because when I add a fixes tag, I also do a more in depth analysis to make sure the commit being tagged is really the cause of the problem. A lot of my fixes tags are due to very subtle bugs, and a lot of times its a combination of event that happened.
I also precede the generation of the fixes tag with an in-depth analysis. However, that doesn't conflict with using a git alias to generate it, once I've reached a conclusion. I use this alias to generate them, and it's quite handy:
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING.d/git#n46>
Quoted 2 lines
That said, maybe one day I'll use a script or alias in the future.
[Message-ID: <[email protected]>]
Quoted 9 lines · Steven Rostedt
Quoted 2 lines · On Fri, 10 Jan 2025 16:21:35 -0800 Jacob Keller <[email protected]>…
I personally find the date helpful as it can help place a commit without needing to take the extra time to do a lookup.
I've never found dates to be meaningful. I'm always more concerned about when a commit was added to mainline. Thus the version where the commit was added is very important for me.
Indeed. I agree with this, and it's a quite important difference. The commit dates are strictly increasing, which means you can use the date to perform a search of a commit, if there's a collision in the hash (and possibly in the subject).
I documented this in the man-pages project, where I require the commit date to appear in Fixes tags.
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING.d/patches/trailer#n16>
Quoted 8 lines
This is why I keep a bare clone of Linus's
tree and commonly do:$ git describe --contains fd3040b9394c v5.19-rc1~159^2~154^2 $ git describe --contains a76053707dbf v5.15-rc1~157^2~376^2~4
Quoted 4 lines
I can easily see that
a76053707dbfwas added in 5.15 andfd3040b9394cwas added in 5.19. The amount of work needed to add dates to Fixes tags would greatly exceed the amount of added work someone would need to do to do the above operations if they wanted to know the order of commits.
[Message-ID: <2025011032-gargle-showing-7500@gregkh>] Greg wrote (Fri, 10 Jan 2025 13:32:22 +0100):
Quoted 5 lines
Please no, you will break all of our tooling and scripts that parse these types of fields. The git commit id and commit header is all we need to properly determine this type of information, no need to add a date in here at all.
[...]
Quoted 7 lines
So I don't think you need to add a date here. Dates also really do not mean much with commits, what matters is what release a commit is in, not when it was originally made. We have commits that take years to show up in a release, so if you only look at a date, you will be mistaken many times as it's not showing what came before what many times (i.e. we apply commits out-of-date-order all the time.)
As I said above, I agree that the commit date is the right choice. Author dates can be out-of-date-order by years. Commit dates are necessarily in order, though.
[Message-ID: <[email protected]>] Steven wrote (Fri, 10 Jan 2025 08:03:31 -0500):
Quoted 2 lines
How can it lead to misjudgment? If you have two or more hashes matching, do you really think they'll have the same subjects?
The possibility isn't zero. Statistically, it's quite low. However, it's non-zero.
$ git log --format=tformat:'%s' | sort | uniq -c | sort | tail
248 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
263 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
275 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
293 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
314 Merge branch 'akpm' (patches from Andrew)
315 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
318 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
324 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
369 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
670 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
$ git log --format=tformat:'%s' | grep -v ^Merge | sort | uniq -c | sort | tail
grep: (standard input): binary file matches
22 drm/amd/display: Clean up some inconsistent indenting
25 Auto-update from upstream
26 [ARM] Update mach-types
26 pmdomain: Merge branch fixes into next
30 s390: update defconfigs
32 tools arch x86: Sync the msr-index.h copy with the kernel sources
38 [SPARC64]: Update defconfig.
52 mmc: Merge branch fixes into next
59 drm/i915: Convert wait_for(I915_READ(reg)) to intel_wait_for_register()
62 batman-adv: Start new development cycleSubjects repeat every now and then, and the entropy in some subjects is actually quite low.
If you include the commit date in a Fixes tag, then you preclude the entire possibility of a commit reference clash, because you won't have two patches committed in the same date with the same subject and same hash (unless you *really* try)
[Message-ID: <2025011115-energize-edge-c9c7@gregkh>] Greg wrote (Sat, 11 Jan 2025 06:48:53 +0100):
Quoted 3 lines
And if it isn't long enough, tools like:
https://lore.kernel.org/r/[email protected]can help figure it out as well.
That uses hash+subject. This may be not enough in some cases (see how much subjects repeat, in the logs above). And importantly, a fixes tag may become ambiguous *after* it has been written, so you can't predict much.
By having a commit date in the Fixes tag, you could even simplify the script to just do a binary search in case of ambiguity. Let's say I want to find the following commit (arbitrarily taken from the first Fixes tag I've found in my copy of linux.git):
a2e459555c5f (2023-08-09; "shmem: stable directory offsets")
We could find it, with a trivial command line. We only even need two characters of the hash:
$ git log --oneline --after='2023-08-08' --before='2023-08-10' \ | grep ^a2; a2e459555c5f shmem: stable directory offsets
No need for a huge script to disambiguate. This is even typo-resistant, as one could eventually find something that is similar enough, if one had such a field with a typo (in any of the three fields). You'd be able to search by the other two fields, and two fields should be _usually_ enough for disambiguating, and the third one could corroborate the typo.
So, what would you think of having the commit date in commit references such as Fixes tags?
Have a lovely night!
Alex
Signature · 1 line
<https://www.alejandro-colomar.es>
D'oh! I forgot to add the In-Reply-To tag.
I meant to reply to
<https://lore.kernel.org/all/[email protected]/T/#mf183db5f382b4a39cf52a4a1d2ca8f96697c312e>
Quoted 166 lines · Alejandro Colomar
Hi Steven, Greg,
[I'll reply to several sub-threads at once.]
[Message-ID: <[email protected]>]
Quoted 10 lines · Steven Rostedt
Quoted 2 lines · Geert Uytterhoeven
$ git help fixes 'fixes' is aliased to 'show --format='Fixes: %h ("%s")' -s'Hmm, I've just been manually adding the Fixes tags ;-) That's because when I add a fixes tag, I also do a more in depth analysis to make sure the commit being tagged is really the cause of the problem. A lot of my fixes tags are due to very subtle bugs, and a lot of times its a combination of event that happened.
I also precede the generation of the fixes tag with an in-depth analysis. However, that doesn't conflict with using a git alias to generate it, once I've reached a conclusion. I use this alias to generate them, and it's quite handy:
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING.d/git#n46>Quoted 2 lines
That said, maybe one day I'll use a script or alias in the future.
[Message-ID: <[email protected]>]
Quoted 9 lines · Steven Rostedt
Quoted 2 lines · On Fri, 10 Jan 2025 16:21:35 -0800 Jacob Keller <[email protected]>…
I personally find the date helpful as it can help place a commit without needing to take the extra time to do a lookup.
I've never found dates to be meaningful. I'm always more concerned about when a commit was added to mainline. Thus the version where the commit was added is very important for me.
Indeed. I agree with this, and it's a quite important difference. The commit dates are strictly increasing, which means you can use the date to perform a search of a commit, if there's a collision in the hash (and possibly in the subject).
I documented this in the man-pages project, where I require the commit date to appear in Fixes tags.
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING.d/patches/trailer#n16>Quoted 8 lines
This is why I keep a bare clone of Linus's
tree and commonly do:$ git describe --contains fd3040b9394c v5.19-rc1~159^2~154^2 $ git describe --contains a76053707dbf v5.15-rc1~157^2~376^2~4Quoted 4 lines
I can easily see that
a76053707dbfwas added in 5.15 andfd3040b9394cwas added in 5.19. The amount of work needed to add dates to Fixes tags would greatly exceed the amount of added work someone would need to do to do the above operations if they wanted to know the order of commits.[Message-ID: <2025011032-gargle-showing-7500@gregkh>] Greg wrote (Fri, 10 Jan 2025 13:32:22 +0100):
Quoted 5 lines
Please no, you will break all of our tooling and scripts that parse these types of fields. The git commit id and commit header is all we need to properly determine this type of information, no need to add a date in here at all.
[...]
Quoted 7 lines
So I don't think you need to add a date here. Dates also really do not mean much with commits, what matters is what release a commit is in, not when it was originally made. We have commits that take years to show up in a release, so if you only look at a date, you will be mistaken many times as it's not showing what came before what many times (i.e. we apply commits out-of-date-order all the time.)
As I said above, I agree that the commit date is the right choice. Author dates can be out-of-date-order by years. Commit dates are necessarily in order, though.
[Message-ID: <[email protected]>] Steven wrote (Fri, 10 Jan 2025 08:03:31 -0500):
Quoted 2 lines
How can it lead to misjudgment? If you have two or more hashes matching, do you really think they'll have the same subjects?
The possibility isn't zero. Statistically, it's quite low. However, it's non-zero.
$ git log --format=tformat:'%s' | sort | uniq -c | sort | tail 248 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 263 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 275 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 293 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux 314 Merge branch 'akpm' (patches from Andrew) 315 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 318 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi 324 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 369 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm 670 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net $ git log --format=tformat:'%s' | grep -v ^Merge | sort | uniq -c | sort | tail grep: (standard input): binary file matches 22 drm/amd/display: Clean up some inconsistent indenting 25 Auto-update from upstream 26 [ARM] Update mach-types 26 pmdomain: Merge branch fixes into next 30 s390: update defconfigs 32 tools arch x86: Sync the msr-index.h copy with the kernel sources 38 [SPARC64]: Update defconfig. 52 mmc: Merge branch fixes into next 59 drm/i915: Convert wait_for(I915_READ(reg)) to intel_wait_for_register() 62 batman-adv: Start new development cycleSubjects repeat every now and then, and the entropy in some subjects is actually quite low.
If you include the commit date in a Fixes tag, then you preclude the entire possibility of a commit reference clash, because you won't have two patches committed in the same date with the same subject and same hash (unless you *really* try)
[Message-ID: <2025011115-energize-edge-c9c7@gregkh>] Greg wrote (Sat, 11 Jan 2025 06:48:53 +0100):
Quoted 3 lines
And if it isn't long enough, tools like:
https://lore.kernel.org/r/[email protected]can help figure it out as well.
That uses hash+subject. This may be not enough in some cases (see how much subjects repeat, in the logs above). And importantly, a fixes tag may become ambiguous *after* it has been written, so you can't predict much.
By having a commit date in the Fixes tag, you could even simplify the script to just do a binary search in case of ambiguity. Let's say I want to find the following commit (arbitrarily taken from the first Fixes tag I've found in my copy of linux.git):
a2e459555c5f (2023-08-09; "shmem: stable directory offsets")We could find it, with a trivial command line. We only even need two characters of the hash:
$ git log --oneline --after='2023-08-08' --before='2023-08-10' \ | grep ^a2; a2e459555c5f shmem: stable directory offsetsNo need for a huge script to disambiguate. This is even typo-resistant, as one could eventually find something that is similar enough, if one had such a field with a typo (in any of the three fields). You'd be able to search by the other two fields, and two fields should be _usually_ enough for disambiguating, and the third one could corroborate the typo.
So, what would you think of having the commit date in commit references such as Fixes tags?
Have a lovely night!
AlexSignature · 1 line
<https://www.alejandro-colomar.es>
Signature · 1 line
<https://www.alejandro-colomar.es>
Greg Kroah-Hartman
maintainerQuoted 16 lines · Alejandro Colomar
[Message-ID: <2025011032-gargle-showing-7500@gregkh>] Greg wrote (Fri, 10 Jan 2025 13:32:22 +0100):
Quoted 5 lines
Please no, you will break all of our tooling and scripts that parse these types of fields. The git commit id and commit header is all we need to properly determine this type of information, no need to add a date in here at all.
[...]
Quoted 7 lines
So I don't think you need to add a date here. Dates also really do not mean much with commits, what matters is what release a commit is in, not when it was originally made. We have commits that take years to show up in a release, so if you only look at a date, you will be mistaken many times as it's not showing what came before what many times (i.e. we apply commits out-of-date-order all the time.)
Quoted 3 lines
As I said above, I agree that the commit date is the right choice. Author dates can be out-of-date-order by years. Commit dates are necessarily in order, though.
Commit date also doesn't matter. If I commit a fix to one of my branches today, but Linus pulls it in in 2 years from now, what would that date really show to anyone?
Again, all that matters is when a commit is in a release, and for that you walk the tree/graph to determine it. Please don't consider changing the format of our commit identification logic as we have tools that parse and handle what we have today, and all would be changed if we were to change it.
Especially when it doesn't even provide any specific value that I can see, if you want that info, just get it directly from git after looking it up.
thanks,
greg k-h
Hi Greg,
Quoted 17 lines · Greg Kroah-Hartman
Quoted 16 lines · Alejandro Colomar
[Message-ID: <2025011032-gargle-showing-7500@gregkh>] Greg wrote (Fri, 10 Jan 2025 13:32:22 +0100):
Quoted 5 lines
Please no, you will break all of our tooling and scripts that parse these types of fields. The git commit id and commit header is all we need to properly determine this type of information, no need to add a date in here at all.
[...]
Quoted 7 lines
So I don't think you need to add a date here. Dates also really do not mean much with commits, what matters is what release a commit is in, not when it was originally made. We have commits that take years to show up in a release, so if you only look at a date, you will be mistaken many times as it's not showing what came before what many times (i.e. we apply commits out-of-date-order all the time.)
Quoted 7 lines
Quoted 3 lines
As I said above, I agree that the commit date is the right choice. Author dates can be out-of-date-order by years. Commit dates are necessarily in order, though.
Commit date also doesn't matter. If I commit a fix to one of my branches today, but Linus pulls it in in 2 years from now, what would that date really show to anyone?
I think this is a bit confused.
If you commit a fix for a commit that is in Linus's tree, your Fixes tag will refer to the mainline commit, and the Fixes tag will remain valid if the fix is pulled by Linus in the future, because it will continue to refer to the same commit with the same hash and date.
The case where it would matter is if you commit a fix for a commit that is only in your stable branch. However, since the stable branches are not real branches, but actually a set of patches, I expect you would just drop the faulty patch, right?
I expect any Fixes tag refers to commits in Linus's tree, right? Otherwise, they are dangling references, except to those who know where to find the commit. If all Fixes tags refer to commits in Linus's tree, then all Fixes tags are stable.
The commit date is tied to a commit and its hash, and the date will remain valid as much as the hash itself.
Have a lovely night!
Alex
Signature · 1 line
<https://www.alejandro-colomar.es>
Quoted 5 lines · Alejandro Colomar
Quoted 3 lines
Commit date also doesn't matter. If I commit a fix to one of my branches today, but Linus pulls it in in 2 years from now, what would that date really show to anyone?
I think this is a bit confused.
Let me try another explanation: we only change tag formats for what most people agree is a compelling reason (because of the script breakage it causes among other things). Your reasons so far aren't compelling.
Quoted 9 lines
If you commit a fix for a commit that is in Linus's tree, your Fixes tag will refer to the mainline commit, and the Fixes tag will remain valid if the fix is pulled by Linus in the future, because it will continue to refer to the same commit with the same hash and date.
The case where it would matter is if you commit a fix for a commit that is only in your stable branch. However, since the stable branches are not real branches, but actually a set of patches, I expect you would just drop the faulty patch, right?
I think this is a bit confused. The decision to rebase or revert is a balancing act which depends how many people have seen (and possibly rely on) the branch with the original commit in it.
Quoted 4 lines
I expect any Fixes tag refers to commits in Linus's tree, right? Otherwise, they are dangling references, except to those who know where to find the commit. If all Fixes tags refer to commits in Linus's tree, then all Fixes tags are stable.
I believe one of the prerequisites for changing current process should be actually understanding how it works today.
Quoted 2 lines
The commit date is tied to a commit and its hash, and the date will remain valid as much as the hash itself.
The argument isn't about validity, it's about utility. Most of the tasks we do don't care about the date and for the odd occasion we do care we can follow the hash to get it.
Regards,
James
Greg Kroah-Hartman
maintainerQuoted 28 lines · Alejandro Colomar
Hi Greg,
Quoted 17 lines · Greg Kroah-Hartman
Quoted 16 lines · Alejandro Colomar
[Message-ID: <2025011032-gargle-showing-7500@gregkh>] Greg wrote (Fri, 10 Jan 2025 13:32:22 +0100):
Quoted 5 lines
Please no, you will break all of our tooling and scripts that parse these types of fields. The git commit id and commit header is all we need to properly determine this type of information, no need to add a date in here at all.
[...]
Quoted 7 lines
So I don't think you need to add a date here. Dates also really do not mean much with commits, what matters is what release a commit is in, not when it was originally made. We have commits that take years to show up in a release, so if you only look at a date, you will be mistaken many times as it's not showing what came before what many times (i.e. we apply commits out-of-date-order all the time.)
Quoted 7 lines
Quoted 3 lines
As I said above, I agree that the commit date is the right choice. Author dates can be out-of-date-order by years. Commit dates are necessarily in order, though.
Commit date also doesn't matter. If I commit a fix to one of my branches today, but Linus pulls it in in 2 years from now, what would that date really show to anyone?
Quoted 6 lines
I think this is a bit confused.
If you commit a fix for a commit that is in Linus's tree, your Fixes tag will refer to the mainline commit, and the Fixes tag will remain valid if the fix is pulled by Linus in the future, because it will continue to refer to the same commit with the same hash and date.
But we do not need the date! It provides no additional information that we can't just look up if we really need it.
The HASH ("text") format does 2 things, it provides an id we can use to look up more, and the text is there to give humans a hint if they don't want or need to look it up. There is no need to include anything else, let's keep it simple please.
thanks,
greg k-h
Hi Greg,
Quoted 11 lines · Greg Kroah-Hartman
Quoted 10 lines
Quoted 3 lines
Commit date also doesn't matter. If I commit a fix to one of my branches today, but Linus pulls it in in 2 years from now, what would that date really show to anyone?
I think this is a bit confused.
If you commit a fix for a commit that is in Linus's tree, your Fixes tag will refer to the mainline commit, and the Fixes tag will remain valid if the fix is pulled by Linus in the future, because it will continue to refer to the same commit with the same hash and date.
Quoted 6 lines
But we do not need the date! It provides no additional information that we can't just look up if we really need it.
The HASH ("text") format does 2 things, it provides an id we can use to look up more, and the text is there to give humans a hint if they don't want or need to look it up.
The date gives more information to humans to decide if the commit is important to look up. Sometimes, a subject can be ambiguous to the human, even if it's not ambiguous to a machine. The date can help give some context to a human. For example, one could relate a commit to a series that was merged around that date.
The date uses few characters, so it's not too expensive in terms of space. You may even take some space back by dropping a few characters from the hash. Also, by having a fixed-width, it doesn't distract much, as all subjects will still be aligned, so the eyes can jump it easily if not interesting (just like the hash).
I appreciate seeing the date in my Fixes tags elsewhere, as it avoids looking up some commits, which I would look up if I hadn't seen the date.
Secondarily, it helps with the ID, in case it becomes ambiguous. But I started using it for the human part of it.
Quoted 2 lines
There is no need to include anything else,
let's keep it simple please.
Okay; I won't insist.
Have a lovely night!
Alex
Quoted 4 lines
thanks,
greg k-h
Signature · 1 line
<https://www.alejandro-colomar.es>
Theodore Tso
maintainerQuoted 5 lines · Alejandro Colomar
The date gives more information to humans to decide if the commit is important to look up. Sometimes, a subject can be ambiguous to the human, even if it's not ambiguous to a machine. The date can help give some context to a human. For example, one could relate a commit to a series that was merged around that date.
I'm really confused under what circumstances the date would ever be *useful* to me. In general, what I want to know is "is this fix applicable to a branch I care about", which basically means I want to know if a particular branch (a) has the commit id, or (b) has a commit whose description contains a "commit upstream" line referencing the commit.
The date is almost never interesting to me. For upstream commits in Linus's tree, the hint:
Is a bit more interesting to me, but so long as there's a fixes tag with a commit ID, I can just do a "git tag --contains <commit-id>" to get the same information.
- Ted
Quoted 3 lines · Alejandro Colomar
I appreciate seeing the date in my Fixes tags elsewhere, as it avoids looking up some commits, which I would look up if I hadn't seen the date.
If it's something that is helpful for you, just add a git alias?
$ cat ~/git-fixes-date-filter #!/usr/bin/perl # Save as e.g. ~/bin/git-fixes-date-filter
while (<STDIN>) {
if (/^(\s*Fixes:\s+)([0-9a-f]+)\s+\("(.*)"\)/) {
my ($prefix, $sha, $desc) = ($1, $2, $3);
chomp(my $date = `git log -1 --format=%as $sha 2>/dev/null`);
if ($date) {
print "$prefix$sha ($date,\"$desc\")\n";
next;
}
}
print;
}Add to .gitconfig:
[alias] lg = "!git log \"$@\" | ~/git-fixes-date-filter | less -R #"
And then "git lg" will do exactly what you're asking for:
$ git lg -1 origin/master | grep Fixes
Fixes: cc1e127bfa95 (2022-05-09,"random: remove ratelimiting for in-kernel unseeded randomness")Signature · 2 lines
Thanks, Sasha
Greg Kroah-Hartman
maintainerQuoted 17 lines · Alejandro Colomar
Hi Greg,
Quoted 14 lines · Greg Kroah-Hartman
Quoted 10 lines
Quoted 3 lines
Commit date also doesn't matter. If I commit a fix to one of my branches today, but Linus pulls it in in 2 years from now, what would that date really show to anyone?
I think this is a bit confused.
If you commit a fix for a commit that is in Linus's tree, your Fixes tag will refer to the mainline commit, and the Fixes tag will remain valid if the fix is pulled by Linus in the future, because it will continue to refer to the same commit with the same hash and date.
But we do not need the date! It provides no additional information that we can't just look up if we really need it.
Quoted 6 lines
Quoted 3 lines
The HASH ("text") format does 2 things, it provides an id we can use to look up more, and the text is there to give humans a hint if they don't want or need to look it up.
The date gives more information to humans to decide if the commit is important to look up.
No it does not, that is what the subject determines.
Quoted 2 lines
Sometimes, a subject can be ambiguous to the human, even if it's not ambiguous to a machine.
Then work with the developers to not provide such subject lines. Don't rely on a date for anything, that doesn't help.
Quoted 3 lines
The date can help give
some context to a human. For example, one could relate a commit to a series that was merged around that date.
Again, dates of commit time do not reflect the date of the release it shows up in.
Quoted 3 lines
I appreciate seeing the date in my Fixes tags elsewhere, as it avoids looking up some commits, which I would look up if I hadn't seen the date.
That's great, but again, for the kernel we don't need or want this. If you do want this, great, you can add it yourself as Sasha just showed.
Quoted 2 lines
Secondarily, it helps with the ID, in case it becomes ambiguous. But I started using it for the human part of it.
Our ids are not ambiguous. Our "problem" is people putting git ids in the logs that are not valid git ids. Just happened again today as we are "human". Putting the date in there would not help with that very real problem we have today at all.
thanks,
greg k-h
Hi Greg,
On 2026-02-25T15:46:28-0800, Greg Kroah-Hartman wrote:
[...]
Quoted 7 lines
Quoted 2 lines
Secondarily, it helps with the ID, in case it becomes ambiguous. But I started using it for the human part of it.
Our ids are not ambiguous. Our "problem" is people putting git ids in the logs that are not valid git ids. Just happened again today as we are "human". Putting the date in there would not help with that very real problem we have today at all.
It would help locate the commit it refers to. If you have a commit date, you know that if it was rebased, the date can only increase. So, instead of having to search exclusively by subject, you can limit your search to dates no older than the date from the Fixes tag.
Let's say we want to locate
bogus-hash (2025-11-21; "bug: Add BUG_FORMAT_ARGS infrastructure")
We can first of all check if maybe there's a typo in the hash (maybe the first character is missing, due to a cut/paste accident).
$ git log --oneline --before 2025-11-22 --after 2025-11-20 \ | grep BUG_FORMAT_ARGS; 5c47b7f3d1a9 bug: Add BUG_FORMAT_ARGS infrastructure
But even if the date was wrong. Let's say someone used a reference to a commit that got rebased a year later, as the case you stated.
old-hash (2025-01-21; "bug: Add BUG_FORMAT_ARGS infrastructure")
We can search by date something that looks similar. We know the date can't be older than that, if it wasrebased.
$ git log --oneline --after 2025-11-20 | grep infrastructure cb2dc6d2869a can: Kconfig: select CAN driver infrastructure by default 93d7a7ed0734 netfilter: flowtable: move path discovery infrastructure to its own file 23343b6b09ac sched/mmcid: Introduce per task/CPU ownership infrastructure 775465fd26a3 lib/test_hmm: add zone device private THP test infrastructure 99e4e1028337 RDMA/bng_re: Add basic debugfs infrastructure 4f830cd8d7fe RDMA/bng_re: Add infrastructure for enabling Firmware channel 5c47b7f3d1a9 bug: Add BUG_FORMAT_ARGS infrastructure d292dbb5640c bug: Add BUG_FORMAT infrastructure
So, we'd start looking at the tail of that list (assuming the rebase was close to the commit date), and depart from that as necessary. In this case, we find it as the second commit.
On the other hand, if you have no date, you must look at the entire git-log(1), which is a lot more work.
Quoted 3 lines
thanks,
greg k-h
Have a lovely night!
Alex
Signature · 1 line
<https://www.alejandro-colomar.es>
Hi Alejandro,
Quoted 4 lines · Alejandro Colomar
The case where it would matter is if you commit a fix for a commit that is only in your stable branch. However, since the stable branches are not real branches, but actually a set of patches, I expect you would just drop the faulty patch, right?
Stable branches are real branches, cfr.
https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/refs/heads.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Quoted 31 lines · Alejandro Colomar
Steven wrote (Fri, 10 Jan 2025 08:03:31 -0500):
Quoted 2 lines
How can it lead to misjudgment? If you have two or more hashes matching, do you really think they'll have the same subjects?
The possibility isn't zero. Statistically, it's quite low. However, it's non-zero.
$ git log --format=tformat:'%s' | sort | uniq -c | sort | tail 248 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 263 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 275 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 293 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux 314 Merge branch 'akpm' (patches from Andrew) 315 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 318 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi 324 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 369 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm 670 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net $ git log --format=tformat:'%s' | grep -v ^Merge | sort | uniq -c | sort | tail grep: (standard input): binary file matches 22 drm/amd/display: Clean up some inconsistent indenting 25 Auto-update from upstream 26 [ARM] Update mach-types 26 pmdomain: Merge branch fixes into next 30 s390: update defconfigs 32 tools arch x86: Sync the msr-index.h copy with the kernel sources 38 [SPARC64]: Update defconfig. 52 mmc: Merge branch fixes into next 59 drm/i915: Convert wait_for(I915_READ(reg)) to intel_wait_for_register() 62 batman-adv: Start new development cycle
Quoted 7 lines
Subjects repeat every now and then, and the entropy in some subjects is actually quite low.
If you include the commit date in a Fixes tag, then you preclude the entire possibility of a commit reference clash, because you won't have two patches committed in the same date with the same subject and same hash (unless you *really* try)
The probability of a collision where two commits share both the same abbreviated SHA1 and the same subject line is so astronomically low that it's not a realistic concern.
For context, Linus himself pushed back on merely extending the 12-character SHA1 abbreviation to 13. A change that wouldn't even break existing scripts. Yet the proposal here is to introduce an entirely new date parameter that's incompatible with the current format, all to address a scenario that is unlikely in practice.
Signature · 2 lines
Thanks, Sasha
Quoted 2 lines · On Wed, 25 Feb 2026 01:56:02 +0100 Alejandro Colomar <[email protected]> wrote:
That uses hash+subject. This may be not enough in some cases (see how much subjects repeat, in the logs above). And importantly, a fixes tag
Most of those repeats are merges. And people tend to use the same subject when they merge commits. The only time a Fixes is for a merge is if there was a merge conflict and it was done poorly.
Quoted 8 lines
may become ambiguous *after* it has been written, so you can't predict much.
By having a commit date in the Fixes tag, you could even simplify the script to just do a binary search in case of ambiguity. Let's say I want to find the following commit (arbitrarily taken from the first Fixes tag I've found in my copy of linux.git):
Quoted 8 lines
a2e459555c5f (2023-08-09; "shmem: stable directory offsets")We could find it, with a trivial command line. We only even need two characters of the hash:
$ git log --oneline --after='2023-08-08' --before='2023-08-10' \ | grep ^a2; a2e459555c5f shmem: stable directory offsets
Why not just git show a2e459555c5f? You're just worried because of conflicts? That happens so seldom doing a bit more work to find the task is less work than every developer adding a useless date in the tag.
Even if there are conflicts, git show shows you all the commits that conflict:
(random example)
$ git show cbced error: short object ID cbced is ambiguous hint: The candidates are: hint: cbced93894d1 commit 2026-02-02 - drm/amd/display: Set CRTC source for DAC using registers hint: cbced0de1ae7 tree hint: cbced35df940 tree hint: cbced38b00f6 tree hint: cbced53122ce tree hint: cbced7856638 tree hint: cbced88f5140 tree hint: cbceda69074d tree hint: cbcedadcc0f9 tree hint: cbced8ff29d4 blob hint: cbcedd7a684b blob
The above only has one with a subject.
Quoted 10 lines
No need for a huge script to disambiguate. This is even typo-resistant, as one could eventually find something that is similar enough, if one had such a field with a typo (in any of the three fields). You'd be able to search by the other two fields, and two fields should be _usually_ enough for disambiguating, and the third one could corroborate the typo.
So, what would you think of having the commit date in commit references such as Fixes tags?
NAK. I really see no purpose for it, and just adds added noise to the Fixes tag. Seriously, your example above:
a2e459555c5f (2023-08-09; "shmem: stable directory offsets")
Looks horrible compared to:
a2e459555c5f ("shmem: stable directory offsets")
You are the first one to complain about needing a date here. Who else finds this useful in the kernel community? It really feels like it's a solution looking for a problem.
Sorry,
-- Steve
Quoted 68 lines · Steven Rostedt
Quoted 2 lines · On Wed, 25 Feb 2026 01:56:02 +0100 Alejandro Colomar <[email protected]> wrote:
That uses hash+subject. This may be not enough in some cases (see how much subjects repeat, in the logs above). And importantly, a fixes tag
Most of those repeats are merges. And people tend to use the same subject when they merge commits. The only time a Fixes is for a merge is if there was a merge conflict and it was done poorly.
Quoted 8 lines
may become ambiguous *after* it has been written, so you can't predict much.
By having a commit date in the Fixes tag, you could even simplify the script to just do a binary search in case of ambiguity. Let's say I want to find the following commit (arbitrarily taken from the first Fixes tag I've found in my copy of linux.git):
Quoted 8 lines
a2e459555c5f (2023-08-09; "shmem: stable directory offsets")We could find it, with a trivial command line. We only even need two characters of the hash:
$ git log --oneline --after='2023-08-08' --before='2023-08-10' \ | grep ^a2; a2e459555c5f shmem: stable directory offsetsWhy not just git show
a2e459555c5f? You're just worried because of conflicts? That happens so seldom doing a bit more work to find the task is less work than every developer adding a useless date in the tag.Even if there are conflicts, git show shows you all the commits that conflict:
(random example)
$ git show cbced error: short object ID cbced is ambiguous hint: The candidates are: hint: cbced93894d1 commit 2026-02-02 - drm/amd/display: Set CRTC source for DAC using registers hint: cbced0de1ae7 tree hint: cbced35df940 tree hint: cbced38b00f6 tree hint: cbced53122ce tree hint: cbced7856638 tree hint: cbced88f5140 tree hint: cbceda69074d tree hint: cbcedadcc0f9 tree hint: cbced8ff29d4 blob hint: cbcedd7a684b blobThe above only has one with a subject.
Quoted 10 lines
No need for a huge script to disambiguate. This is even typo-resistant, as one could eventually find something that is similar enough, if one had such a field with a typo (in any of the three fields). You'd be able to search by the other two fields, and two fields should be _usually_ enough for disambiguating, and the third one could corroborate the typo.
So, what would you think of having the commit date in commit references such as Fixes tags?
NAK. I really see no purpose for it, and just adds added noise to the Fixes tag. Seriously, your example above:
a2e459555c5f(2023-08-09; "shmem: stable directory offsets")
Quoted 8 lines
Looks horrible compared to:
a2e459555c5f("shmem: stable directory offsets")You are the first one to complain about needing a date here. Who else finds this useful in the kernel community? It really feels like it's a solution looking for a problem.
Strictly speaking, I've asked about inserting the data before because this form:
a2e459555c5f ("shmem: stable directory offsets", 2023-08-09)
is fairly common within the git development community, but I think that community has significantly less tooling around parsing the contents.
The arguments laid out here are pretty compelling that this has no value to the Kernel community. If you are worried about disambiguation, adding more characters to the hash is preferable (at one point 7 or 8 characters was sufficient to provide uniqueness, but now we use 12 characters).
Despite my original comments about liking the format with date, I also concur with everyone here that it doesn't make sense to change the format. I just modified my global alias and set one different for the git projects vs the Linux kernel project. That way my aliases (git-whatis and git-fixes) will generate the appropriate format for the given project.
Thanks,
Jake
Quoted 4 lines
Sorry,
-- Steve