From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 840201F5A0 for ; Fri, 3 Feb 2023 11:11:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232165AbjBCLLY (ORCPT ); Fri, 3 Feb 2023 06:11:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230384AbjBCLLX (ORCPT ); Fri, 3 Feb 2023 06:11:23 -0500 Received: from smtp.hosts.co.uk (smtp.hosts.co.uk [85.233.160.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3A9B76407 for ; Fri, 3 Feb 2023 03:11:21 -0800 (PST) Received: from host-2-103-194-72.as13285.net ([2.103.194.72] helo=[192.168.1.57]) by smtp.hosts.co.uk with esmtpa (Exim) (envelope-from ) id 1pNtyS-0006rm-3w; Fri, 03 Feb 2023 11:11:20 +0000 Message-ID: <22255406-42da-9ac3-4783-11a035877a3c@iee.email> Date: Fri, 3 Feb 2023 11:11:19 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: Hash for a commit sourcetree beside to a commit hash Content-Language: en-GB To: Andry , =?UTF-8?B?xJBvw6BuIFRyw6LMgG4gQ8O0bmcgRGFuaA==?= Cc: git@vger.kernel.org References: <1798489336.20230203042837@inbox.ru> <563617028.20230203052145@inbox.ru> From: Philip Oakley In-Reply-To: <563617028.20230203052145@inbox.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 03/02/2023 02:21, Andry wrote: > Đoàn, > Friday, February 3, 2023, 5:01:09 AM, you wrote: > ĐTCD> git rev-list | > Đ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