summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorLibravatar Linus Torvalds <torvalds@osdl.org>2006-04-15 12:09:56 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-04-16 00:13:38 -0700
commitba1d45051e050cbcf68ccccacea86a4b6ecde731 (patch)
tree1c2d22f50d2dd5a78f8626d5ec5f19f5e8cc651f /git.c
parentBuilt-in git-whatchanged. (diff)
downloadtgif-ba1d45051e050cbcf68ccccacea86a4b6ecde731.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. [jc: ported to the unified option structure by Linus] 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.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/git.c b/git.c
index 9a89b0afbd..9e29ade2b4 100644
--- a/git.c
+++ b/git.c
@@ -354,6 +354,23 @@ static int cmd_wc(int argc, const char **argv, char **envp)
return cmd_log_wc(argc, argv, envp, &rev);
}
+static int cmd_show(int argc, const char **argv, char **envp)
+{
+ struct rev_info rev;
+
+ init_revisions(&rev);
+ rev.diff = 1;
+ rev.ignore_merges = 0;
+ rev.combine_merges = 1;
+ rev.dense_combined_merges = 1;
+ rev.abbrev = DEFAULT_ABBREV;
+ rev.commit_format = CMIT_FMT_DEFAULT;
+ rev.diffopt.recursive = 1;
+ rev.no_walk = 1;
+ argc = setup_revisions(argc, argv, &rev, "HEAD");
+ return cmd_log_wc(argc, argv, envp, &rev);
+}
+
static int cmd_log(int argc, const char **argv, char **envp)
{
struct rev_info rev;
@@ -377,6 +394,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
{ "help", cmd_help },
{ "log", cmd_log },
{ "whatchanged", cmd_wc },
+ { "show", cmd_show },
};
int i;