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 <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
_lappend_nice opt
}
- --stderr {
- lappend args 2>@1
- }
-
default {
break
}
[mc "Updating working directory to '%s'..." [_name $this]] \
[mc "files checked out"]]
- set fd [git_read --stderr read-tree \
+ set fd [git_read read-tree \
-m \
-u \
-v \
--exclude-per-directory=.gitignore \
$HEAD \
$new_hash \
+ 2>@1 \
]
fconfigure $fd -blocking 0 -translation binary
fileevent $fd readable [cb _readtree_wait $fd $status_bar_operation]
[mc "files"]]
set readtree_err {}
- set fd [git_read --stderr read-tree \
+ set fd [git_read read-tree \
-m \
-u \
-v \
HEAD \
HEAD \
+ 2>@1 \
]
fconfigure $fd -blocking 0 -translation binary
fileevent $fd readable [cb _readtree_wait $fd]
}
method exec {cmd {after {}}} {
+ lappend cmd 2>@1
if {[lindex $cmd 0] eq {git}} {
- set fd_f [eval git_read --stderr [lrange $cmd 1 end]]
+ set fd_f [eval git_read [lrange $cmd 1 end]]
} else {
- lappend cmd 2>@1
set fd_f [_open_stdout_stderr $cmd]
}
fconfigure $fd_f -blocking 0 -translation binary
}
if {[ask_popup $op_question] eq {yes}} {
- set fd [git_read --stderr read-tree --reset -u -v HEAD]
+ set fd [git_read read-tree --reset -u -v HEAD 2>@1]
fconfigure $fd -blocking 0 -translation binary
set status_bar_operation [$::main_status \
start \