[Git-commits] [grml/grml-debootstrap] b04707: Fix git version detection when executing in foreig...

Michael Prokop noreply at github.com
Thu Jun 24 19:26:50 CEST 2021


  Branch: refs/heads/master
  Home:   https://github.com/grml/grml-debootstrap
  Commit: b047071ec58b5367cbac179fc94e47a3d69f3ec8
      https://github.com/grml/grml-debootstrap/commit/b047071ec58b5367cbac179fc94e47a3d69f3ec8
  Author: Michael Prokop <mika at grml.org>
  Date:   2021-06-24 (Thu, 24 Jun 2021)

  Changed paths:
    M grml-debootstrap

  Log Message:
  -----------
  Fix git version detection when executing in foreign git repository

When the working directory is a foreign git repository (other than
grml-debootstrap.git), and grml-debootstrap is invoked with the full
path pointing towards grml-debootstrap.git, then we're relying on `git
describe` output of the other (foreign) repository, which is failing and
reporting an unknown version.

Demonstration:

| % cd "$(mktemp -d)"
| % git init
| Initialized empty Git repository in /tmp/tmp.2TQO7PZPQX/.git/
| % ~/src/grml/grml-debootstrap/grml-debootstrap --version
| fatal: No names found, cannot describe anything.
|  * grml-debootstrap - version unknown
|  * Report bugs via https://github.com/grml/grml-debootstrap/ or https://grml.org/bugs/

... and also:

| % cd "$(mktemp -d)"
| % git init
| Initialized empty Git repository in /tmp/tmp.Y15j7wMMOn/.git/
| % echo foo > foo
| % git add foo ; git commit -m 'foo'
| [main (root-commit) 5d4357c] foo
|  1 file changed, 1 insertion(+)
|  create mode 100644 foo
| % git tag 0.42
| % ~/src/grml/grml-debootstrap/grml-debootstrap --version
| fatal: No annotated tags can describe '5d4357c0b5bb504e610265904619287be2c6718d'.
| However, there were unannotated tags: try --tags.
|  * grml-debootstrap - version unknown
|  * Report bugs via https://github.com/grml/grml-debootstrap/ or https://grml.org/bugs/

Thanks: Paul Menzel for the bugreport
Closes: grml/grml-debootstrap#183




More information about the Git-commits mailing list