Commit Graph
6 Commits
Author SHA1 Message Date
Peter BarkerandClaude Opus 5 db56aaff53 Tools: git-subsystems-split: do not label a subject twice
build_template() removes one prefix from a subject before substituting
the subsystem in, so a subject which already named the subsystem after
its prefix ended up labelled twice: relabelling

  AP_HAL: hwdef: avoid shlex when splitting simple hwdef lines

for the hwdef subsystem gave "hwdef: hwdef: avoid shlex ...".

Collapse a repeated label when filling the template in, in both the
place which predicts a new subject for the plan and the place which
writes the message of a commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 14:01:01 +10:00
Henry WurzburgandClaude Sonnet 5 d6d783a9cf Tools: prefer hwdef over HAL name when splitting/relabelling commits
libraries/<HAL>/hwdef/... changes were being tagged with the HAL library
name (e.g. AP_HAL_ChibiOS) since it was listed before hwdef as a
candidate subsystem, and an already-declared HAL name was treated as
valid and left alone. Make hwdef -- the deepest directory in the path --
the canonical tag in both cases, since it applies uniformly across
every HAL rather than being tied to one library.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-29 16:45:27 +10:00
Peter BarkerandClaude Opus 4.8 787b6a09b2 Tools: rewrite git-subsystems-split as a single Python tool
Replace the bash git-subsystems-split driver and its git-commit-subsystems
engine with one Python tool (a GitSubsystemsSplit class with a run()
method) that lives at the same path, so the "git subsystems-split" alias
keeps working.

The tool classifies files by subsystem using the new allowed_subsystems
library instead of the path-libraries.sh / path-nonlibraries.sh shell
helpers.  Per commit it keeps a correctly-labelled commit, relabels the
prefix of a single-subsystem commit whose prefix is wrong (preserving the
message body), or splits a genuinely multi-subsystem commit into one commit
per subsystem, reusing the original message as a $subsystem template.

By default it acts on HEAD; --branch [BASE] processes the whole BASE..HEAD
range (preserving each commit's author and date), and -n/--dry-run prints
the plan without making changes.  The original HEAD is restored on error.

Delete the now-absorbed git-commit-subsystems, path-libraries.sh and
path-nonlibraries.sh helpers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 08:08:08 +10:00
Richard Marko 04b46678a4 treewide: fix shebangs - /bin/bash -> /usr/bin/env bash
Most scripts/tools use non-portable `/bin/bash`, switch
to environment agnostic `/usr/bin/env bash`.
2024-02-13 11:36:23 +11:00
Pierre Kancir 231ee84ab9 Tools: correct author name formatting
prevent error
fatal: --author 'pierre.kancir.emn@gmail.com' n'est pas de la forme 'Nom <email>' ni ne correspond à aucun auteur existant
2021-08-06 23:52:49 +10:00
Gustavo Jose de Sousa 18ec6aa7b4 Tools: gittools: add git-subsystems-split
A git extension for splitting HEAD commit into commits separated by subsystems.
2015-09-09 10:50:35 +10:00