summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2008-06-16 13:41:56 +0200
committerGuido Guenther <agx@sigxcpu.org>2008-06-16 13:41:56 +0200
commit063fab51b5f08cb42b3fa03241c434ed90a2d336 (patch)
tree38e0bd170f0a3900795e452a938f4cd363022bf0
parent6008c37c20674e922811ab83b68ccac0a87bd834 (diff)
escape $s in commit messages
so variable names like $remote_fs don't get dropped silently. Closes: #486447
-rwxr-xr-xgit-dch6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-dch b/git-dch
index 147c9b36..74c41540 100755
--- a/git-dch
+++ b/git-dch
@@ -40,9 +40,13 @@ def system(cmd):
raise GbpError
+def escape_commit(msg):
+ return msg.replace('"','\\\"').replace("$","\$")
+
+
def add_changelog_entry(msg, author, email):
"add aa single changelog entry"
- cmd = """DEBFULLNAME="%s" DEBEMAIL="%s" dch --no-auto-nmu --append -- "%s" """ % (author, email, msg.replace('"','\\\"'))
+ cmd = """DEBFULLNAME="%s" DEBEMAIL="%s" dch --no-auto-nmu --append -- "%s" """ % (author, email, escape_commit(msg))
system(cmd)