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 {} {
880
880
color::sync_with_theme
881
881
}
882
882
}
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
+ }
883
889
}
884
890
885
891
set default_config(branch.autosetupmerge) true
@@ -890,6 +896,8 @@ set default_config(merge.summary) false
890
896
set default_config(merge.verbosity) 2
891
897
set default_config(user.name) {}
892
898
set default_config(user.email) {}
899
+ set default_config(core.commentchar) " #"
900
+ set default_config(core.commentstring) {}
893
901
894
902
set default_config(gui.encoding) [encoding system]
895
903
set 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.
211
211
# Strip trailing whitespace
212
212
regsub -all -line {[ \t\r]+$} $msg {} msg
213
213
# 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
215
217
# Strip leading empty lines
216
218
regsub {^\n*} $msg {} msg
217
219
# Compress consecutive empty lines
You can’t perform that action at this time.
0 commit comments