]> Kevux Git Server - rit/commit
git-gui: pass redirections as separate argument to _open_stdout_stderr
authorJohannes Sixt <j6t@kdbg.org>
Sun, 4 May 2025 13:06:11 +0000 (15:06 +0200)
committerTaylor Blau <me@ttaylorr.com>
Fri, 23 May 2025 21:04:24 +0000 (17:04 -0400)
commit1e0a93c3d35c84547b21ba704a9c4383d4360140
tree8ebeef719c054857e841116948e92b6d0e7c135d
parentdc9ecb1aab1a3438fceeb44db67ddf8e8d938324
git-gui: pass redirections as separate argument to _open_stdout_stderr

We are going to treat command arguments and redirections differently to
avoid passing arguments that look like redirections to the command
accidentally. To do so, it will be necessary to know which arguments
are intentional redirections. Rewrite direct callers of
_open_stdout_stderr to pass intentional redirections as a second
(optional) argument.

Passing arbitrary arguments is not safe right now, but we rename it
to safe_open_command anyway to avoid having to touch the call sites
again later when we make it actually safe.

We cannot make the function safe right away because one caller is
git_read, which does not yet know which of its arguments are
redirections. This is the topic of the next commit.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
git-gui.sh
lib/console.tcl
lib/mergetool.tcl
lib/sshkey.tcl
lib/tools.tcl