mirror of
https://github.com/git/git.git
synced 2026-01-12 05:43:12 +09:00
Merge branch 'ob/strip-comments-on-commit'
* ob/strip-comments-on-commit: git-gui: heed core.commentChar/commentString
This commit is contained in:
commit
2a7d4f2f07
@ -880,6 +880,12 @@ proc apply_config {} {
|
||||
color::sync_with_theme
|
||||
}
|
||||
}
|
||||
|
||||
global comment_string
|
||||
set comment_string [get_config core.commentstring]
|
||||
if {$comment_string eq {}} {
|
||||
set comment_string [get_config core.commentchar]
|
||||
}
|
||||
}
|
||||
|
||||
set default_config(branch.autosetupmerge) true
|
||||
@ -890,6 +896,8 @@ set default_config(merge.summary) false
|
||||
set default_config(merge.verbosity) 2
|
||||
set default_config(user.name) {}
|
||||
set default_config(user.email) {}
|
||||
set default_config(core.commentchar) "#"
|
||||
set default_config(core.commentstring) {}
|
||||
|
||||
set default_config(gui.encoding) [encoding system]
|
||||
set default_config(gui.matchtrackingbranch) false
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user