Исправление рег. выражения чтения файлов командой git status

This commit is contained in:
svkalinin 2022-11-14 11:13:38 +03:00
parent 779173d5d5
commit 0582a20115

View File

@ -120,6 +120,7 @@ namespace eval Git {
proc Status {} { proc Status {} {
global cfgVariables activeProject global cfgVariables activeProject
cd $activeProject
set cmd exec set cmd exec
lappend cmd $cfgVariables(gitCommand) lappend cmd $cfgVariables(gitCommand)
lappend cmd "status" lappend cmd "status"
@ -127,6 +128,7 @@ namespace eval Git {
lappend cmd "--" lappend cmd "--"
lappend cmd $activeProject lappend cmd $activeProject
catch $cmd pipe catch $cmd pipe
puts $cmd
if [regexp -nocase -- {^fatal:} $pipe match] { if [regexp -nocase -- {^fatal:} $pipe match] {
return return
} }
@ -605,9 +607,9 @@ namespace eval Git {
# Git repo status # Git repo status
foreach { word } [Git::Status] { foreach { word } [Git::Status] {
# puts $word puts $word
if [regexp -nocase -- {([\w\s])([\s\w?]+)\s../(.+?)} $word match v1 v2 fileName] { if [regexp -nocase -- {([\w\s\?])([\s\w\\*\?]+)\s(.+?)} $word match v1 v2 fileName] {
# puts "$v1 $v2 $fileName" puts "$v1 $v2 $fileName"
# $fr.unindexed.t delete 1.0 end # $fr.unindexed.t delete 1.0 end
if {$v1 ne " "} { if {$v1 ne " "} {
$fr.body.lCommit insert end $fileName $fr.body.lCommit insert end $fileName
@ -625,7 +627,8 @@ namespace eval Git {
Git::DialogUpdate $Git::fr Git::DialogUpdate $Git::fr
} }
bind $fr.body.lBox <Return> "Git::CommitAdd $fr" bind $fr.body.lBox <Return> "Git::CommitAdd $fr"
bind $fr.body.lBox <Double-Button-1> "catch {Git::CommitAdd $fr; $fr.body.t delete 0.0 end; $fr.body.tCommit delete 0.0 end}" bind $fr.body.lBox <Double-Button-1> \
"catch {Git::CommitAdd $fr; $fr.body.t delete 0.0 end; $fr.body.tCommit delete 0.0 end}"
bind $fr.body.lBox <Button-1><ButtonRelease-1> "Git::ListBoxPress $fr" bind $fr.body.lBox <Button-1><ButtonRelease-1> "Git::ListBoxPress $fr"
bind $fr.body.lBox <KeyRelease> "Git::Key %K $fr" bind $fr.body.lBox <KeyRelease> "Git::Key %K $fr"