From Git doc page for git patch-id, it states:
A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a patch, with line numbers ignored. As such, it’s "reasonably stable", but at the same time also reasonably unique, i.e., two patches that have the same "patch ID" are almost guaranteed to be the same thing.
Namely for that first quoted sentence, I'm just checking two things:
- that the patch ID is computed by taking each "diff" given by
git diff, computing its SHA-1, and then simply adding them? - what is the "diff" that the SHA-1 is taken of? Is it per "hunk" of
git diff(see more below), by line, or something else? In other words: what is each "diff" in "file diffs" in the quoted doc?
Specifically for 2., for example, though this may be a question regarding git diff and similar, as reference from other Stack Overflow questions like How to read the output from git diff?, git diff outputs (at least by default) so-called "hunks" of changes: so are the individual SHA-1's computed by git patch-id the sum of SHA-1-ing over git diff "hunks", or by individual lines (output by git diff as having changed), or something else?