Re: Hash for a commit sourcetree beside to a commit hash
- From
Philip Oakley <philipoakley@iee.email>
- Date
- Feb 3, 2023, 11:11 UTC
- Message-ID
- <22255406-42da-9ac3-4783-11a035877a3c@iee.email>
- In-Reply-To
- <563617028.20230203052145@inbox.ru>
On 03/02/2023 02:21, Andry wrote:
Show 11 quoted lines
> Đoàn,
> Friday, February 3, 2023, 5:01:09 AM, you wrote:
> ĐTCD> git rev-list <a-commit-tish> |
> ĐTCD> while read commit; do
> ĐTCD> if test $(git rev-parse $commit^{tree}) = $hash; then
> ĐTCD> echo $commit
> ĐTCD> break
> ĐTCD> fi
> ĐTCD> done
>
> Nice, but I can not apply this over a git hub or a web interface without a clone.As a 'Distributed'-VCS, cloning the repository would be the de-facto normal approach, otherwise you have re-invented centralised VCS ;-)
Alternatively, you could approach the server (hub/web interface) provider to see if they are willing to provide that level of search interface.
That said, having extra search capability within rev-list to search for blobs and tree would/could be useful in specialised scenarios, though that is becoming rather niche. -- Philip