From: Adrian Ratiu <adrian.ratiu@collabora.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>,
"Eric W . Biederman" <ebiederm@xmission.com>,
"brian m . carlson" <sandals@crustytoothpaste.net>
Subject: Re: [PATCH v2 2/3] rev-parse: die when --output-object-format cannot map an object
Date: Mon, 23 Nov 2026 18:12:43 +0200 [thread overview]
Message-ID: <87tsl7r0g4.fsf@collabora.com> (raw)
In-Reply-To: <xmqqfqwvnnm5.fsf@gitster.g>
On Fri, 20 Nov 2026, Junio C Hamano <gitster@pobox.com> wrote:
> Adrian Ratiu <adrian.ratiu@collabora.com> writes:
>
>> Fix it to die with the same message as pack-objects. The other callers
>> of repo_oid_to_algop() already check its result.
>
> Mimicking precedent is always a good thing to do.
>
>> Note that this only covers the case where the user asks for a single
>> revision, as it is the only case where rev-parse passes the desired
>> output hash explicitly.
>
> I cannot offer a better rephrasing, but the above is slightly
> ambiguous and excludes "git rev-parse --ooformat=sha1 main next"
> (i.e., two single revision requests are made at the same time),
> which may not be your intention.
Correct, that is not what I meant and "main next" is covered.
What is not covered are the arguments rev-parse expands itself like
"A..B" or "A...B" ranges or shorthands like "rev^!" and others.
I'll clarify this in v3, thanks!
>> +test_expect_success RUST 'rev-parse --output-object-format with unmapped object' '
>> + test_when_finished "rm -rf unmapped" &&
>> + git init --object-format=sha256 unmapped &&
>> + # write the object before enabling compat, so it gets no compat mapping
>
> clever and clean ;-)
Credit goes to Patrick. :)
next prev parent reply other threads:[~2026-11-23 16:13 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 19:57 [PATCH 0/3] compatObjectFormat: fix a BUG(), wrong id and unknown headers Adrian Ratiu
2026-11-12 19:57 ` [PATCH 1/3] setup: reject compatObjectFormat == objectFormat Adrian Ratiu
2026-11-16 7:36 ` Patrick Steinhardt
2026-11-17 10:42 ` Adrian Ratiu
2026-11-12 19:57 ` [PATCH 2/3] rev-parse: die when --output-object-format cannot map an object Adrian Ratiu
2026-11-16 7:37 ` Patrick Steinhardt
2026-11-17 11:55 ` Adrian Ratiu
2026-11-12 19:57 ` [PATCH 3/3] object-file-convert: copy unknown commit headers unchanged Adrian Ratiu
2026-11-16 7:37 ` Patrick Steinhardt
2026-11-17 15:27 ` Adrian Ratiu
2026-11-19 14:18 ` [PATCH v2 0/3] compatObjectFormat: fix a BUG(), wrong ID and unknown headers Adrian Ratiu
2026-11-19 14:18 ` [PATCH v2 1/3] setup: reject compatObjectFormat == objectFormat Adrian Ratiu
2026-11-20 22:21 ` Junio C Hamano
2026-11-19 14:18 ` [PATCH v2 2/3] rev-parse: die when --output-object-format cannot map an object Adrian Ratiu
2026-11-20 22:29 ` Junio C Hamano
2026-11-23 16:12 ` Adrian Ratiu [this message]
2026-11-19 14:18 ` [PATCH v2 3/3] object-file-convert: copy unknown commit headers unchanged Adrian Ratiu
2026-11-20 22:41 ` Junio C Hamano
2026-11-23 16:41 ` Adrian Ratiu
2026-11-21 0:30 ` Junio C Hamano
2026-11-21 19:08 ` Junio C Hamano
2026-11-23 16:16 ` Adrian Ratiu
2026-11-21 2:59 ` [PATCH v2 0/3] compatObjectFormat: fix a BUG(), wrong ID and unknown headers Junio C Hamano
2026-11-30 13:43 ` [PATCH v3 0/4] " Adrian Ratiu
2026-11-30 13:43 ` [PATCH v3 1/4] setup: reject compatObjectFormat == objectFormat Adrian Ratiu
2026-11-30 13:43 ` [PATCH v3 2/4] rev-parse: die when --output-object-format cannot map an object Adrian Ratiu
2026-11-30 13:43 ` [PATCH v3 3/4] object-file-convert: match tree, parent and mergetag headers by key Adrian Ratiu
2026-11-30 13:43 ` [PATCH v3 4/4] object-file-convert: copy unknown commit headers unchanged Adrian Ratiu
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=87tsl7r0g4.fsf@collabora.com \
--to=adrian.ratiu@collabora.com \
--cc=ebiederm@xmission.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ps@pks.im \
--cc=sandals@crustytoothpaste.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