From: Andry <andry@inbox.ru>
To: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Hash for a commit sourcetree beside to a commit hash
Date: Fri, 3 Feb 2023 05:21:45 +0300 [thread overview]
Message-ID: <563617028.20230203052145@inbox.ru> (raw)
In-Reply-To: <Y9xq5VAMjzUqTb6X@danh.dev>
Hello Đoàn,
Friday, February 3, 2023, 5:01:09 AM, you wrote:
ĐTCD> On 2023-02-03 04:28:37+0300, Andry <andry@inbox.ru> 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.
next prev parent reply other threads:[~2023-02-03 3:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 1:28 Hash for a commit sourcetree beside to a commit hash Andry
2023-02-03 2:01 ` Đoàn Trần Công Danh
2023-02-03 2:21 ` Andry [this message]
2023-02-03 11:11 ` Philip Oakley
2023-02-03 13:37 ` Andry
2023-02-03 15:15 ` Đoàn Trần Công Danh
2023-02-04 4:50 ` Andry
2023-02-03 22:39 ` Philip Oakley
2023-02-05 1:41 ` Andry
2023-02-12 13:27 ` Andry
2023-02-26 9:37 ` Andry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=563617028.20230203052145@inbox.ru \
--to=andry@inbox.ru \
--cc=congdanhqx@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox