Re: [PATCH 2/3] stripspace: Implement --count-lines option

2015-10-17 Thread Tobias Klauser
On 2015-10-16 at 19:35:49 +0200, Junio C Hamano wrote: > Tobias Klauser writes: > > >> So this is your output code, which gives only the number of lines > >> without the cleaned up result. > > > > This should better be a simple printf("%zu\n", lines) I guess? > > I think we actively avoid using

Re: [PATCH 2/3] stripspace: Implement --count-lines option

2015-10-16 Thread Junio C Hamano
Tobias Klauser writes: >> So this is your output code, which gives only the number of lines >> without the cleaned up result. > > This should better be a simple printf("%zu\n", lines) I guess? I think we actively avoid using %z conversion that is only C99. If you really want to, you could count

Re: [PATCH 2/3] stripspace: Implement --count-lines option

2015-10-16 Thread Matthieu Moy
Tobias Klauser writes: > On 2015-10-15 at 18:52:54 +0200, Matthieu Moy > wrote: >> Tobias Klauser writes: >> > +static const char * const usage_msg[] = { >> >> Stick the * to usage_msg please. > > Just noticed while looking at how other sub-commands define this, the vast > majority use "const

Re: [PATCH 2/3] stripspace: Implement --count-lines option

2015-10-16 Thread Tobias Klauser
On 2015-10-15 at 18:52:54 +0200, Matthieu Moy wrote: > Tobias Klauser writes: > > +static const char * const usage_msg[] = { > > Stick the * to usage_msg please. Just noticed while looking at how other sub-commands define this, the vast majority use "const char * const" and not "const char con

Re: [PATCH 2/3] stripspace: Implement --count-lines option

2015-10-16 Thread Tobias Klauser
On 2015-10-15 at 21:21:53 +0200, Matthieu Moy wrote: > Tobias Klauser writes: > > > + * comments are considered contents to be removed or not. Returns the > > + * number of lines in the resulting buffer. > > We write comments at imperative tone, hence "Return", not "Returns". The other commen

Re: [PATCH 2/3] stripspace: Implement --count-lines option

2015-10-16 Thread Tobias Klauser
On 2015-10-15 at 19:58:26 +0200, Junio C Hamano wrote: > Tobias Klauser writes: > > > diff --git a/Documentation/git-stripspace.txt > > b/Documentation/git-stripspace.txt > > index 60328d5..411e17c 100644 > > --- a/Documentation/git-stripspace.txt > > +++ b/Documentation/git-stripspace.txt > >

Re: [PATCH 2/3] stripspace: Implement --count-lines option

2015-10-16 Thread Tobias Klauser
On 2015-10-15 at 18:52:54 +0200, Matthieu Moy wrote: > Tobias Klauser writes: > > > --- a/Documentation/git-stripspace.txt > > +++ b/Documentation/git-stripspace.txt > > @@ -9,7 +9,7 @@ git-stripspace - Remove unnecessary whitespace > > SYNOPSIS > > > > [verse] > > -'git stripspace'

Re: [PATCH 2/3] stripspace: Implement --count-lines option

2015-10-15 Thread Matthieu Moy
Tobias Klauser writes: > + * comments are considered contents to be removed or not. Returns the > + * number of lines in the resulting buffer. We write comments at imperative tone, hence "Return", not "Returns". Other than that, I agree with Junio: * A preparatory patch introducing parse-optio

Re: [PATCH 2/3] stripspace: Implement --count-lines option

2015-10-15 Thread Junio C Hamano
Tobias Klauser writes: > diff --git a/Documentation/git-stripspace.txt > b/Documentation/git-stripspace.txt > index 60328d5..411e17c 100644 > --- a/Documentation/git-stripspace.txt > +++ b/Documentation/git-stripspace.txt > @@ -9,7 +9,7 @@ git-stripspace - Remove unnecessary whitespace > SYNOPS

Re: [PATCH 2/3] stripspace: Implement --count-lines option

2015-10-15 Thread Matthieu Moy
Tobias Klauser writes: > --- a/Documentation/git-stripspace.txt > +++ b/Documentation/git-stripspace.txt > @@ -9,7 +9,7 @@ git-stripspace - Remove unnecessary whitespace > SYNOPSIS > > [verse] > -'git stripspace' [-s | --strip-comments] < input > +'git stripspace' [-s | --strip-commen

[PATCH 2/3] stripspace: Implement --count-lines option

2015-10-15 Thread Tobias Klauser
As suggested in the small project ideas [1], implement a --count-lines options for git stripspace to be able to omit calling git stripspace --strip-comments < infile | wc -l e.g. in git-rebase--interactive.sh. The above command can now be replaced by: git stripspace --strip-comments --count-