diff options
author | Junio C Hamano <gitster@pobox.com> | 2025-05-09 13:14:36 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-05-09 13:14:36 -0700 |
commit | c6a20717bb5286cc140e1818d150f293bed5631b (patch) | |
tree | 366ffca741a51319fca50f9193885942ec6fab68 /git-gui/lib/commit.tcl | |
parent | 1ee85f0e215f22b0878d0ad4b2445d12bbb63887 (diff) | |
parent | 309bb874dcba2c96f8b12d20bed16cf6a1ea0133 (diff) |
Merge branch 'master' of https://github.com/j6t/git-gui
* 'master' of https://github.com/j6t/git-gui:
git-gui: treat the message template file as a built file
git-gui: heed core.commentChar/commentString
git-gui: po/README: update repository location and maintainer
Diffstat (limited to 'git-gui/lib/commit.tcl')
-rw-r--r-- | git-gui/lib/commit.tcl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl index 208dc2817c..a570f9cdc6 100644 --- a/git-gui/lib/commit.tcl +++ b/git-gui/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 |