Skip to content

Commit 23ba432

Browse files
j6tttaylorr
authored andcommitted
git-gui: remove option --stderr from git_read
Some callers of git_read want to redirect stderr of the invoked command to stdout. The function offers option --stderr for this purpose. However, the option only appends 2>@1 to the commands. The callers can do that themselves. In lib/console.tcl we even have a caller that already knew implictly what --stderr does behind the scenes. This is a preparation for a later change where we want to make git_read non-variadic. Then it cannot have optional leading arguments. Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent e883ceb commit 23ba432

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

git-gui.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,10 +651,6 @@ proc git_read {args} {
651651
_lappend_nice opt
652652
}
653653

654-
--stderr {
655-
lappend args 2>@1
656-
}
657-
658654
default {
659655
break
660656
}

lib/checkout_op.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,14 @@ method _readtree {} {
345345
[mc "Updating working directory to '%s'..." [_name $this]] \
346346
[mc "files checked out"]]
347347

348-
set fd [git_read --stderr read-tree \
348+
set fd [git_read read-tree \
349349
-m \
350350
-u \
351351
-v \
352352
--exclude-per-directory=.gitignore \
353353
$HEAD \
354354
$new_hash \
355+
2>@1 \
355356
]
356357
fconfigure $fd -blocking 0 -translation binary
357358
fileevent $fd readable [cb _readtree_wait $fd $status_bar_operation]

lib/choose_repository.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,12 +953,13 @@ method _do_clone_checkout {HEAD} {
953953
[mc "files"]]
954954

955955
set readtree_err {}
956-
set fd [git_read --stderr read-tree \
956+
set fd [git_read read-tree \
957957
-m \
958958
-u \
959959
-v \
960960
HEAD \
961961
HEAD \
962+
2>@1 \
962963
]
963964
fconfigure $fd -blocking 0 -translation binary
964965
fileevent $fd readable [cb _readtree_wait $fd]

lib/console.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ method _init {} {
9191
}
9292

9393
method exec {cmd {after {}}} {
94+
lappend cmd 2>@1
9495
if {[lindex $cmd 0] eq {git}} {
95-
set fd_f [eval git_read --stderr [lrange $cmd 1 end]]
96+
set fd_f [eval git_read [lrange $cmd 1 end]]
9697
} else {
97-
lappend cmd 2>@1
9898
set fd_f [_open_stdout_stderr $cmd]
9999
}
100100
fconfigure $fd_f -blocking 0 -translation binary

lib/merge.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Continue with resetting the current changes?"]
239239
}
240240

241241
if {[ask_popup $op_question] eq {yes}} {
242-
set fd [git_read --stderr read-tree --reset -u -v HEAD]
242+
set fd [git_read read-tree --reset -u -v HEAD 2>@1]
243243
fconfigure $fd -blocking 0 -translation binary
244244
set status_bar_operation [$::main_status \
245245
start \

0 commit comments

Comments
 (0)