Thread (25 messages) 25 messages, 3 authors, 2026-02-18

[PATCH v3 0/5] builtin/history: some smaller UI improvements

STALE230d

From: Patrick Steinhardt <hidden>
Date: 2026-02-16 06:45:55

Revision v3 of 3 in this series.

Revisions (3)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current
Hi,

this patch series contains a small set of UI improvements for
git-history(1):

  - The first two commits adapt git-history(1) so that it performs
    verifications before asking the user for input.

  - The last two commits rework the "--ref-action=" option to instead be
    split up into "--dry-run" and "--update-refs=" so that the option is
    less focussed on technical implementation details.

I decided to send this patch series as a small incremental step before
sending `git history split`, also because that series conflicts with
aa/add-p-no-auto-advance.

Changes in v3:
  - Fix a typo in the commit message.
  - Link to v2: https://lore.kernel.org/r/20260213-b4-pks-history-dry-run-v2-0-756ac376e9e5@pks.im (local)

Changes in v2:
  - Use `strvec_pushv()` instead of looping around `strvec_push()`.
  - Document that "--dry-run" writes objects for later use.
  - Document the default value of "--update-refs=".
  - Mention the subtlety around false(1) in the commit messages.
  - Link to v1: https://lore.kernel.org/r/20260212-b4-pks-history-dry-run-v1-0-1ce03d631c1b@pks.im (local)

Thanks!

Patrick

---
Patrick Steinhardt (5):
      builtin/history: perform revwalk checks before asking for user input
      builtin/history: check for merges before asking for user input
      builtin/history: replace "--ref-action=print" with "--dry-run"
      builtin/history: rename "--ref-action=" to "--update-refs="
      Documentation/git-history: document default for "--update-refs="

 Documentation/git-history.adoc |  14 ++-
 builtin/history.c              | 254 ++++++++++++++++++++++++++---------------
 t/t3451-history-reword.sh      |  20 +++-
 3 files changed, 182 insertions(+), 106 deletions(-)

Range-diff versus v2:

1:  26db5f0113 = 1:  21b4933c39 builtin/history: perform revwalk checks before asking for user input
2:  9bcde0b932 = 2:  37e42cf770 builtin/history: check for merges before asking for user input
3:  e070d8ecfa ! 3:  fcfd80b2b5 builtin/history: replace "--ref-action=print" with "--dry-run"
    @@ Commit message
         will always operate as if the user wanted to rewrite all branches. But
         in fact, the user also has the option to only update the HEAD reference,
         and they might want to perform a dry-run of such an operation, too. We
    -    could of course introduce "--ref-actoin=print-head", but that would
    +    could of course introduce "--ref-action=print-head", but that would
         become even less ergonomic.
     
         Replace "--ref-action=print" with a new "--dry-run" toggle. This new
4:  59f470b158 = 4:  8333a4ebd6 builtin/history: rename "--ref-action=" to "--update-refs="
5:  bde39d43a9 = 5:  9ef41103f0 Documentation/git-history: document default for "--update-refs="

---
base-commit: 6fcee4785280a08e7f271bd015a4dc33753e2886
change-id: 20260212-b4-pks-history-dry-run-2b840e530ae6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help