Fetching diff hash from GITHub commit url

If you open a GITHub commit, click the "modified file" link and click on any of the modified files, the commit url in the browser will add the hash id diff like this:

# diff-3db08c3ce067ae92af324b2d8bd6b5e2 .

Full url - https://github.com/google/guava/commit/19c39725be34efafa59edf6238713e97f6565eb1#diff-3db08c3ce067ae92af324b2d8bd6b5e2

Can someone explain to me what this diff hash identifier is, is there a git command to generate this identifier for the modified file?

+3


source to share


2 answers


The part after is #diff-

not a SHA-1 hash because it doesn't contain 40 characters, but rather 32. In fact, if you run this command in your repo:

git rev-parse 3db08c3ce067ae92af324b2d8bd6b5e2

      

you get this:



fatal: ambiguous argument '3db08c3ce067ae92af324b2d8bd6b5e2': unknown version or path not in working tree.

So, if I had to guess, I would say that the GUID generated by GitHub keeps track of the files included in the commit.

+1


source


I coincidentally asked for support, and github told me it was not documented. Instead, we have to use some kind of API to recover the URI.



I don't like the answer, but that's what it is.

0


source







All Articles