From: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
To: git@vger.kernel.org
Cc: "Jeff King" <peff@peff.net>
Subject: [BUG] revision: premature free-and-null causes “unknown option `(null)`”
Date: Fri, 25 Sep 2026 02:28:57 +0200 [thread overview]
Message-ID: <74796901-ffb1-4cf3-bd63-7294328f70bc@app.fastmail.com> (raw)
(the subject is my preliminary speculation)
Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your
issue.
What did you do before the bug happened? (Steps to reproduce your
issue)
```
git shortlog -n --not-an-option master
```
Note that you need a real option like `-n` before the
`--not-an-option`. Or else it will work correctly.
What did you expect to happen? (Expected behavior)
This error:
```
error: unknown option `--not-an-option'
[usage printout]
```
What happened instead? (Actual behavior)
This error:
```
error: unknown option `(null)'
[usage printout]
```
What's different between what you expected and what actually
happened?
I expected it to print the option in quotes. Instead it printed `(null)`
which I think is the placeholder for when the `%s` arg is `NULL`.
Anything else you want to add:
I have tested and reproduced on:
• master: 0f8e75ab (Revert "Merge branch
'en/no-amend-during-conflicts'", 2026-09-23)
• seen: e844e042 (Merge branch 'je/doc-merge-conflicts' into seen,
2026-09-24)
• next: d58861e6 (Revert "Merge branch 'gg/http-ssl-verify-status' into
next", 2026-09-23)
I have bisected this to cd439487 (revision: manage memory ownership of
argv in setup_revisions(), 2025-09-19).
Note that the recent topic jk/rev-info-argv-to-free fixes issues caused
by commit cd439487, but that topic does not change how this option
handling behaves; the topic is part of `master` now which I tested. I
also tested on top of the topic and got the same `(null)' result.
Please review the rest of the bug report below.
You can delete any lines you don't wish to share.
[System Info]
git version:
git version 2.55.0.793.gc667de3f2c5
cpu: x86_64
built from commit: c667de3f2c5e43830a8dfaa79a27d5d1f106f0ab
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
rust: enabled
feature: fsmonitor--daemon
gettext: enabled
libcurl: 7.81.0
OpenSSL: OpenSSL 3.0.2 15 Mar 2022
zlib: 1.2.11
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1
uname: Linux 6.8.0-138-generic #138~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 7 13:43:15 UTC x86_64
compiler info: gnuc: 11.4
libc info: glibc: 2.35
$SHELL (typically, interactive shell): /bin/bash
[Enabled Hooks]
commit-msg
post-applypatch
post-checkout
post-commit
sendemail-validate
--
Kristoffer Haugsbakk
kristofferhaugsbakk@fastmail.com
next reply other threads:[~2026-09-25 0:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 0:28 Kristoffer Haugsbakk [this message]
2026-09-25 8:26 ` [BUG] revision: premature free-and-null causes “unknown option `(null)`” Jeff King
2026-09-25 20:33 ` [PATCH 0/2] some parse_revision_opt() bugfixes Jeff King
2026-09-25 20:35 ` [PATCH 1/2] revision: avoid reporting known options as unknown on error Jeff King
2026-09-25 20:39 ` [PATCH 2/2] revision: handle argv movement in parse_revision_opt() Jeff King
2026-09-26 9:00 ` Kristoffer Haugsbakk
2026-09-28 3:25 ` Jeff King
2026-09-29 7:43 ` Kristoffer Haugsbakk
2026-09-25 22:23 ` [PATCH 0/2] some parse_revision_opt() bugfixes Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=74796901-ffb1-4cf3-bd63-7294328f70bc@app.fastmail.com \
--to=kristofferhaugsbakk@fastmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox