Versioning for tracking code/ quick debugging purpose

Balasri sai chandana February 24, 2023

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

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2023

Hi @Balasri sai chandana,

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events