[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z23ZmVwgS2ErX-dj@lappy>
Date: Thu, 26 Dec 2024 17:32:57 -0500
From: Sasha Levin <sashal@...nel.org>
To: torvalds@...ux-foundation.org
Cc: apw@...onical.com, conor@...nel.org, corbet@....net,
dwaipayanray1@...il.com, geert+renesas@...der.be, gitster@...ox.com,
horms@...nel.org, joe@...ches.com, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux@...mhuis.info,
lukas.bulwahn@...il.com, miguel.ojeda.sandonis@...il.com,
niklas.soderlund@...igine.com, willy@...radead.org,
workflows@...r.kernel.org, kees@...nel.org
Subject: Re: [PATCH] git-disambiguate: disambiguate shorthand git ids
On Thu, Dec 26, 2024 at 05:05:55PM -0500, Sasha Levin wrote:
>This also allows users to use shorter commit ID prefixes than normally
>required, since we can correctly identify the intended commit using the
>subject line as additional context.
With this script, and a git alias:
git config --global alias.klog '!sh -c '"'"'last=""; next_to_last=""; args=""; for arg in "$@"; do [ -n "$next_to_last" ] && args="$args $next_to_last"; next_to_last="$last"; last="$arg"; done; hash=$(git-disambiguate.sh "$next_to_last" "$last") && git log $args "$hash"'"'"' -'
We can have (git-log compatible) git-klog find the right commit for us:
$ git klog --oneline -1 cff8 '("net: phy: avoid ... *_led_polarity_set()")'
cff865c70071 net: phy: avoid undefined behavior in *_led_polarity_set()
Which means that folks should be able to use a fairly short abbreviated
commit IDs in messages, specially for commits with a long subject line.
--
Thanks,
Sasha
Powered by blists - more mailing lists