Page MenuHomeFreeBSD

find-mfc: add a tool to find MFC candidates
ClosedPublic

Authored by emaste on Feb 8 2022, 7:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 14 2022, 9:42 PM
Unknown Object (File)
Dec 14 2022, 6:22 PM
Unknown Object (File)
Dec 2 2022, 3:09 PM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste requested review of this revision.Feb 8 2022, 7:52 PM
emaste created this revision.

Example use - find my MFC candidates under sys/

$ sh tools/tools/git/find-mfc.sh sys
64a790d26480 DTrace: remove sparc64 remnants in non-contrib code
...
301b2b02dfcf snd_hda: restore pin patch for headphones on Lenovo X1 7th Gen
2075d00fabb6 hwpmc: drop 0x before %p printf format string
9c296a210573 geom: Add HiFive boot partitions
tools/tools/git/find-mfc.sh
50 ↗(On Diff #102509)

This sorts by (but does not print) commit time - will comment

manu added inline comments.
tools/tools/git/find-mfc.sh
4 ↗(On Diff #102509)

to_branch needs to be modifiable without editing the script.

41 ↗(On Diff #102509)

Maybe uses mktemp for all the files created in this script ?

tools/tools/git/find-mfc.sh
4 ↗(On Diff #102509)

cmd line: -t [to branch]

but perhaps we can invoke git symbolic-ref --short HEAD and if it looks like stable/X default to freebsd/stable/X

41 ↗(On Diff #102509)

yeah, should do.
this started out as a one-off script in my working directory

tools/tools/git/find-mfc.sh
44 ↗(On Diff #102509)

I probably want to drop $authorarg here, actually -- we also want to exclude from the list commits that were MFC'd by someone else.

use a tmpdir as manu suggests

As suggested on IRC: would be nice to have a '-X' option to take an input file that is a list of commits to ignore. I already use such a file now to manually filter. It would be nice if the format of this file was the same as the output of this tool so that one could just copy and paste lines for commits one wants to ignore in the future. (E.g. <hash> <descript> but just use cut or the like to pull the hash from the exclude file).

tools/tools/git/find-mfc.sh
39 ↗(On Diff #102683)

Do you want similar logic for merging to releng/X.Y (default from_branch stable/X in that case?)

As suggested on IRC: would be nice to have a '-X' option to take an input file that is a list of commits to ignore.

Good idea, I'll work on that in a bit. If folks are happy enough with this in general I'll commit the current version and follow up with that.

tools/tools/git/find-mfc.sh
39 ↗(On Diff #102683)

Ah yes

use releng branches as merge-to candidates also

emaste added subscribers: rew, andrew.

anchor user with < and @ so that -u rew matches only @rew, not @andrew or anyone else with "rew" in their author string

determine default stable branch corresponding to releng

tools/tools/git/find-mfc.sh
30 ↗(On Diff #102698)

Extra t

tools/tools/git/find-mfc.sh
30 ↗(On Diff #102698)

Thanks, fixed locally

rpokala added inline comments.
tools/tools/git/find-mfc.sh
107 ↗(On Diff #102698)

Per IRC, these are patterns, so it's matching the name component of an email address. Please comment accordingly.

Thanks, definitely worth getting into the tree and iterating on further there if needed.

This revision is now accepted and ready to land.Apr 28 2022, 5:09 PM
This revision was automatically updated to reflect the committed changes.