summaryrefslogtreecommitdiff
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
parentae6336b6173bf5303fad53e0a52a16f92c47b6b7 (diff)
parent6b43a57dfce1e5acd85f7a8365c080b6fc4f8645 (diff)
Merge branch 'ob/strip-comments-on-commit'
* ob/strip-comments-on-commit: git-gui: heed core.commentChar/commentString
Diffstat (limited to 'lib/commit.tcl')
-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