Skip to contentSkip to conversation

RFC: Shouldn't "./linux --version" always print the the git commit id

uml-devel Toralf Förster 3 participants 6 messages Oct 25, 2013 – Nov 6, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Just realized today the fact, that v3.11 reports just the tag and not "tag-g<commit id>"

I'm wondering about the reason to use "git describe" in favor of "git describe --long" ?

Signature · 14 lines
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#1 lore raw

Hi Toralf,

Quoted 2 lines · Toralf Förster

Just realized today the fact, that v3.11 reports just the tag and not "tag-g<commit id>"

You don't have CONFIG_LOCALVERSION_AUTO=y in your .config?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw
Quoted 10 lines · Geert Uytterhoeven

Hi Toralf,

Quoted 2 lines · Toralf Förster

Just realized today the fact, that v3.11 reports just the tag and not "tag-g<commit id>"

You don't have CONFIG_LOCALVERSION_AUTO=y in your .config?

Gr{oetje,eeting}s,

I do :
tfoerste@n22 ~/devel/linux $ ./linux --showconfig | grep AUTO CONFIG_LOCALVERSION_AUTO=y

pls look here :

$ ./linux --version
3.11.0-00001-g65984ff-dirty

versus

$ git checkout HEAD~1
Previous HEAD position was 65984ff... um: hostfs: Fix writeback
HEAD is now at 6e46645... Linux 3.11
$ make -j4 ARCH=um CC="ccache gcc"
...
$ ./linux --version
3.11.0

which correlates to

$ git describe
v3.11
$ git describe --long
v3.11-0-g6e46645
Quoted 9 lines

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

Signature · 3 lines
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3
#3 lore raw
Quoted 4 lines · Toralf Förster
Quoted 3 lines · Geert Uytterhoeven
Quoted 2 lines · Toralf Förster

Just realized today the fact, that v3.11 reports just the tag and not "tag-g<commit id>"

Actually it's "<tag>-<number>-<commit id>", with <number> indicating the number of commits on top of the tag.

Quoted 21 lines
Quoted 5 lines

You don't have CONFIG_LOCALVERSION_AUTO=y in your .config?

Gr{oetje,eeting}s,

I do :
tfoerste@n22 ~/devel/linux $ ./linux --showconfig | grep AUTO CONFIG_LOCALVERSION_AUTO=y

pls look here :

$ ./linux --version
3.11.0-00001-g65984ff-dirty

versus

$ git checkout HEAD~1
Previous HEAD position was 65984ff... um: hostfs: Fix writeback
HEAD is now at 6e46645... Linux 3.11
Quoted 5 lines
$ make -j4 ARCH=um CC="ccache gcc"
...
$ ./linux --version
3.11.0

If there are no additional commits on top of the tag, no number and commit ID are printed. I guess the rationale is that tags are global, hence present in all clones, so there's no need to tell what commit ID the tag corresponds to.

Quoted 7 lines

which correlates to

$ git describe
v3.11
$ git describe --long
v3.11-0-g6e46645

This is not UML-specific. If you want to change this, you have to involve the kbuild people (CC added).

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#4 lore raw
Quoted 49 lines · Geert Uytterhoeven
Quoted 4 lines · Toralf Förster
Quoted 3 lines · Geert Uytterhoeven
Quoted 2 lines · Toralf Förster

Just realized today the fact, that v3.11 reports just the tag and not "tag-g<commit id>"

Actually it's "<tag>-<number>-<commit id>", with <number> indicating the number of commits on top of the tag.

Quoted 21 lines
Quoted 5 lines

You don't have CONFIG_LOCALVERSION_AUTO=y in your .config?

Gr{oetje,eeting}s,

I do :
tfoerste@n22 ~/devel/linux $ ./linux --showconfig | grep AUTO CONFIG_LOCALVERSION_AUTO=y

pls look here :

$ ./linux --version
3.11.0-00001-g65984ff-dirty

versus

$ git checkout HEAD~1
Previous HEAD position was 65984ff... um: hostfs: Fix writeback
HEAD is now at 6e46645... Linux 3.11
Quoted 5 lines
$ make -j4 ARCH=um CC="ccache gcc"
...
$ ./linux --version
3.11.0

If there are no additional commits on top of the tag, no number and commit ID are printed. I guess the rationale is that tags are global, hence present in all clones, so there's no need to tell what commit ID the tag corresponds to.

Quoted 7 lines

which correlates to

$ git describe
v3.11
$ git describe --long
v3.11-0-g6e46645
Quoted 6 lines

This is not UML-specific. If you want to change this, you have to involve the kbuild people (CC added).

Gr{oetje,eeting}s,

Geert

Well, the reationale behind my idea comes from the (stupid) logic of one of my bisect scripts. I used there the commit id derived from the UML linux exe as a suffix for gdb back trace files created during the bisect process.
Sure - logic can be easily adapted and was in the mean while. But IMO it would be more stringent to have always the commit id presented in the version string for similar cases.

Quoted 7 lines

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

Signature · 3 lines
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3
#5 lore raw

Dne 26.10.2013 12:06, Toralf Förster napsal(a):

Quoted 21 lines · Geert Uytterhoeven
Quoted 11 lines · Toralf Förster
Quoted 2 lines
$ ./linux --version
3.11.0

If there are no additional commits on top of the tag, no number and commit ID are printed. I guess the rationale is that tags are global, hence present in all clones, so there's no need to tell what commit ID the tag corresponds to.

Quoted 2 lines

which correlates to

Quoted 9 lines
Quoted 5 lines
$ git describe
v3.11
$ git describe --long
v3.11-0-g6e46645

This is not UML-specific. If you want to change this, you have to involve the kbuild people (CC added).

Quoted 7 lines

Well, the reationale behind my idea comes from the (stupid) logic of one of my bisect scripts. I used there the commit id derived from the UML linux exe as a suffix for gdb back trace files created during the bisect process.
Sure - logic can be easily adapted and was in the mean while. But IMO it would be more stringent to have always the commit id presented in the version string for similar cases.

You define your own versioning scheme if you build with CONFIG_LOCALVERSION_AUTO=n and define LOCALVERSION yourself. E.g.

echo "-g$(git rev-parse --short HEAD)" >localversion-git

or set it in kconfig or on the make commandline.

Michal