]> git.ipfire.org Git - thirdparty/git.git/commit
gitk: have callers of diffcmd supply pipe symbol when necessary
authorJohannes Sixt <j6t@kdbg.org>
Mon, 17 Mar 2025 20:39:58 +0000 (21:39 +0100)
committerTaylor Blau <me@ttaylorr.com>
Fri, 23 May 2025 21:03:30 +0000 (17:03 -0400)
commit6eb797f5d1d8885c0f08e42cc5291c11be6f11a4
tree4ae955be1e876cfd514beb9d9dd0a4bf86ba8ef7
parentb966b738e1923badc788b9111cc81653b50ff164
gitk: have callers of diffcmd supply pipe symbol when necessary

Function 'diffcmd' derives which of git diff-files, git diff-index, or
git diff-tree must be invoked depending on the ids provided. It puts
the pipe symbol as the first element of the returned command list.

Note though that of the four callers only two use the command with
Tcl 'open' and need the pipe symbol. The other two callers pass the
command to Tcl 'exec' and must remove the pipe symbol.

Do not include the pipe symbol in the constructed command list, but let
the call sites decide whether to add it or not. Note that Tcl 'open'
inspects only the first character of the command list, which is also
the first character of the first element in the list. For this reason,
it is valid to just tack on the pipe symbol with |$cmd and it is not
necessary to use [concat | $cmd].

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
gitk