diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-07-12 14:14:51 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-12 14:14:51 -0700 |
commit | b9dcf846e20ed5287e239c9a0942c5d150081bab (patch) | |
tree | d6a6ae6c6240ac014f47c32e9ecf09b0c50c2dab /git-gui/lib/diff.tcl | |
parent | 237ce836e770e8ead12a14ee4a8170009fa4a40b (diff) | |
parent | b215883de9322b8b475a04b4768d6ba5455373d1 (diff) | |
download | git-b9dcf846e20ed5287e239c9a0942c5d150081bab.tar.gz |
Merge commit 'git-gui/master'
* commit 'git-gui/master': (36 commits)
git-gui: Change prior tree SHA-1 verification to use git_read
git-gui: Include a space in Cygwin shortcut command lines
git-gui: Use sh.exe in Cygwin shortcuts
git-gui: Paper bag fix for Cygwin shortcut creation
git-gui: Improve the Windows and Mac OS X shortcut creators
git-gui: Teach console widget to use git_read
git-gui: Perform our own magic shbang detection on Windows
git-gui: Treat `git version` as `git --version`
git-gui: Assume unfound commands are known by git wrapper
git-gui: Correct gitk installation location
git-gui: Always use absolute path to all git executables
git-gui: Show a progress meter for checking out files
git-gui: Change the main window progress bar to use status_bar
git-gui: Extract blame viewer status bar into mega-widget
git-gui: Allow double-click in checkout dialog to start checkout
git-gui: Default selection to first matching ref
git-gui: Unabbreviate commit SHA-1s prior to display
git-gui: Refactor branch switch to support detached head
git-gui: Refactor our ui_status_value update technique
git-gui: Better handling of detached HEAD
...
Diffstat (limited to 'git-gui/lib/diff.tcl')
-rw-r--r-- | git-gui/lib/diff.tcl | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl index 29436b50cb..9cb9d0604a 100644 --- a/git-gui/lib/diff.tcl +++ b/git-gui/lib/diff.tcl @@ -17,7 +17,7 @@ proc clear_diff {} { } proc reshow_diff {} { - global ui_status_value file_states file_lists + global file_states file_lists global current_diff_path current_diff_side set p $current_diff_path @@ -49,13 +49,13 @@ A rescan will be automatically started to find other files which may have the sa clear_diff display_file $path __ - rescan {set ui_status_value {Ready.}} 0 + rescan ui_ready 0 } proc show_diff {path w {lno {}}} { global file_states file_lists global is_3way_diff diff_active repo_config - global ui_diff ui_status_value ui_index ui_workdir + global ui_diff ui_index ui_workdir global current_diff_path current_diff_side current_diff_header if {$diff_active || ![lock_index read]} return @@ -78,7 +78,7 @@ proc show_diff {path w {lno {}}} { set current_diff_path $path set current_diff_side $w set current_diff_header {} - set ui_status_value "Loading diff of [escape_path $path]..." + ui_status "Loading diff of [escape_path $path]..." # - Git won't give us the diff, there's nothing to compare to! # @@ -92,7 +92,7 @@ proc show_diff {path w {lno {}}} { } err ]} { set diff_active 0 unlock_index - set ui_status_value "Unable to display [escape_path $path]" + ui_status "Unable to display [escape_path $path]" error_popup "Error loading file:\n\n$err" return } @@ -127,11 +127,11 @@ proc show_diff {path w {lno {}}} { $ui_diff conf -state disabled set diff_active 0 unlock_index - set ui_status_value {Ready.} + ui_ready return } - set cmd [list | git] + set cmd [list] if {$w eq $ui_index} { lappend cmd diff-index lappend cmd --cached @@ -154,10 +154,10 @@ proc show_diff {path w {lno {}}} { lappend cmd -- lappend cmd $path - if {[catch {set fd [open $cmd r]} err]} { + if {[catch {set fd [eval git_read --nice $cmd]} err]} { set diff_active 0 unlock_index - set ui_status_value "Unable to display [escape_path $path]" + ui_status "Unable to display [escape_path $path]" error_popup "Error loading diff:\n\n$err" return } @@ -170,7 +170,7 @@ proc show_diff {path w {lno {}}} { } proc read_diff {fd} { - global ui_diff ui_status_value diff_active + global ui_diff diff_active global is_3way_diff current_diff_header $ui_diff conf -state normal @@ -256,7 +256,7 @@ proc read_diff {fd} { close $fd set diff_active 0 unlock_index - set ui_status_value {Ready.} + ui_ready if {[$ui_diff index end] eq {2.0}} { handle_empty_diff @@ -271,7 +271,7 @@ proc apply_hunk {x y} { if {$current_diff_path eq {} || $current_diff_header eq {}} return if {![lock_index apply_hunk]} return - set apply_cmd {git apply --cached --whitespace=nowarn} + set apply_cmd {apply --cached --whitespace=nowarn} set mi [lindex $file_states($current_diff_path) 0] if {$current_diff_side eq $ui_index} { set mode unstage @@ -301,7 +301,7 @@ proc apply_hunk {x y} { } if {[catch { - set p [open "| $apply_cmd" w] + set p [eval git_write $apply_cmd] fconfigure $p -translation binary -encoding binary puts -nonewline $p $current_diff_header puts -nonewline $p [$ui_diff get $s_lno $e_lno] |