<p dir="ltr">"git-describe -t" works also for lw tags.</p>
<br><div class="gmail_quote"><div dir="ltr">2016年7月4日(月) 2:48 Jared Grubb via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div><blockquote type="cite"><div>El jun. 30, 2016, a las 19:31, Matthias Braun via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> escribió:</div><br><div><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Jun 30, 2016, at 4:14 PM, Renato Golin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><p dir="ltr"><br>
On 30 Jun 2016 10:20 p.m., "Robinson, Paul" <<a href="mailto:paul.robinson@sony.com" target="_blank">paul.robinson@sony.com</a>> wrote:<br>
> We've since stopped creating the tags, and gotten used to not having<br>
> them. We do the 'rev-list --count' trick which mainly gets recorded as<br>
> one component of the version number, and it has been working for us.</p><p dir="ltr">Does that work for sub modules inside the umbrella project?</p></div></blockquote><blockquote type="cite"><div><p dir="ltr">How can you trigger a hook in the umbrella project for commits inside the sub modules? </p></div></blockquote><div>First: This is purely about generating sequential revision numbers, it does not help setting up a server hook to update the submodule references in the meta repository. The point I am trying to make here is that we only need to solve the problem of updating the submodule references, and that generating sequential ID numbers as an alternative to git hashes is no problem.</div><div><br></div><div>As far as I can see we need the following operations for sequential ID numbers and they are all easy enough to perform with git on the client side:</div><div><br></div><div>1. Produce revision number for current checkout (to use in tool --version output):</div><div>You can put something like</div><div> > echo "#define VERSION $(git rev-list --count HEAD)" > version.h</div><div>in your buildsystem</div><div><br></div><div>2. Convert git hash to revision number:</div><div> git rev-list --count $HASH</div><div><br></div><div>3. Convert revision number $NUM to git hash:</div><div> git rev-list HEAD | tail -n $NUM | head -n 1</div></div></div></div></blockquote><br></div></div><div style="word-wrap:break-word"><div>I just want to point out another alternative that I often use in my projects: (Example from buildbot repo I had handy)</div><div><br></div><div>$ git describe</div><div><div>v0.9.0b8-579-ge06cac6</div><div><br></div><div>The format is "TAG-N-gREV", where TAG is the closest reachable git tag in the past ("v0.9.0b8"), N is the relative number of revisions past that tag (579), and REV is the short revision to make it unique and easy to locate ("e06cac6", the 'g' is a literal character that prefixes the revision). In other words, that "-579-" represents a monotonically increasing value relative to the named tag and might serve your purposes. </div></div></div><div style="word-wrap:break-word"><div><div><br></div><div>Jared</div></div></div>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>