]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-gui: remove option --stderr from git_read
authorJohannes Sixt <j6t@kdbg.org>
Sat, 3 May 2025 09:52:35 +0000 (11:52 +0200)
committerTaylor Blau <me@ttaylorr.com>
Fri, 23 May 2025 21:04:23 +0000 (17:04 -0400)
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>
git-gui.sh
lib/checkout_op.tcl
lib/choose_repository.tcl
lib/console.tcl
lib/merge.tcl

index 6ecddfdd0afb6cdc3657f757d6d420f79a6d4771..890a172fc49b335372ecd06a25c6b5d49957a277 100755 (executable)
@@ -651,10 +651,6 @@ proc git_read {args} {
                        _lappend_nice opt
                }
 
-               --stderr {
-                       lappend args 2>@1
-               }
-
                default {
                        break
                }
index 5f7011078abbcf96a61e30eb1049c1b4d0a26a43..31992f461bc8892f55d937935ed13a0ad51469d9 100644 (file)
@@ -345,13 +345,14 @@ method _readtree {} {
                [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]
index ef7ad7c1750a97d7aee25dec67ac833a8f742e91..7bd738e51e0a9ede23f37b179b84e580cd809808 100644 (file)
@@ -953,12 +953,13 @@ method _do_clone_checkout {HEAD} {
                [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]
index bb6b9c889e20a31ce836582c1c412d8603df2212..c7f20b87cbf4bbeef760b66e6f96cbec3e28cebd 100644 (file)
@@ -91,10 +91,10 @@ method _init {} {
 }
 
 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
index 897dc2a286b8b8aa8715e3f64d475f0650428a37..e97c91eab67ae2392a1c6bd4a7cddd78b585c6e5 100644 (file)
@@ -239,7 +239,7 @@ Continue with resetting the current changes?"]
        }
 
        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 \