Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>git describe --long</code> would always output version number like this: <strong>v1.2-10-gdeadbee</strong>, which means 10th commit since <em>annotated</em> tag 'v1.2' that points at commit with shortened SHA-1 'deadbee'. So all you have to do is to tag branch start (branching point of a branch) e.g. <code>&lt;<em>branch</em>&gt;-start</code>.</p> <p>The abbreviated commit SHA-1 hash is required to distinguish between ambiguous situations, because "3rd commit since tag 'x'" (for example) does not uniquely distinguish a commit; there can be more than one commit that fits mentioned description in the presence of nonlinear, branchy development. For example in the situation shown on the ASCII-art diagram below both commits marked with * fits "3rd commit since tag 'x'" description.</p> <pre> /-.---*---.-\ &nbsp; / \ &nbsp; .---x---.---.---*---.---M---. &lt;--- branch </pre> <p><sub>Note that in "merged in" case as shown above you can't use branch name to distinguish between those two commits with the same description.</sub></p> <p>So what you have to do would be to take <code>git describe --long</code> output (the <code>--long</code> option is here to avoid ambiguities with parsing, see <a href="http://www.kernel.org/pub/software/scm/git/docs/git-describe.html" rel="nofollow noreferrer" title="git-describe(1) Manual Page - Show the most recent tag that is reachable from a commit">git describe manpage</a>), parse it, and add current branch info (from e.g. <code>git symbolic-ref HEAD</code>, <strong>not</strong> from pasing <code>git branch</code> output) yourself. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload