[PATCH 1/2] dim: Escape double quotes for extract-tags

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Apr 29 16:51:02 UTC 2021


On Thu, Apr 29, 2021 at 12:54:47PM +0300, Jani Nikula wrote:
> On Fri, 15 Jan 2021, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > Trying to suck in a Fixes tag doesn't work currently due to the
> > double quotes contained within. Escape those so the shell stuff
> > doesn't get confused and we get the expected results.
> 
> Stumbled on this one, fell through the cracks.
> 
> Pushed both, thanks, and sorry for the delay.

No worries. Totally forgot about these myself.


> BR,
> Jani.
> 
> 
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> >  dim | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/dim b/dim
> > index 01bba3129be4..b335ae44e64f 100755
> > --- a/dim
> > +++ b/dim
> > @@ -1734,6 +1734,11 @@ function rangeish()
> >  	fi
> >  }
> >  
> > +function escape_quotes
> > +{
> > +	sed 's/"/\\"/g'
> > +}
> > +
> >  function dim_extract_tags
> >  {
> >  	local branch range file tags
> > @@ -1755,7 +1760,7 @@ function dim_extract_tags
> >  		return 0
> >  	fi
> >  
> > -	tags=$(printf -- "$dim_extract_tags_marker\n%s" "$tags")
> > +	tags=$(printf -- "$dim_extract_tags_marker\n%s" "$tags" | escape_quotes)
> >  
> >  	git filter-branch -f --msg-filter "cat ; echo \"$tags\"" $range
> >  }
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 
Ville Syrjälä
Intel


More information about the dim-tools mailing list