aboutsummaryrefslogtreecommitdiffstats
path: root/lib/commit.tcl
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2025-04-20 09:27:22 +0200
committerJohannes Sixt <j6t@kdbg.org>2025-04-20 09:27:22 +0200
commit2a7d4f2f078a8a10f866c723765c2f1c4f76d448 (patch)
tree10d54bc374227789528a2279054b8b12c39a7724 /lib/commit.tcl
parentMerge branch 'as/translations-bg' (diff)
parentgit-gui: heed core.commentChar/commentString (diff)
downloadgit-2a7d4f2f078a8a10f866c723765c2f1c4f76d448.tar.gz
git-2a7d4f2f078a8a10f866c723765c2f1c4f76d448.zip
Merge branch 'ob/strip-comments-on-commit'
* ob/strip-comments-on-commit: git-gui: heed core.commentChar/commentString
Diffstat (limited to '')
-rw-r--r--lib/commit.tcl4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/commit.tcl b/lib/commit.tcl
index 208dc2817c..a570f9cdc6 100644
--- a/lib/commit.tcl
+++ b/lib/commit.tcl
@@ -211,7 +211,9 @@ You must stage at least 1 file before you can commit.
# Strip trailing whitespace
regsub -all -line {[ \t\r]+$} $msg {} msg
# Strip comment lines
- regsub -all {(^|\n)#[^\n]*} $msg {\1} msg
+ global comment_string
+ set cmt_rx [strcat {(^|\n)} [regsub -all {\W} $comment_string {\\&}] {[^\n]*}]
+ regsub -all $cmt_rx $msg {\1} msg
# Strip leading empty lines
regsub {^\n*} $msg {} msg
# Compress consecutive empty lines