Re: Hash for a commit sourcetree beside to a commit hash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Đoàn,



Friday, February 3, 2023, 5:01:09 AM, you wrote:

ĐTCD> On 2023-02-03 04:28:37+0300, Andry <andry@xxxxxxxx> wrote:
>> Hello Git,
>> 
>> Is there a chance to add this property to a commit and a set of
>> commands,

ĐTCD> Does `git rev-parse commit^{tree}` works for you? E.g.
ĐTCD>         git rev-parse HEAD^{tree}

If the `^{tree}` does calculate a commit internal sourcetree hash without other commits, then yes.
If it does rely on other commits and accumulates the sourcetree over the chain of commits, then it does not calculate the hash by the difference and can not be applied as I have described.

>> for example, to search a commit by a sourcetree hash?

ĐTCD> I'm not sure if I understand your question correctly, but does this
ĐTCD> work?

Đ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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux