Skip to content

Commit 9091737

Browse files
committed
* https://github.com/prati0100/git-gui: git-gui: remove lines starting with the comment character git-gui: fix typo in russian locale
2 parents c0b27e3 + b1056f6 commit 9091737

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

git-gui/git-gui.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ set default_config(merge.summary) false
875875
set default_config(merge.verbosity) 2
876876
set default_config(user.name) {}
877877
set default_config(user.email) {}
878+
set default_config(core.commentchar) "#"
878879
879880
set default_config(gui.encoding) [encoding system]
880881
set default_config(gui.matchtrackingbranch) false
@@ -3436,6 +3437,10 @@ proc trace_commit_type {varname args} {
34363437
merge {set txt [mc "Merge Commit Message:"]}
34373438
* {set txt [mc "Commit Message:"]}
34383439
}
3440+
3441+
set comment_char [get_config core.commentchar]
3442+
set txt [string cat $txt \
3443+
[mc " (Lines starting with '$comment_char' will be ignored)"]]
34393444
$ui_coml conf -text $txt
34403445
}
34413446
trace add variable commit_type write trace_commit_type

git-gui/lib/commit.tcl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,20 @@ proc setup_commit_encoding {msg_wt {quiet 0}} {
141141
}
142142
}
143143

144+
proc strip_msg {msg} {
145+
set cmd [concat [list | ] [_git_cmd stripspace] --strip-comments]
146+
_trace_exec $cmd
147+
set fd [open $cmd r+]
148+
fconfigure $fd -translation binary -encoding utf-8
149+
150+
puts -nonewline $fd $msg
151+
close $fd w
152+
set result [read $fd]
153+
close $fd
154+
155+
return $result
156+
}
157+
144158
proc commit_tree {} {
145159
global HEAD commit_type file_states ui_comm repo_config
146160
global pch_error
@@ -207,8 +221,8 @@ You must stage at least 1 file before you can commit.
207221

208222
# -- A message is required.
209223
#
210-
set msg [string trim [$ui_comm get 1.0 end]]
211-
regsub -all -line {[ \t\r]+$} $msg {} msg
224+
set msg [strip_msg [$ui_comm get 1.0 end]]
225+
212226
if {$msg eq {}} {
213227
error_popup [mc "Please supply a commit message.
214228

git-gui/po/ru.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ msgstr "Добавить изменённые файлы в индекс"
331331

332332
#: git-gui.sh:2936
333333
msgid "Unstage From Commit"
334-
msgstr "Убрать из издекса"
334+
msgstr "Убрать из индекса"
335335

336336
#: git-gui.sh:2942 lib/index.tcl:521
337337
msgid "Revert Changes"

0 commit comments

Comments
 (0)