Once it is enforced we'd probably disallow touching ChangeLog files in a
commit with other changed files and during the 
maintainer-scripts/update_version_git
script ought to check in in addition to the DATESTAMP updates in the same
commit also updates to all the ChangeLog files since the last DATESTAMP
commit.  That way, if there is some ChangeLog entry screw-up that gets
through the script, one could still wait until DATESTAMP update and
afterwards in a separate commit adjust the ChangeLog files.

        Jakub


Hello.

I've made a refactoring of the script I tend to divide it into 3 components:
- abstract GitCommit class that can check commit message and format and
  can generate final ChangeLog entries
- integration part into the git hooks ([1]): it should get git message and 
changed
  files and process _only_ format validation step; note that our hooks use 
Python2
  and so we should get message and modified files via a subprocess execution:
  $ git log -n1 ac6eaa55a5199196ea0a25763114ce05333a14d3  --format=%b
    When I implemented C++20 parenthesized initialization of aggregates
    I introduced this bogus cp_unevaluated_operand check, thus disabling
    ...
  $ git diff 
ac6eaa55a5199196ea0a25763114ce05333a14d3~..ac6eaa55a5199196ea0a25763114ce05333a14d3
 --name-status
  M       gcc/cp/ChangeLog
  M       gcc/cp/call.c
  M       gcc/testsuite/ChangeLog
  A       gcc/testsuite/g++.dg/cpp2a/paren-init21.C

- a DATESTAMP update script - it can be a Python3 script that can utilize a 
nice git abstraction
  library: [2]; the script was added and can be tested with:
$ ./git_repo.py ~/Programming/gcc 6607bdd99994c834f92fce924abdaea3405f62dc
------ gcc/ChangeLog ------
2020-05-02  H.J. Lu  <hjl.to...@gmail.com>

        PR target/93492
        * cfgexpand.c (pass_expand::execute): Set crtl->patch_area_size
        and crtl->patch_area_entry.
        * emit-rtl.h (rtl_data): Add patch_area_size and patch_area_entry.
        * opts.c (common_handle_option): Limit
        function_entry_patch_area_size and function_entry_patch_area_start
        to USHRT_MAX.  Fix a typo in error message.
        * varasm.c (assemble_start_function): Use crtl->patch_area_size
        and crtl->patch_area_entry.
        * doc/invoke.texi: Document the maximum value for
        -fpatchable-function-entry.
------ gcc/c-family/ChangeLog ------
2020-05-02  H.J. Lu  <hjl.to...@gmail.com>

        PR target/93492
        * c-attribs.c (handle_patchable_function_entry_attribute): Limit
        value to USHRT_MAX (65535).
------ gcc/testsuite/ChangeLog ------
2020-05-02  H.J. Lu  <hjl.to...@gmail.com>

        PR target/93492
        * c-c++-common/patchable_function_entry-error-1.c: New test.
        * c-c++-common/patchable_function_entry-error-2.c: Likewise.
        * c-c++-common/patchable_function_entry-error-3.c: Likewise.

What's missing right now is how will we declare a Backport format.
Can we just use something like: 'Backport from 
6607bdd99994c834f92fce924abdaea3405f62dc'?
It can rapidly simplify parsing of git messages and the git_repo.py can generate
corresponding ChangeLog entries.

Martin

[1] https://github.com/AdaCore/git-hooks
[2] https://gitpython.readthedocs.io/en/stable/tutorial.html

Reply via email to