Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
docs:guide-developer:source-code:source-revision-calculation [2018/02/17 17:48] – ↷ Page moved from docs:guide-developer:source-revision-calculation to docs:guide-developer:source-code:source-revision-calculation bobafetthotmaildocs:guide-developer:source-code:source-revision-calculation [2018/03/18 18:22] (current) – [Convert between source revision and git commit hash] jeff
Line 8: Line 8:
 ===== Convert between source revision and git commit hash ===== ===== Convert between source revision and git commit hash =====
  
-You can use ./scripts/getver.sh in your buildroot in three ways:+You can use ./scripts/getver.sh in your buildroot in four ways:
   * Without arguments, it gives you current HEAD revision as "rxxxx-hash". That is the normal use.   * Without arguments, it gives you current HEAD revision as "rxxxx-hash". That is the normal use.
   * If you give a version like "r3298" as an argument, it fetches you the git hash   * If you give a version like "r3298" as an argument, it fetches you the git hash
   * If you give a git hash as argument, it calculates the rxxxx revision for it   * If you give a git hash as argument, it calculates the rxxxx revision for it
 +  * If you give it its own output ("version string") it will return the hash for the git commit
  
 === Example === === Example ===
Line 33: Line 34:
 $ ./scripts/getver.sh r3296 $ ./scripts/getver.sh r3296
 1bdd23231b9de6f98b5c51360167abc7b5e92716 1bdd23231b9de6f98b5c51360167abc7b5e92716
 +</code>
 +Recovering git commit from version string
 +<code>
 +lede_source$ git describe
 +v17.01.4-215-g05f0fac
 +
 +lede_source$ ./scripts/getver.sh 
 +r2993+783-b9a408c
 +
 +lede_source$ ./scripts/getver.sh r2993+783-b9a408c
 +05f0fac189984981e3f28288e44d9afdd088dd77
 </code> </code>
  • Last modified: 2018/02/17 17:48
  • by bobafetthotmail