]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scripts: Add git-resolve tool for full SHA-1 resolution
authorSasha Levin <sashal@kernel.org>
Tue, 11 Mar 2025 16:53:36 +0000 (12:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Apr 2025 08:56:11 +0000 (10:56 +0200)
commit7ae52a3d7f511c95dad414441db7cfdd6356d88a
tree9feae54520cc1ed45ef1e35198a169572a3b85a0
parentd062463edf1770427dc2d637df4088df4835aa47
scripts: Add git-resolve tool for full SHA-1 resolution

Introduce git-resolve.sh, a tool that resolves short git commit IDs to their
full SHA-1 hash. This is particularly useful for navigating references in commit
messages and verifying Fixes tags.

When faced with ambiguous commit IDs or imprecise references in messages,
this tool can help by resolving commit hashes based on not just the ID
itself but also the commit subject, making it more robust than standard
git rev-parse.

This is especially valuable for maintainers who need to verify Fixes tags
or cross-reference commits. Unlike proposals to add dates to Fixes tags
(which would break existing tooling), this script provides a way to
disambiguate commits without changing the established tag format.

The script includes several features:
- Resolves short commit IDs to full SHA-1 hashes
- Uses commit subjects to disambiguate between multiple potential matches
- Supports wildcard patterns in subjects with ellipsis (...)
- Provides a force mode to attempt resolution by subject when ID lookup fails
- Includes comprehensive self-tests

Signed-off-by: Sasha Levin <sashal@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20250311165336.248120-1-sashal@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/git-resolve.sh [new file with mode: 0755]