diff options
author | Johannes Sixt <j6t@kdbg.org> | 2025-04-20 09:27:22 +0200 |
---|---|---|
committer | Johannes Sixt <j6t@kdbg.org> | 2025-04-20 09:27:22 +0200 |
commit | 2a7d4f2f078a8a10f866c723765c2f1c4f76d448 (patch) | |
tree | 10d54bc374227789528a2279054b8b12c39a7724 /lib/commit.tcl | |
parent | ae6336b6173bf5303fad53e0a52a16f92c47b6b7 (diff) | |
parent | 6b43a57dfce1e5acd85f7a8365c080b6fc4f8645 (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.tcl | 4 |
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 |