Re: add --match argument to git-version-gen

2012-07-11 Thread Jim Meyering
Andy Wingo wrote: > On Sat 07 Jul 2012 22:42, Jim Meyering writes: > >>> - --prefix prefix of git tags (default 'v') >>> + --prefix prefix of git tags to strip from version (default 'v') >>> + --match pattern for git tags to match >> >> Please mention that it's a "glob" pa

Re: add --match argument to git-version-gen

2012-07-10 Thread Andy Wingo
On Sat 07 Jul 2012 22:42, Jim Meyering writes: >> - --prefix prefix of git tags (default 'v') >> + --prefix prefix of git tags to strip from version (default 'v') >> + --match pattern for git tags to match > > Please mention that it's a "glob" pattern, > so people don't t

Re: add --match argument to git-version-gen

2012-07-09 Thread Eric Blake
On 07/07/2012 02:42 PM, Jim Meyering wrote: >> +function massage_git_version() { >> +local v=$1 > > Using the "function" and "local" keywords would make this script > fail for some older shells. I'd like to remain portable to those. Not just older shells. POSIX does not require either 'fun

Re: add --match argument to git-version-gen

2012-07-07 Thread Stefano Lattarini
On 07/07/2012 10:42 PM, Jim Meyering wrote: > Andy Wingo wrote: > ... >> +function massage_git_version() { >> +local v=$1 > > Using the "function" and "local" keywords would make this script > fail for some older shells. > With the "function" keyword, even recent ones: $ dpkg -l dash ...

Re: add --match argument to git-version-gen

2012-07-07 Thread Jim Meyering
Andy Wingo wrote: > On Fri 06 Jul 2012 17:45, Jim Meyering writes: > >> How about writing a function -- with description similar to the comments >> you've added below -- and doing something like the following? >> Then we should be able to avoid that duplication. >> >> elif test "`git log -1 --

Re: add --match argument to git-version-gen

2012-07-06 Thread Andy Wingo
On Fri 06 Jul 2012 17:45, Jim Meyering writes: > How about writing a function -- with description similar to the comments > you've added below -- and doing something like the following? > Then we should be able to avoid that duplication. > > elif test "`git log -1 --pretty=format:x . 2>&1`" =

Re: add --match argument to git-version-gen

2012-07-06 Thread Jim Meyering
Andy Wingo wrote: > On Fri 06 Jul 2012 16:32, Jim Meyering writes: > >> It'd be nice to say "why" this change is useful. >> At worst, just refer to the URL for this mailing list thread. > > OK. > >> Protecting against envvars by those names is a good idea. >> That's a fix that merits mention in th

Re: add --match argument to git-version-gen

2012-07-06 Thread Andy Wingo
Hi Jim, On Fri 06 Jul 2012 16:32, Jim Meyering writes: > It'd be nice to say "why" this change is useful. > At worst, just refer to the URL for this mailing list thread. OK. > Protecting against envvars by those names is a good idea. > That's a fix that merits mention in the ChangeLog, if not

Re: add --match argument to git-version-gen

2012-07-06 Thread Jim Meyering
Andy Wingo wrote: > On Fri 06 Jul 2012 15:56, Stefano Lattarini > writes: > >> On 07/06/2012 03:53 PM, Andy Wingo wrote: >>> >>> @@ -121,6 +126,9 @@ if test -z "$tarball_version_file"; then >>> exit 1 >>> fi >>> >>> +echo $match >>> >> Huh? Forgotten debugging code perhaps? >> >>> +match=

Re: add --match argument to git-version-gen

2012-07-06 Thread Andy Wingo
On Fri 06 Jul 2012 15:56, Stefano Lattarini writes: > On 07/06/2012 03:53 PM, Andy Wingo wrote: >> >> @@ -121,6 +126,9 @@ if test -z "$tarball_version_file"; then >> exit 1 >> fi >> >> +echo $match >> > Huh? Forgotten debugging code perhaps? > >> +match="${match:-$prefix\*}" >> +echo $mat

Re: add --match argument to git-version-gen

2012-07-06 Thread Stefano Lattarini
On 07/06/2012 03:53 PM, Andy Wingo wrote: > > @@ -121,6 +126,9 @@ if test -z "$tarball_version_file"; then > exit 1 > fi > > +echo $match > Huh? Forgotten debugging code perhaps? > +match="${match:-$prefix\*}" > +echo $match > Likewise. > tag_sed_script="${tag_sed_script:-s/x/x/}" > > nl=