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

Ville Syrjala ville.syrjala at linux.intel.com
Fri Jan 15 17:01:51 UTC 2021


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.

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
 }
-- 
2.26.2



More information about the dim-tools mailing list