Re: [BUG] git restore: typo in error message "could not resolve ource"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 22, 2025, 13:19 UTC
- Message-ID
- <xmqqbjjqslgq.fsf@gitster.g>
- In-Reply-To
- <aUkx2XYCP75GrCsS@fruit.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 7 quoted lines
> So I think this is functioning as designed and isn't actually a typo in
> Git. The code appears to be in `builtin/checkout.c`:
>
> builtin/checkout.c: die(_("could not resolve %s"), opts->from_treeish);
>
> That shows that it prints "could not resolve" and then the thing it
> tried to resolve as a branch.Hilarious.
We probably should give a pair of quotes around '%s' like other messages, and that is what CodingGuidelines asks us to do. In the section of "Error Messages", we find this.
- Enclose the subject of an error inside a pair of single quotes,
e.g. `die(_("unable to open '%s'"), path)`.Thanks.