Commit Graph

24 Commits (1634461bd208f4bd108ea5c3d3f1cf9eb56d4a7e)

Author SHA1 Message Date
Magnus Kroken 289f2a8ce3 scripts/getver.sh: append short git hash based on upstream commit
The short git hash suffix printed by getver.sh is taken from the
latest local commit, change this to use the hash from latest
upstream commit if available. This is considered the intended
behavior based on commit message a642a11fac,
introducing getver.sh.

Signed-off-by: Magnus Kroken <mkroken@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich a642a11fac scripts: getver.sh: append Git short hash to revision
Change getver.sh to append a short Git commit hash to the end of the artifical
revision number. This way we still have order- and comparable commit numbers
but also a direct relation to the Git commit.

The new output format will look like "r2400+2-882472e" for dirty trees or like
"r2402-882472e" for clean ones.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Rafał Miłecki bf3d92f0cd scripts/getver.sh: treat all commits as local if can't find upstream
If something goes wrong and script can't find upstream revision it will
return something like:
r2220
which looks like a valid upstream revision 2220. We cant' distinguish it
from e.g. 2200 upstream commits and 20 local ones.

The new format still provides revision number but also points clearly
that is may be not the upstream one:
r0+2220

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: John Crispin < john@phrozen.org>
8 years ago
Jonas Gorski efdd3bf5fb scripts/getver.sh: fix older git versions from printing stuff to stdout
Older git versions seem output the original argument to stdout if there
is no upstream, presumably because they try to do things with it
internally. This can be prevented by passing --verify to it, which
should be safe on newer git versions.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Felix Fietkau 7ed215437c scripts/getver.sh: stop relying on the reboot tag
It may not be present when cloning a staging tree or another fork

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jonas Gorski 6f86d2e2ab scripts/getver.sh: fix one more wc -l call
The revision to hash conversion was missed when fixing up the script.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski 4eb5aad667 scripts/getver.sh: try to get branch/upstream automatically
Instead of assuming master is the current branch and origin the right
upstream, try to get both dynamically. If the current branch is not
tracking any upstream, use the origin of the master branch.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Felix Fietkau c19381dfca scripts/getver.sh: fix revision number on BSD/MacOS
Strip leading whitespace from wc -l output

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jonas Gorski f1765277ba scripts/getver.sh: avoid use of git rev-list --count
This is not a valid option in older git version, used in e.g. RHEL6.

Reported-by: Steven Haigh <netwiz@crc.id.au>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski 15b88df87f scripts/getver.sh: improve revision output
Change the revision output to r<upstream-revision>+<local commits> so
it is easier to get the base revision (and see if there are local
commits).

Example:
$ ./scripts/getver.sh
r794+3
$

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski 1001b5d77c scripts/getver.sh: allow conversion between git hash and revision
Add code allowing easy conversion between git commit ids and revisions.

Example:

$ ./scripts/getver.sh
r792
$ ./scripts/getver.sh r123
b7fc892eb5
$ ./scrpts/getver.sh b7fc892eb5
r123

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski 575be9d182 scripts/getver.sh: simplify revision calculation
Use git rev-list --count to get the revision number.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
John Crispin 797fb8a302 scripts: add "r" to revision
343c3be454 accidentially removed the "r"

Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin fa69553900 branding: add LEDE branding
Signed-off-by: John Crispin <blogic@openwrt.org>
8 years ago
John Crispin 343c3be454 scripts/getver.sh: generate revision relative to the reboot tag
Signed-off-by: John Crispin <blogic@openwrt.org>
8 years ago
Vasilis Tsiligiannis b09848cd25 scripts/getver.sh: Use 'git-rev-parse' to detect if tree lies in Git repository
Path to the Git repository directory can be overriden by using the '$GIT_DIR'
environment variable. This patch improves detection of Git repository by using
'git-rev-parse', which respects '$GIT_DIR' environment variable, instead of just
checking the existence of '.git' directory.

Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>

SVN-Revision: 49165
8 years ago
John Crispin 59acb0b8f4 scripts: fix getver git dir check
Git internals are referenced by .git which isn't necessarily a
directory. It may also be a file that references the actual .git
directory using the gitdir directive.

If .git is assumed to be a directory the build will not be able to get
the correct version when openwrt is included as a git submodule because
when used as a submodule .git will actually be a file referencing to a
subdirectory in the parent's git dir.

When the correct version is not detected some image generation tools
will fail because the OpenWrt string will be 'OpenWrtunknown' which is
too long for some header formats.

Signed-off-by: Felix Kaechele <heffer@fedoraproject.org>

SVN-Revision: 44452
9 years ago
Jo-Philipp Wich ad6c4198a9 getver.sh: cope with varying "git log" line formats to reliably extract the git-svn rev (#10268)
SVN-Revision: 28604
13 years ago
Nicolas Thill 0aeed7e525 getver: don't use "-r COMMITTED" arg which needs network access to the repository, use the "Last Changed Rev:" line instead
SVN-Revision: 17864
15 years ago
Nicolas Thill 6fa03d63d4 getver: get svn rev from last commit so that we have consistent revision numbers between git and svn
SVN-Revision: 17781
15 years ago
Felix Fietkau cbb9a14d8a add hg support to getver.sh (patch from #5763)
SVN-Revision: 17432
15 years ago
Felix Fietkau d58dd061fe some more s/git-/git /
SVN-Revision: 12380
16 years ago
Florian Fainelli 6588e58b88 Also export LC_ALL to C to work properly (#2926)
SVN-Revision: 10059
17 years ago
Felix Fietkau 51996a78f1 clean up openwrt version handling, use a separate script that is executed at the beginning of the build process, fix revision checking with git
SVN-Revision: 9723
17 years ago