2 * Builtin "git log" and related commands (show, whatchanged)
4 * (C) Copyright 2006 Linus Torvalds
13 static int cmd_log_wc(int argc
, const char **argv
, char **envp
,
16 struct commit
*commit
;
18 rev
->abbrev
= DEFAULT_ABBREV
;
19 rev
->commit_format
= CMIT_FMT_DEFAULT
;
20 rev
->verbose_header
= 1;
21 argc
= setup_revisions(argc
, argv
, rev
, "HEAD");
24 die("unrecognized argument: %s", argv
[1]);
26 prepare_revision_walk(rev
);
28 while ((commit
= get_revision(rev
)) != NULL
) {
29 log_tree_commit(rev
, commit
);
31 commit
->buffer
= NULL
;
36 int cmd_whatchanged(int argc
, const char **argv
, char **envp
)
42 rev
.diffopt
.recursive
= 1;
43 return cmd_log_wc(argc
, argv
, envp
, &rev
);
46 int cmd_show(int argc
, const char **argv
, char **envp
)
52 rev
.diffopt
.recursive
= 1;
53 rev
.combine_merges
= 1;
54 rev
.dense_combined_merges
= 1;
55 rev
.always_show_header
= 1;
56 rev
.ignore_merges
= 0;
58 return cmd_log_wc(argc
, argv
, envp
, &rev
);
61 int cmd_log(int argc
, const char **argv
, char **envp
)
66 rev
.always_show_header
= 1;
67 rev
.diffopt
.recursive
= 1;
68 return cmd_log_wc(argc
, argv
, envp
, &rev
);