Sazzad Hissain Khan
Sazzad Hissain Khan

Reputation: 40226

Human readable/comparable git change IDs

Some version control system, for example, Perforce, keeps CL as simple integer, hence looking into two different CL on same branch, it's easy to understand which CL has been merged first. But, in case of Git, a CL/ short CL is long hex string, which is not even comparable by human eyes easily. Is there any way to get rid of this issue?

Upvotes: 0

Views: 374

Answers (2)

Noufal Ibrahim
Noufal Ibrahim

Reputation: 72795

I'm afraid not. The distributed nature of the system precludes a nice monotonically increasing "revision number". If you and someone else on the other side of the globe decide to commit (not push) a patch at exactly the same time, who is version n and who is n+1? That kind of synchronisation is possible only when there's a single central server that can assign revision numbers. It's a price to pay for being distributed.

However, while there are no technical solutions, there are social solutions. Good branch names, proper tagging help you understand what's going on with the project. git branch --merged and --no-merged will give you details on what branches are merged and what aren't.

Upvotes: 2

Marina Liu
Marina Liu

Reputation: 38116

No, the SHA-1 hash for git is a 40 characters string. It’s calculated based on contents of files. And git olny stores SHA-1 in database. So it’s not readable for human eyes.

If you want to check the histories of git, git log --oneline --decorate --graph --all is clear to view.

Upvotes: 1

Related Questions