diff options
author | Zoltan Klinger <zoltan.klinger@gmail.com> | 2013-12-06 10:38:46 +1100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-06 14:00:27 -0800 |
commit | ee7fb0b1d433cbb433d2ed5cd9d8738023836b27 (patch) | |
tree | 52298ded5e44caa1686cf3a636fb16cfebb7c630 /Documentation/git.txt | |
parent | d2446dfd7f3b3f8948142cfb07a0270e2497d93f (diff) | |
download | git-ee7fb0b1d433cbb433d2ed5cd9d8738023836b27.tar.gz git-ee7fb0b1d433cbb433d2ed5cd9d8738023836b27.tar.xz |
difftool: display the number of files in the diff queue in the prompt
When --prompt option is set, git-difftool displays a prompt for each
modified file to be viewed in an external diff program. At that
point, it could be useful to display a counter and the total number
of files in the diff queue.
Below is the current difftool prompt for the first of 5 modified files:
Viewing: 'diff.c'
Launch 'vimdiff' [Y/n]:
Consider the modified prompt:
Viewing (1/5): 'diff.c'
Launch 'vimdiff' [Y/n]:
The current GIT_EXTERNAL_DIFF mechanism does not tell the number of
paths in the diff queue nor the current counter. To make this
"counter/total" info available for GIT_EXTERNAL_DIFF programs
without breaking existing ones by doing the following:
- Keep track of the number of paths shown so far in diff_options;
- Export two new environment variables from run_external_diff() to
show the total number of paths (from diff_queue_struct) and the
current value of the counter (from diff_options); and
- Update git-difftool--helper to use these two environment variables.
Signed-off-by: Zoltan Klinger <zoltan.klinger@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git.txt')
-rw-r--r-- | Documentation/git.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/git.txt b/Documentation/git.txt index b73a24a3c..25b9002be 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -804,6 +804,15 @@ temporary file --- it is removed when 'GIT_EXTERNAL_DIFF' exits. + For a path that is unmerged, 'GIT_EXTERNAL_DIFF' is called with 1 parameter, <path>. ++ +For each path 'GIT_EXTERNAL_DIFF' is called, two environment variables, +'GIT_DIFF_PATH_COUNTER' and 'GIT_DIFF_PATH_TOTAL' are set. + +'GIT_DIFF_PATH_COUNTER':: + A 1-based counter incremented by one for every path. + +'GIT_DIFF_PATH_TOTAL':: + The total number of paths. other ~~~~~ |