From d5f6b1d756a29255efedee3cb6e8526aedcfeb00 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 2 Jul 2012 12:43:05 -0700 Subject: revision.c: the "log" family, except for "show", takes committish Add a field to setup_revision_opt structure and allow these callers to tell the setup_revisions command parsing machinery that short SHA1 it encounters are meant to name committish. This step does not go all the way to connect the setup_revisions() to sha1_name.c yet. Signed-off-by: Junio C Hamano --- builtin/log.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'builtin/log.c') diff --git a/builtin/log.c b/builtin/log.c index 7d1f6f88a..9363f3929 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -363,6 +363,7 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix) rev.simplify_history = 0; memset(&opt, 0, sizeof(opt)); opt.def = "HEAD"; + opt.revarg_opt = REVARG_COMMITTISH; cmd_log_init(argc, argv, prefix, &rev, &opt); if (!rev.diffopt.output_format) rev.diffopt.output_format = DIFF_FORMAT_RAW; @@ -543,6 +544,7 @@ int cmd_log(int argc, const char **argv, const char *prefix) rev.always_show_header = 1; memset(&opt, 0, sizeof(opt)); opt.def = "HEAD"; + opt.revarg_opt = REVARG_COMMITTISH; cmd_log_init(argc, argv, prefix, &rev, &opt); return cmd_log_walk(&rev); } @@ -1144,6 +1146,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) rev.subject_prefix = fmt_patch_subject_prefix; memset(&s_r_opt, 0, sizeof(s_r_opt)); s_r_opt.def = "HEAD"; + s_r_opt.revarg_opt = REVARG_COMMITTISH; if (default_attach) { rev.mime_boundary = default_attach; -- cgit v1.2.1