Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • 1
    See Git keyword substitution like those in Subversion?, this should basically provide what you are looking for. Commented Nov 7, 2019 at 13:20
  • 2
    Why do you assume this is a common problem? I don't claim long experience in SW development. But I never ever used that kind of information. Also, why do you believe running programs right from git repository is common? Commented Nov 7, 2019 at 13:31
  • 1
    @Euphoric Yes, it's a useful thing to have. It means that a "Help->About" dialog can tell you the exact version of the software. Even the venerable SCCS from 1972 could to it. Commented Nov 7, 2019 at 13:40
  • 6
    Again. Why do you believe the program will run from git repository? Last time I checked, 99.99% of all software runs outside it's repository. That means that the information has to be put there during compilation. And compiler can put that there by simply calling git status. Commented Nov 7, 2019 at 13:43
  • 3
    To me, a commit hash and the version of the software are two different things. You might tag commit abc12345 as version 2.0, but I don't know that anybody besides developers cares about the commit hash over seeing version 2.0 in Help->About. Commented Nov 7, 2019 at 13:58