Merge https://github.com/prati0100/git-gui · bsmr/git---git@fe47c9c · GitHub
Skip to content

Commit fe47c9c

Browse files
committed
* https://github.com/prati0100/git-gui: git-gui: allow opening currently selected file in default app git-gui: allow closing console window with Escape git gui: fix branch name encoding error git-gui: revert untracked files by deleting them git-gui: update status bar to track operations git-gui: consolidate naming conventions
2 parents 042ed3e + 0d2116c commit fe47c9c

10 files changed

Lines changed: 920 additions & 232 deletions

File tree

git-gui/git-gui.sh

Lines changed: 42 additions & 19 deletions

git-gui/lib/blame.tcl

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ field w_cviewer ; # pane showing commit message
2424
field finder ; # find mini-dialog frame
2525
field gotoline ; # line goto mini-dialog frame
2626
field status ; # status mega-widget instance
27+
field status_operation ; # operation displayed by status mega-widget
2728
field old_height ; # last known height of $w.file_pane
2829

2930

@@ -274,6 +275,7 @@ constructor new {i_commit i_path i_jump} {
274275
pack $w_cviewer -expand 1 -fill both
275276

276277
set status [::status_bar::new $w.status]
278+
set status_operation {}
277279

278280
menu $w.ctxm -tearoff 0
279281
$w.ctxm add command \
@@ -602,16 +604,23 @@ method _exec_blame {cur_w cur_d options cur_s} {
602604
} else {
603605
lappend options $commit
604606
}
607+
608+
# We may recurse in from another call to _exec_blame and already have
609+
# a status operation.
610+
if {$status_operation == {}} {
611+
set status_operation [$status start \
612+
$cur_s \
613+
[mc "lines annotated"]]
614+
} else {
615+
$status_operation restart $cur_s
616+
}
617+
605618
lappend options -- $path
606619
set fd [eval git_read --nice blame $options]
607620
fconfigure $fd -blocking 0 -translation lf -encoding utf-8
608621
fileevent $fd readable [cb _read_blame $fd $cur_w $cur_d]
609622
set current_fd $fd
610623
set blame_lines 0
611-
612-
$status start \
613-
$cur_s \
614-
[mc "lines annotated"]
615624
}
616625

617626
method _read_blame {fd cur_w cur_d} {
@@ -806,10 +815,11 @@ method _read_blame {fd cur_w cur_d} {
806815
[mc "Loading original location annotations..."]
807816
} else {
808817
set current_fd {}
809-
$status stop [mc "Annotation complete."]
818+
$status_operation stop [mc "Annotation complete."]
819+
set status_operation {}
810820
}
811821
} else {
812-
$status update $blame_lines $total_lines
822+
$status_operation update $blame_lines $total_lines
813823
}
814824
} ifdeleted { catch {close $fd} }
815825

@@ -1124,7 +1134,7 @@ method _blameparent {} {
11241134
set diffcmd [list diff-tree --unified=0 $cparent $cmit -- $new_path]
11251135
}
11261136
if {[catch {set fd [eval git_read $diffcmd]} err]} {
1127-
$status stop [mc "Unable to display parent"]
1137+
$status_operation stop [mc "Unable to display parent"]
11281138
error_popup [strcat [mc "Error loading diff:"] "\n\n$err"]
11291139
return
11301140
}

git-gui/lib/branch.tcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ proc load_all_heads {} {
88
set rh_len [expr {[string length $rh] + 1}]
99
set all_heads [list]
1010
set fd [git_read for-each-ref --format=%(refname) $rh]
11+
fconfigure $fd -translation binary -encoding utf-8
1112
while {[gets $fd line] > 0} {
1213
if {!$some_heads_tracking || ![is_tracking_branch $line]} {
1314
lappend all_heads [string range $line $rh_len end]
@@ -24,6 +25,7 @@ proc load_all_tags {} {
2425
--sort=-taggerdate \
2526
--format=%(refname) \
2627
refs/tags]
28+
fconfigure $fd -translation binary -encoding utf-8
2729
while {[gets $fd line] > 0} {
2830
if {![regsub ^refs/tags/ $line {} name]} continue
2931
lappend all_tags $name

git-gui/lib/checkout_op.tcl

Lines changed: 8 additions & 7 deletions

0 commit comments

Comments
 (0)