mbox series

[b4,v2,0/3] prep, diff: support adding range-diff arguments

Message ID 20250220-creation-factor-v2-0-7a0949a3a060@bootlin.com (mailing list archive)
Headers show
Series prep, diff: support adding range-diff arguments | expand

Message

Antonin Godard Feb. 20, 2025, 2:24 p.m. UTC
git range-diff allows to override the creation factor, which is
sometimes useful to adjust for seeing different diff outputs. This is
not possible with the current code, and is also not configurable from
git config.

Add an option to diff and prep to override the git range-diff arguments,
such as --creation-factor.

Example:

  b4 --debug prep --compare-to v1 --range-diff-opts "--creation-factor=80 --no-dual-color"

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
Changes in v2:
- As suggested by Konstantin, change "--creation-factor" to
  "--range-diff-opts" to be able to add git range-diff arguments more
  generally.
- Add a commit to document the option.
- Link to v1: https://patch.msgid.link/20250204-creation-factor-v1-0-9988d594a018@bootlin.com

---
Antonin Godard (3):
      diff: add a creation factor argument
      prep: add creation-factor argument
      prep, diff: document the --range-diff-opts option

 docs/contributor/prep.rst |  6 ++++++
 docs/maintainer/diff.rst  |  5 +++++
 src/b4/command.py         |  4 ++++
 src/b4/diff.py            | 10 +++++++++-
 src/b4/ez.py              |  9 +++++++--
 5 files changed, 31 insertions(+), 3 deletions(-)
---
base-commit: d23a9a2d5684369710bd2e416e41159193df3756
change-id: 20250127-creation-factor-ce8069a0bb3c

Best regards,