bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue of 'gitlog-to-changelog' due to 'git rev-parse'


From: Stefan Vargyas
Subject: Issue of 'gitlog-to-changelog' due to 'git rev-parse'
Date: Mon, 4 Jul 2016 01:55:12 -0700

Dear maintainers,

While using gnulib's gitlog-to-changelog perl script, I came
across the following issue it has:

Older versions of 'git rev-parse' does not have the command
line option `--show-toplevel'. In this case the perl script
fails badly, as shown by the sequence of commands below:

  $ mkdir -v /tmp/foo
  mkdir: created directory `/tmp/foo'

  $ (cd /tmp/foo && git init)
  Initialized empty Git repository in /tmp/foo/.git/

  $ gitlog-to-changelog --srcdir=/tmp/foo
  fatal: Not a git repository: '--show-toplevel/.git'
  gitlog-to-changelog: error closing pipe from git \
'--git-dir=--show-toplevel/.git' log --log-size  \
'--pretty=format:%H:%ct  %an  <%ae>%n%n%s%n%b%n'

This boils down to 'git rev-parse' not returning an error
condition when passed to it the option `--show-toplevel'
which it does not know (for example in case of git version
1.6.0.2):

  $ git rev-parse --help|grep -e --show-toplevel -c
  0

  $ rm -rf /tmp/foo
  $ mkdir -v /tmp/foo
  mkdir: created directory `/tmp/foo'

  $ git-rev-parse() { (cd /tmp/foo && git rev-parse "$@" ; echo $?); }

  $ git-rev-parse --show-toplevel
  fatal: Not a git repository
  128
  $ git-rev-parse --git-dir
  fatal: Not a git repository
  128

  $ (cd /tmp/foo && git init)
  Initialized empty Git repository in /tmp/foo/.git/

  $ git-rev-parse --show-toplevel
  --show-toplevel
  0
  $ git-rev-parse --git-dir
  .git 
  0

  $ rm -rf /tmp/foo
  $ mkdir -v /tmp/foo
  mkdir: created directory `/tmp/foo'
  $ (cd /tmp/foo && git init --bare)
  Initialized empty Git repository in /tmp/foo/

  $ git-rev-parse --show-toplevel
  --show-toplevel
  0
  $ git-rev-parse --git-dir
  .
  0

Fixing the perl script was immediate: use `--git-dir' instead
of the potentially not implemented `--show-toplevel'. Please
see the patch file attached.

Sincerely,

Stefan Vargyas.


Attachment: gitlog-to-changelog.patch.gz
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]