* Is it possible get the tag name of working copy in Git? @ 2015-03-13 7:08 chen chang 2015-03-13 9:36 ` Torsten Bögershausen 0 siblings, 1 reply; 3+ messages in thread From: chen chang @ 2015-03-13 7:08 UTC (permalink / raw) To: git I want to use make file auto generate the revision number of working copy from the tag name in git. So as questioned in subject, I have tried to use 'git describe', it works well in most case, and the output is good match my requirement. Problem is: when there are multiple tags on same one commit, if check out one of these tag, the 'git describe' only be able to return the most new created tag name in that commit, instead of the real checked out tag. Seems 'git-describe' capture the most recent tag name by create sequence. I expect add an argument to 'git-describe' to make it get the most recent tag name according to checkout status when multiple tags on one commit. Is there any suggestion? Thanks! ------------------------------ Chen Chang ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Is it possible get the tag name of working copy in Git? 2015-03-13 7:08 Is it possible get the tag name of working copy in Git? chen chang @ 2015-03-13 9:36 ` Torsten Bögershausen 2015-03-13 17:00 ` Stefan Beller 0 siblings, 1 reply; 3+ messages in thread From: Torsten Bögershausen @ 2015-03-13 9:36 UTC (permalink / raw) To: chen chang, git On 03/13/2015 08:08 AM, chen chang wrote: > I want to use make file auto generate the revision number of working > copy from the tag name in git. You should have the tag name, as it is set up before running make, and probably feed into both "git checkout tagXXYYXX" and the Makefile. If you want the "version number", what is this ? Git has a sha value, you can git it like this: git rev-parse HEAD | cut -b 1-9 HTH ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Is it possible get the tag name of working copy in Git? 2015-03-13 9:36 ` Torsten Bögershausen @ 2015-03-13 17:00 ` Stefan Beller 0 siblings, 0 replies; 3+ messages in thread From: Stefan Beller @ 2015-03-13 17:00 UTC (permalink / raw) To: Torsten Bögershausen; +Cc: chen chang, git@vger•kernel.org On Fri, Mar 13, 2015 at 2:36 AM, Torsten Bögershausen <tboegi@web•de> wrote: > On 03/13/2015 08:08 AM, chen chang wrote: >> >> I want to use make file auto generate the revision number of working >> copy from the tag name in git. > Maybe you're looking for git describe? http://git-scm.com/docs/git-describe ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-13 17:00 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-03-13 7:08 Is it possible get the tag name of working copy in Git? chen chang 2015-03-13 9:36 ` Torsten Bögershausen 2015-03-13 17:00 ` Stefan Beller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox