File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -880,6 +880,12 @@ proc apply_config {} {
880880 color::sync_with_theme
881881 }
882882 }
883+
884+ global comment_string
885+ set comment_string [get_config core.commentstring]
886+ if {$comment_string eq {}} {
887+ set comment_string [get_config core.commentchar]
888+ }
883889}
884890
885891set default_config(branch.autosetupmerge) true
@@ -890,6 +896,8 @@ set default_config(merge.summary) false
890896set default_config(merge.verbosity) 2
891897set default_config(user.name) {}
892898set default_config(user.email) {}
899+ set default_config(core.commentchar) " #"
900+ set default_config(core.commentstring) {}
893901
894902set default_config(gui.encoding) [encoding system]
895903set default_config(gui.matchtrackingbranch) false
Original file line number Diff line number Diff line change @@ -211,7 +211,9 @@ You must stage at least 1 file before you can commit.
211211 # Strip trailing whitespace
212212 regsub -all -line {[ \t\r]+$} $msg {} msg
213213 # Strip comment lines
214- regsub -all {(^|\n)#[^\n]*} $msg {\1} msg
214+ global comment_string
215+ set cmt_rx [strcat {(^|\n )} [regsub -all {\W} $comment_string {\\&}] {[^\n ]*}]
216+ regsub -all $cmt_rx $msg {\1} msg
215217 # Strip leading empty lines
216218 regsub {^\n*} $msg {} msg
217219 # Compress consecutive empty lines
You can’t perform that action at this time.
0 commit comments