What are the random numbers? Commit hashes are deterministic and based on the commit contents
Git commit hashes are indeed deterministic, though it depends on the inputs.
From StackOverflow [0]:
Git uses the following information to generate the sha-1:
* The source tree of the commit (which unravels to all the subtrees and blobs)
* The parent commit sha1
* The author info (with timestamp)
* The committer info (right, those are different!, also with timestamp)
* The commit message
$ git rev-parse HEAD
78d66a4f169fec9cb9b3252f7a22bb020e967cd2
$ git log HEAD
commit 78d66a4f169fec9cb9b3252f7a22bb020e967cd2 (HEAD -> master)
Author: XXXX
Date: Mon Nov 2 20:44:04 2020 -0500
temp2
$ git reset --soft HEAD\^
$ GIT_COMMITTER_DATE='Mon Nov 2 20:44:04 2020 -0500' GIT_AUTHOR_DATE='Mon Nov 2 20:44:04 2020 -0500' git commit -m temp2
[master 78d66a4] temp2
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 b
$ git rev-parse HEAD
78d66a4f169fec9cb9b3252f7a22bb020e967cd2