diff options
author | Linus Torvalds <torvalds@osdl.org> | 2006-04-15 12:09:56 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-04-15 18:17:15 -0700 |
commit | c5ccd8be43df4b916752a176512a9adaf3b94df9 (patch) | |
tree | 3ef3a9fab0d77d258d59c53e01835573cece389c /git.c | |
parent | Built-in git-whatchanged (diff) | |
download | tgif-c5ccd8be43df4b916752a176512a9adaf3b94df9.tar.xz |
Tentative built-in "git show"
This uses the "--no-walk" flag that I never actually implemented (but I'm
sure I mentioned it) to make "git show" be essentially the same thing as
"git whatchanged --no-walk".
It just refuses to add more interesting parents to the revision walking
history, so you don't actually get any history, you just get the commit
you asked for.
I was going to add "--no-walk" as a real argument flag to git-rev-list
too, but I'm not sure anybody actually needs it. Although it might be
useful for porcelain, so I left the door open.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -363,6 +363,20 @@ static int cmd_whatchanged(int ac, const char **av, char **ep) return cmd_log_wc(ac, av, ep, &wcopt); } +static int cmd_show(int ac, const char **av, char **ep) +{ + struct whatchanged_opt wcopt; + + memset(&wcopt, 0, sizeof(wcopt)); + wcopt.do_diff = 1; + init_log_tree_opt(&wcopt.logopt); + wcopt.logopt.ignore_merges = 0; + wcopt.logopt.combine_merges = 1; + wcopt.logopt.dense_combined_merges = 1; + wcopt.logopt.diffopt.recursive = 1; + return cmd_log_wc(ac, av, ep, &wcopt); +} + static void handle_internal_command(int argc, const char **argv, char **envp) { const char *cmd = argv[0]; @@ -373,6 +387,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp) { "version", cmd_version }, { "help", cmd_help }, { "log", cmd_log }, + { "show", cmd_show }, { "whatchanged", cmd_whatchanged }, }; int i; |