diff options
author | Alex Riesen <alexander.riesen@cetitec.com> | 2016-06-28 10:57:42 +0200 |
---|---|---|
committer | Pat Thoyts <patthoyts@users.sourceforge.net> | 2016-10-03 23:27:14 +0100 |
commit | 52d196af6a5cb8441028914876a60ecec6c464e7 (patch) | |
tree | 1d6cd160d07b67048b1c9ac04c439ee286976166 | |
parent | af465c0c28d2b299c08613e97d6df0ec23d86fbb (diff) | |
download | git-52d196af6a5cb8441028914876a60ecec6c464e7.tar.gz git-52d196af6a5cb8441028914876a60ecec6c464e7.tar.xz |
git-gui: support for $FILENAMES in tool definitions
This adds a FILENAMES environment variable, which contains the repository
pathnames of all selected files the list.
The variable contains the names separated by LF (\n, \x0a).
If the file names contain LF characters, the tool command might be unable to
unambiguously split the value of $FILENAME into the separate names.
Note that the file marked and diffed immediately after starting the GUI up,
is not actually selected. One must click on it once to really select it.
Signed-off-by: Alex Riesen <alexander.riesen@cetitec.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
-rw-r--r-- | lib/tools.tcl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/tools.tcl b/lib/tools.tcl index 6ec94113d..413f1a170 100644 --- a/lib/tools.tcl +++ b/lib/tools.tcl @@ -69,6 +69,7 @@ proc tools_populate_one {fullname} { proc tools_exec {fullname} { global repo_config env current_diff_path global current_branch is_detached + global selected_paths if {[is_config_true "guitool.$fullname.needsfile"]} { if {$current_diff_path eq {}} { @@ -100,6 +101,7 @@ proc tools_exec {fullname} { set env(GIT_GUITOOL) $fullname set env(FILENAME) $current_diff_path + set env(FILENAMES) [join [array names selected_paths] \n] if {$is_detached} { set env(CUR_BRANCH) "" } else { @@ -121,6 +123,7 @@ proc tools_exec {fullname} { unset env(GIT_GUITOOL) unset env(FILENAME) + unset env(FILENAMES) unset env(CUR_BRANCH) catch { unset env(ARGS) } catch { unset env(REVISION) } |