Hi
There is one tool where it used to give the version no. for every check out on that object if another check out happen I.e paralle to the current checkout then decimal version no. would be written
Like current 20 first checkout 21 , checkout on 20 again 20.1 like wise
Basically this versioning helps in tracking the code / history
Similarly here in GIT is it possible to get the commit Id I.e 7chars hash code before commit gets executed using pre-commit?
Currently - I see one can get the latest commit ID present in the branch but need the commit Id that which gets generated after commit
I don't think there is an easy way to do that. There's some info in the following stackoverflow post about the data that Git uses to generate the SHA-1 hash:
I cannot find on the official Git website (https://git-scm.com/) if the info that is provided in that post is correct or not. However, if that is correct, then the commit hash depends among other things on the timestamp of the commit. You would need to check the source code of Git in order to figure out what is the exact data that is needed to create a commit hash and in what format, and in case timestamps are needed, you would need to know the timestamp of the exact time you are going to create the commit in the future.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.