Hi Yuao,
Yuao Ma wrote:
Thanks for the tip! I ran the git_check_commit.py script, and it
reported "OK."
However, when I regenerated the ChangeLog, the function name wasn't
included
automatically.
Usually 'git diff' shows the function name in the '@@' line, but that does
not always work – either it shows no function name (as in this case)
or the wrong one.
Showing the wrong happens relatively often when, e.g., adding a member
to a 'struct' or when updating the function description comment as that
comes before the associated function. And not showing the name happens
most often for labels (see below).
For instance, picking the most recent commit with code changes,
a diff usually has something like the following - and then mklog.py works:
--- a/gcc/tree-switch-conversion.cc
+++ b/gcc/tree-switch-conversion.cc
@@ -1793,12 +1793,14 @@ bit_test_cluster::find_bit_tests (vec<cluster *>
&clusters, int max_c)
→ 'bit_test_cluster::find_bit_tests' is the function name.
However, in your case, the label ('exponent:') caused that 'git diff'
showed it instead of the function name from a few lines up. Namely,
your patch diff has:
--- a/libgfortran/io/read.c
+++ b/libgfortran/io/read.c
@@ -1375,7 +1375,7 @@ exponent:
* * *
I've manually added the function name to the ChangeLog for now
Thanks.
* * *
One very minor nit:
The email subject reads
"[PATCH, fortran] Fix simple typo in libgfortran"
while the patch subject is
"[PATCH] fortran: fix simple typo in libgfortran"
It's usually nicer if they are the same to make finding old patch
reviews easier - usage case: someone wonders 5 years on why a
certain change was done in a particular way and looks at the old
email thread.
In your case, those are similar enough that it doesn't matter - and
sometimes it is unavoidable that they diverge (e.g. when fixing the
bug number before the commit - while the email thread shows still
the wrong bug), but, if possible/sensible, they should be the same.
* * *
I have now applied it on your behalf as
r16-515-g5d9e66493afaa9 alias 5d9e66493afaa9
[The first version one denotes the 515th commit to GCC 16 (= mainline
alias trunk); that way, it is easier to see in which GCC version a
commit was done - and (relatively to other commits) when.]
Short links - which is a readable way to link to commits
(I hope Outlook.com doesn't mangle them in an unreadable way):
https://gcc.gnu.org/r16-515-g5d9e66493afaa9
orhttps://gcc.gnu.org/g:5d9e66493afaa9
If you ever want to link to bug reports (PR, problem report),
something likehttps://gcc.gnu.org/PR1234 can be used.
Tobias
PS: The ./contrib/git-descr.sh script creates the rXX-YYY number; or
'git gcc-descr' if you added the alias (e.g. via
contrib/gcc-git-customization.sh).