Skip to content

Commit

Permalink
Merge pull request #68 from JuliaLang/sk/version.sh
Browse files Browse the repository at this point in the history
bin/version.sh: check code for generating version numbers into bin
  • Loading branch information
StefanKarpinski committed Aug 13, 2015
2 parents 74cea69 + 74ad54b commit 66e962e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ Currently, the `@compat` macro supports the following syntaxes:

## Developer tips

If you're adding additional compatibility code to this package, the following shell script is useful for extracting the version number from a git commit SHA:
If you're adding additional compatibility code to this package, the [`bin/version.sh` script is useful for extracting the version number from a git commit SHA. For example, from the git repository of `julia`, run something like this:

```sh
#! /bin/bash
last_tag=$(git describe --tags --abbrev=0)
git rev-list $1 ^$last_tag | wc -l | sed -e 's/[^[:digit:]]//g'
bash $ /path/to/Compat/bin/version.sh e3aa57efbc6542efbcc7feac9b1309d628ac6f12
2418
```
This will print a number `XXXX`, and you can then test whether Julia

This prints a number `XXXX`, and you can then test whether Julia
is at least this version by `VERSION >= v"0.4.0-dev+XXXX"` (assuming
it is a commit from the 0.4 development cycle).
4 changes: 4 additions & 0 deletions bin/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
last_tag=$(git describe --tags --abbrev=0)
echo -n "0.4.0-dev+"
git rev-list $1 ^$last_tag | wc -l | sed -e 's/[^[:digit:]]//g'

0 comments on commit 66e962e

Please sign in to comment.