Commit Graph

14 Commits

Author SHA1 Message Date
Íñigo Huguet
5c62286a77 release, find-backports: formatting and log small fixes 2024-12-23 12:41:34 +01:00
Íñigo Huguet
248addcc22 find-backports: fix Ignore-Fixes detection
The regex for "Fixes" also matches with "Ignore-Fixes", so the commit is
added twice and then removed only once by the "Ignore-Fixes". It still
remains once in the list of commits to backport, making that
"Ignore-Fixes" does not work. Fix it.
2024-12-23 12:32:13 +01:00
Thomas Haller
1d241f5295 contrib: fix invalid escape sequence in "find-backports"
Fixes: 57cfa5daf9 ('contrib: add "find-backports" script')
2023-11-20 17:14:47 +01:00
Thomas Haller
fe4e5c24e4 find-backports: improve git_ref_exists() to cache also the hashes themselves
git_ref_exists() memoizes the result. But while it looks up the SHA sum
for "ref", it also can cache the result for the SHA sum itself.
2023-04-07 17:23:13 +02:00
Thomas Haller
65ef6bc9bc find-backports: warn if any commits are not from the first reference
Every branch (for example "nm-1-40") has exactly one next branch, from
which patches should be backported (in that example that branch is
"nm-1-42").

While "find-backports" searches all newer branches for patches, it does
not make it clear form where the patch should come from.

That means, if you run the script `contrib/scripts/find-backports origin/nm-1-40`
it will check nm-1-42 and main branch, and might suggest to backport
patches that are only on main, but not "nm-1-42". That would be wrong,
because patches need to first go into nm-1-42, and then backported (from
there) further to nm-1-40.

Print a warning to highlight that.
2023-04-06 21:37:10 +02:00
Thomas Haller
9f89910852 find-backports: various cleanups in script
- avoid list([...]).
- use some f-strings.
2023-04-06 18:34:15 +02:00
Thomas Haller
efd23da26b find-backports: enable debug logging in script 2023-04-06 18:34:15 +02:00
Thomas Haller
e9340c792c contrib: fail "find-backports" script if we have no "refs/notes/bugs" notes
"find-backports" script parses the commit messages to figure out which
patches to backport. We use "refs/notes/bugs" notes to extend the
meta data after the commit was merged. If you don't setup the
notes, the output is likely incomplete or wrong.

Yes, this is annoying. It requires you to setup the notes as described
in "CONTRIBUTING.md". Also because the "release.sh" script runs "find-backports",
so that means you cannot do releases without setting up the notes
(unless you manually disable running "find-backports"). But you really shouldn't
make a release based on incomplete information.
2022-04-06 13:23:37 +02:00
Thomas Haller
4e28bd5a94 find-backports: support "Ignore-Fixes:" tag to ignore "Fixes:" commit
"Ignore-Backport:" is already in use. For the find-backports script it
has the same meaning as a "cherry picked from" line, that means, we
assume that the referenced patch was backported already and the fix
applied.

This is of course useful to make the script shut up about backports that
we don't want to do. However, it requires us to tag the old branch
with this, so that the script thinks that the patch is already there.

Imaging we have a wrong commit on "next" branch with a Fixes line. We
don't want to backport it, so we would have to tag the "old" branch with
"Ignore-Backport:". That is cumbersome.

Instead, now also support that if a commit contains a "Fixes:" line any
an "Ignore-Fixes:" for the same fixed commit, then this let's the
"Fixes:" line be ignored.
2022-04-05 09:18:22 +02:00
Thomas Haller
99f82b4b84 contrib: fix "find-backports" script to properly handle "Ignore-Backport" tag
The "Ignore-Backport" tag can be used to mark a commit that should not
be backported. Similar to the "cherry picked from" line, which indicates
that the patch was backported.

Anyway, this didn't work correctly, because we first pre-filter the
commits we search (as a performance optimization) by using `git-log` to
get a subset of the commits we want to investigate.

So if you had a commit with an "Ignore-Backport" tag, but without "cherry
picked from" line, then it wasn't found.

Fix that.
2022-01-05 09:30:16 +01:00
Thomas Haller
6365d8c67a contrib/scripts: drop unnecessary line in "find-backports" script 2021-05-26 23:38:58 +02:00
Thomas Haller
f0612bd67b contrib/scripts: update find-backports script to use "main" branch name 2021-04-01 21:40:25 +02:00
Thomas Haller
87749642e2 scripts: allow marking commits with "Ignore-Backport:" in "find-backports" script
"find-backports" searches commit messages of upstream branches for
"Fixes:" comments. Those will then be highlighted to be backported,
if the script determines that to be necessary.

"find-backports" also honors the "cherry picked from" comments, to detect when
a patch was already backported. That is thus a way to suppress reporting a
commit to be backported.

Add another way to flag commits so they don't need backporting. Via
"Ignore-Backport:" tag.

As "find-backports" also honors "refs/notes/bugs" notes, this can be used
like:

    git notes \
      --ref refs/notes/bugs \
      append \
      -m "Ignore-Backport: e""29f00fa0c69 ('NEWS: fix entry that is targeted for 1.30 instead of 1.28')" \
      2''3364aa8f3bd6b11e2ac9e30117eaabfe1f3a9f2
2020-11-24 12:30:06 +01:00
Thomas Haller
57cfa5daf9 contrib: add "find-backports" script
This script was previously on the "automation" branch. Add it to
"master".
2020-10-19 20:34:06 +02:00