aboutsummaryrefslogtreecommitdiff
path: root/contrib/mklog.py
AgeCommit message (Collapse)AuthorFilesLines
2024-03-01contrib: mklog: Use present tense in ChangeLogBernhard Reutner-Fischer1-1/+1
contrib/ChangeLog: * mklog.py: Use present tense in ChangeLog.
2024-01-03Update copyright years.Jakub Jelinek1-1/+1
2023-10-03contrib/mklog.py: Fix issues reported by flake8Martin Jambor1-1/+2
The testing infrastructure built by Martin Liška contains checking a few python scripts in contrib witha tool flake8. That tool recently complains that: contrib/mklog.py:360:45: E711 comparison to None should be 'if cond is None:' contrib/mklog.py:362:1: E305 expected 2 blank lines after class or function definition, found 1 I'd like to silence these with the following, hopefully trivial, changes. However, I have only tested the changes by running flake8 again and running ./contrib/mklog.py --help. Is this good for trunk? (Or should I stop using flake8 instead?) Thanks, Martin contrib/ChangeLog: 2023-10-03 Martin Jambor <mjambor@suse.cz> * mklog.py (skip_line_in_changelog): Compare to None using is instead of ==, add an extra newline after the function.
2023-09-04mklog: handle Signed-off-by, minor cleanupMarc Poulhiès1-5/+29
Consider Signed-off-by lines as part of the ending of the initial commit to avoid having these in the middle of the log when the changelog part is injected after. This is particularly usefull with: $ git gcc-commit-mklog --amend -s that can be used to create the changelog and add the Signed-off-by line. Also applies most of the shellcheck suggestions on the prepare-commit-msg hook. contrib/ChangeLog: * mklog.py: Leave SOB lines after changelog. * prepare-commit-msg: Apply most shellcheck suggestions. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-08-29mklog: fix bugs of --append optionLehua Ding1-3/+5
This little patch fix two bugs of mklog.py with --append option. The first bug is that the regexp used is not accurate enough to determine the top of diff area. The second bug is that if `---` is not a true start, it needs to be added back to the patch file. And with additional fix Python code format error, which Martin reported. contrib/ChangeLog: * mklog.py: Fix bugs.
2023-07-13mklog: Add --append option to auto add generate ChangeLog to patch fileLehua Ding1-1/+26
This tiny patch add --append option to mklog.py that support add generated change-log to the corresponding patch file. With this option there is no need to manually copy the generated change-log to the patch file. e.g.: Run `mklog.py --append /path/to/this/patch` will add the generated change-log to the right place of the /path/to/this/patch file. contrib/ChangeLog: * mklog.py: Add --append option. Signed-off-by: Lehua Ding <lehua.ding@rivai.ai>
2023-01-16Update copyright years.Jakub Jelinek1-1/+1
2022-12-14mklog: do not depend on recent unidiff versionMartin Liska1-2/+3
contrib/ChangeLog: * mklog.py: Check for number of hunks and not if a modified file is binary.
2022-12-12mklog: do not parse binary file for PR entryMartin Liska1-16/+18
contrib/ChangeLog: * mklog.py: Do not search PR entry in a file that is binary.
2022-12-11unidiff: use newline='\n' argumentMartin Liska1-1/+1
In order to support CR on a line, we need to open files with newline='\n' as our line endings supposed to be of UNIX style. contrib/ChangeLog: * check_GNU_style.py: Use newline=\n. * check_GNU_style_lib.py: Simplify. * gcc-changelog/git_commit.py: Fix issues seen Rust patchset. * gcc-changelog/git_email.py: Use newline argument. * gcc-changelog/test_email.py: New test. * gcc-changelog/test_patches.txt: New test. * mklog.py: Use newline argument.
2022-07-22Allow space in git commit-mklog argsMartin Liska1-0/+5
contrib/ChangeLog: * git-commit-mklog.py: Do not parse -b argument. Pass mklog_args as json environment variable. * mklog.py: Parse GCC_MKLOG_ARGS and append it to sys.argv. * prepare-commit-msg: Do not append GCC_MKLOG_ARGS to args.
2022-07-22mklog: fill-up subject prefix only for a single PRMartin Liska1-12/+9
contrib/ChangeLog: * mklog.py: Use component: [PR xyz] only when one PR is used.
2021-08-26mklog: fix renaming with version 0.7.0.Martin Liska1-6/+17
contrib/ChangeLog: * mklog.py: Use file.{source,target}_file for proper rename handling.
2021-08-18commit-mklog: Add --co argument.Martin Liska1-1/+8
The argument can be used for addition of Co-Authored-By lines with --trailer='Co-Authored-By=Mona Lisa Octocat <mona@github.com>'. contrib/ChangeLog: * gcc-git-customization.sh: Wrap $@ in quotes. * git-commit-mklog.py: Add new argument --co. * mklog.py: Skip the Co-Authored-By lines.
2021-08-10mklog: support '-b c/101343' format.Martin Liska1-1/+5
contrib/ChangeLog: * mklog.py: Support additional PRs without PR prefix.
2021-06-28mklog: Handle correctly long lines.Martin Liska1-4/+18
contrib/ChangeLog: * mklog.py: Handle correctly long lines. * test_mklog.py: Test it.
2021-06-22contrib: fix a flake8 issueMartin Liska1-1/+1
contrib/ChangeLog: * mklog.py: Fix flake8 issue.
2021-06-21contrib/mklog.py: Improve PR handlingTobias Burnus1-9/+29
Co-authored-by: Martin Sebor <msebor@redhat.com> contrib/ChangeLog: * mklog.py (bugzilla_url): Fetch also component. (pr_filename_regex): New. (get_pr_titles): Update PR string with correct format and component. (generate_changelog): Take additional PRs; extract PR from the filename. (__main__): Add -b/--pr-numbers argument. * test_mklog.py (EXPECTED4): Update to expect a PR for the new file.
2021-06-17mklog: add subject line skeletonJason Merrill1-1/+14
In the recent gcc-commit-mklog thread on gcc@ it occurred to me that the command could also fill in part of the subject line. If the first PR is foo/1234, and the commit does not yet have a subject line, this will add foo: [PR1234] contrib/ChangeLog: * mklog.py: Add an initial component: [PRnnnnn] line when we have a PR.
2021-05-13mklog: Put detected PR entries before ChangeLogsMartin Liska1-2/+8
contrib/ChangeLog: * mklog.py: Put PR entries before all ChangeLog entries (will be added to all ChangeLog locations by Daily bump script). * test_mklog.py: Test the new behavior.
2021-03-23mklog: fix test_mklog.py tests.Martin Liska1-3/+5
contrib/ChangeLog: * mklog.py: Fix broken tests.
2021-03-22mklog: add new argument --directory.Martin Liska1-1/+4
The argument is handy when one needs to generate ChangeLog entries for a different project (e.g. binutils). contrib/ChangeLog: * mklog.py: Add --directory argument.
2021-02-08mklog: automatically fill in generated entriesMike Frysinger1-0/+5
contrib/ChangeLog: * mklog.py (generated_files): New set. (generate_changelog): Add entries based on generated_files.
2021-01-14mklog: skip unsupported filesMartin Liska1-0/+3
This fixes an infinite loop one could see for: git show b87ec922c40 | ./contrib/mklog.py contrib/ChangeLog: * mklog.py: Fix infinite loop for unsupported files.
2021-01-13mklog: support define_insn_and_split formatMartin Liska1-1/+11
contrib/ChangeLog: * mklog.py: Parse also define_insn_and_split and similar directives in .md files. * test_mklog.py: Test.
2021-01-04mklog.py: add --update-copyright optionMartin Liska1-19/+48
contrib/ChangeLog: * mklog.py: Add --update-copyright option which adds: "Update copyright years." to ChangeLog files belonging to a modified file.
2020-11-16mklog: support unidiff 0.5.4Martin Liska1-5/+4
contrib/ChangeLog: * mklog.py: Do not call read on an input stream. Fix some flake8 issues.
2020-09-21mklog.py: Parse first 10 lines for PR/DR numberTobias Burnus1-2/+7
contrib/ChangeLog: * mklog.py: Parse first 10 lines for PR/DR number not only the first line.
2020-05-28mklog: support renaming of filesMartin Liska1-0/+8
contrib/ChangeLog: * mklog.py: Support renaming of files. One needs unidiff 0.6.0+. * test_mklog.py: Test it.
2020-05-26gcc-git: Add prepare-commit-msg hook.Jason Merrill1-1/+22
This patch introduces a prepare-commit-msg hook that appends a ChangeLog skeleton to a commit message when the GCC_FORCE_MKLOG environment variable is set, and a 'git commit-mklog' command set that variable while running 'git commit'. contrib/ChangeLog: * prepare-commit-msg: New file. * gcc-git-customization.sh: Install it. Add commit-mklog alias. * mklog.py: Add new option -c which appends to a ChangeLog file.
2020-05-21mklog: support parsing of DR.Martin Liska1-1/+8
* mklog.py: Support DR parsing. * test_mklog.py: New test for DR parsing.
2020-05-19Use REST API for bug titles in mklog.Martin Liska1-11/+9
* mklog.py: Use REST API for bug title downloading.
2020-05-19mklog.py: improve parsing of struct names (ignore GTY).Martin Liska1-4/+8
* mklog.py: Skip GTY for struct names. Make flake8 happy. * test_mklog.py: Add test for GTY.
2020-05-19New mklog script.Martin Liska1-0/+223
contrib/ChangeLog: 2020-05-15 Martin Liska <mliska@suse.cz> * gcc-git-customization.sh: Add alias.gcc-mklog new hook. * mklog.py: New file. * test_mklog.py: New file.