Re: [PATCH] scripts: git-resolve: ignore non-commit objects
From: Sasha Levin
Date: Tue Nov 03 2026 - 12:37:24 EST
On Tue, Nov 03, 2026 at 05:42:02PM +0100, Hamdy Abou El Anein wrote:
>git rev-parse --disambiguate lists objects of every type. A unique blob
>or tree prefix is therefore returned successfully as a commit ID. Such
>an ID cannot be used as a commit reference or Fixes tag.
>
>Filter the candidates by object type before deciding whether the prefix
>is unique or looking up its subject.
This also fixes a more common case: an abbreviated ID that collides only
with trees or blobs used to fail unless a subject was given. 117 of the
last 2000 commits in linux.git have a 7 character abbreviation like that.
The argument check at the bottom of the script still counts every object
type, so a prefix that matches only a blob now exits 1 without printing
the "does not match any git commit" error. Could you send a follow-up
that filters that check the same way?
Acked-by: Sasha Levin <sashal@xxxxxxxxxx>
--
Thanks,
Sasha