{"action":"opened","issue":{"url":"https://api.github.com/repos/jgitver/jgitver/issues/24","repository_url":"https://api.github.com/repos/jgitver/jgitver","labels_url":"https://api.github.com/repos/jgitver/jgitver/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/jgitver/jgitver/issues/24/comments","events_url":"https://api.github.com/repos/jgitver/jgitver/issues/24/events","html_url":"https://github.com/jgitver/jgitver/issues/24","id":212487026,"number":24,"title":"Allow for the \"-g\" prefix to be part of the generated version number","user":{"login":"eduardozamin","id":11438722,"avatar_url":"https://avatars3.githubusercontent.com/u/11438722?v=3","gravatar_id":"","url":"https://api.github.com/users/eduardozamin","html_url":"https://github.com/eduardozamin","followers_url":"https://api.github.com/users/eduardozamin/followers","following_url":"https://api.github.com/users/eduardozamin/following{/other_user}","gists_url":"https://api.github.com/users/eduardozamin/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardozamin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardozamin/subscriptions","organizations_url":"https://api.github.com/users/eduardozamin/orgs","repos_url":"https://api.github.com/users/eduardozamin/repos","events_url":"https://api.github.com/users/eduardozamin/events{/privacy}","received_events_url":"https://api.github.com/users/eduardozamin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-07T16:34:19Z","updated_at":"2017-03-07T16:34:19Z","closed_at":null,"body":"## Background\r\n\r\nWhen using `git describe` to describe a commit, git adds the `-g` prefix to the commit hash:\r\n```\r\n$ git describe --tags --long\r\n1.0.1-7-ge24b4ac\r\n       ^^\r\n```\r\nWhat's interesting about using this format is that the whole string generated by `git describe` can be directly used for a checkout command:\r\n```\r\n$ git checkout 1.0.1-7-ge24b4ac\r\nNote: checking out '1.0.1-7-ge24b4ac'.\r\nYou are in 'detached HEAD' state. You can look around, make experimental\r\n...\r\nHEAD is now at e24b4ac...\r\n```\r\n\r\nIf the `-g` prefix is ommited, the checkout will not work:\r\n```\r\n$ git checkout 1.0.1-7-e24b4ac\r\nerror: pathspec '1.0.1-7-e24b4ac' did not match any file(s) known to git.\r\n```\r\n\r\n## Feature Request\r\n\r\nIt would be nice if **jgitver** (and related plugins -- e.g. I'm using the [jgitver-maven-plugin](https://github.com/jgitver/jgitver-maven-plugin)) allows for generating the commit hash with the `-g` prefix in it. \r\nThis would allow a developer to always be able to checkout a given \"version number\", without having to care if this is a major tag, a minor tag, or just a commit in between.\r\n\r\nCurrently this is not possible, the \"commit-hash\" part of the version number does not contain the `-g` prefix.\r\n```\r\n$ mvn package\r\n...\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] Building module-xyz 1.0.1-7-a21b55ae\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] \r\n```"}}
{"actor":{"display_login":"eduardozamin"}}