Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you looked at git describe?</p> <p><a href="http://linux.die.net/man/1/git-describe" rel="nofollow">http://linux.die.net/man/1/git-describe</a></p> <p>I use this output for a number of different projects. It will give you the closest tag in the past, the number of commits since the tag, and a few characters from the hash. </p> <p>Here is an example from the manpage: v1.0.4-14-g2414721</p> <p>In this example, the parts are:</p> <ul> <li>the tag is 'v1.0.4'</li> <li>there have been 14 commits <em>after</em> the tag on this branch</li> <li>the hash prefix is 2414721</li> </ul> <p>If the last commit is tagged, you'll get only the tag name: v1.0.4</p> <p>There are lots of useful options, but the two that are most important to my projects are:</p> <blockquote> <p><code>--tags:</code> I use lightweight, unsigned tags which it doesn't pick up by default.</p> <p><code>--match:</code> If you have different types of tags but only want to match those that start with 'v'.</p> </blockquote> <p>From a process point of view, what I do for serious projects is to also:</p> <ol> <li><p>Change the version and count to an rc or beta format: </p> <pre><code>tag v1.2-14 --&gt; `1.3-rc14` or `1.3-beta14` </code></pre> <p>You can't be building 1.2 since it is in the past, so it must be the 14th build of the next version which is 1.3.</p></li> <li><p>Prepend the branch name if it is a special branch (not master, etc.) For example, "v1.2-14" on branch "featurex" would produce:</p> <pre><code>featurex-1.3-rc14 </code></pre></li> <li><p>Append <code>-modified</code> or `-unsupported" if the build doesn't have everything checked in. This is your clue that you will never be able to reproduce it.</p> <pre><code> featurex-1.3-rc14-unsupported </code></pre></li> <li><p>Store the hash on the end or on the next line in logs or about screens. I normally put the full hash into logs and such, but the smaller prefix is common: <code>featurex-1.3-rc14 (2414721)</code> This works nicely with my workflow. When I merge the feature into a release branch, the prefix goes away: <code>1.3-rc14 (2414721)</code></p></li> </ol> <p>When testing is complete and the version is tagged, the rc goes away: <code>1.3 (2414721)</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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