diff mbox series

[02/11] doc: doc-diff: allow more than one flag

Message ID 20210514121435.504423-3-felipe.contreras@gmail.com (mailing list archive)
State Superseded
Headers show
Series doc: asciidoctor: direct man page creation and fixes | expand

Commit Message

Felipe Contreras May 14, 2021, 12:14 p.m. UTC
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Documentation/doc-diff | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jeff King May 15, 2021, 9:37 a.m. UTC | #1
On Fri, May 14, 2021 at 07:14:26AM -0500, Felipe Contreras wrote:

> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  Documentation/doc-diff | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/doc-diff b/Documentation/doc-diff
> index 1694300e50..ecd88b0524 100755
> --- a/Documentation/doc-diff
> +++ b/Documentation/doc-diff
> @@ -146,7 +146,7 @@ render_tree () {
>  	# through.
>  	oid=$1 &&
>  	dname=$2 &&
> -	makemanflags=$3 &&
> +	makemanflags="$3" &&

This line does nothing; the shell won't split whitespace here either
way.

> @@ -181,6 +181,6 @@ render_tree () {
>  	fi
>  }
>  
> -render_tree $from_oid $from_dir $from_makemanflags &&
> -render_tree $to_oid $to_dir $to_makemanflags &&
> +render_tree $from_oid $from_dir "$from_makemanflags" &&
> +render_tree $to_oid $to_dir "$to_makemanflags" &&

This part is necessary (and sufficient).

It would be nice to mention in the commit message why the use of
$makemanflags in render_tree must remain unquoted (as I did in mine when
I made the same change).

-Peff
Felipe Contreras May 15, 2021, 12:11 p.m. UTC | #2
Jeff King wrote:
> On Fri, May 14, 2021 at 07:14:26AM -0500, Felipe Contreras wrote:
> 
> > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> > ---
> >  Documentation/doc-diff | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Documentation/doc-diff b/Documentation/doc-diff
> > index 1694300e50..ecd88b0524 100755
> > --- a/Documentation/doc-diff
> > +++ b/Documentation/doc-diff
> > @@ -146,7 +146,7 @@ render_tree () {
> >  	# through.
> >  	oid=$1 &&
> >  	dname=$2 &&
> > -	makemanflags=$3 &&
> > +	makemanflags="$3" &&
> 
> This line does nothing; the shell won't split whitespace here either
> way.

Right.

> > @@ -181,6 +181,6 @@ render_tree () {
> >  	fi
> >  }
> >  
> > -render_tree $from_oid $from_dir $from_makemanflags &&
> > -render_tree $to_oid $to_dir $to_makemanflags &&
> > +render_tree $from_oid $from_dir "$from_makemanflags" &&
> > +render_tree $to_oid $to_dir "$to_makemanflags" &&
> 
> This part is necessary (and sufficient).
> 
> It would be nice to mention in the commit message why the use of
> $makemanflags in render_tree must remain unquoted (as I did in mine when
> I made the same change).

Ahh, I didn't see exactly how you implemented it. Now I see it's very
similar.
diff mbox series

Patch

diff --git a/Documentation/doc-diff b/Documentation/doc-diff
index 1694300e50..ecd88b0524 100755
--- a/Documentation/doc-diff
+++ b/Documentation/doc-diff
@@ -146,7 +146,7 @@  render_tree () {
 	# through.
 	oid=$1 &&
 	dname=$2 &&
-	makemanflags=$3 &&
+	makemanflags="$3" &&
 	if ! test -d "$tmp/installed/$dname"
 	then
 		git -C "$tmp/worktree" checkout --detach "$oid" &&
@@ -181,6 +181,6 @@  render_tree () {
 	fi
 }
 
-render_tree $from_oid $from_dir $from_makemanflags &&
-render_tree $to_oid $to_dir $to_makemanflags &&
+render_tree $from_oid $from_dir "$from_makemanflags" &&
+render_tree $to_oid $to_dir "$to_makemanflags" &&
 git -C $tmp/rendered diff --no-index "$@" $from_dir $to_dir