summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-02-22 21:50:10 +0100
committerJunio C Hamano <junkio@cox.net>2007-02-22 20:59:55 -0800
commitd516c2d11945cf13ed3d961fa63817c60b7a566b (patch)
tree7d9aa00054be3a60e6ababc94aa0ccaa573b768f /git.c
parentf5a92647694f18fb3544060a1a964ac082d072b2 (diff)
downloadgit-d516c2d11945cf13ed3d961fa63817c60b7a566b.tar.gz
Teach git-diff-files the new option `--no-index`
With this flag and given two paths, git-diff-files behaves as a GNU diff lookalike (plus the git goodies like --check, colour, etc.). This flag is also available in git-diff. It also works outside of a git repository. In addition, if git-diff{,-files} is called without revision or stage parameter, and with exactly two paths at least one of which is not tracked, the default is --no-index. So, you can now say git diff /etc/inittab /etc/fstab and it actually works! This also unifies the duplicated argument parsing between cmd_diff_files() and builtin_diff_files(). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git.c')
-rw-r--r--git.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/git.c b/git.c
index 4dd196721f..79fc73ca46 100644
--- a/git.c
+++ b/git.c
@@ -237,8 +237,8 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
{ "config", cmd_config },
{ "count-objects", cmd_count_objects, RUN_SETUP },
{ "describe", cmd_describe, RUN_SETUP },
- { "diff", cmd_diff, RUN_SETUP | USE_PAGER },
- { "diff-files", cmd_diff_files, RUN_SETUP },
+ { "diff", cmd_diff, USE_PAGER },
+ { "diff-files", cmd_diff_files },
{ "diff-index", cmd_diff_index, RUN_SETUP },
{ "diff-tree", cmd_diff_tree, RUN_SETUP },
{ "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP },