Re: [PATCH v2] log: Handle new repository case.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 25, 2012, 23:13 UTC
- Message-ID
- <7vobo7dlyl.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1340664813-96891-1-git-send-email-muhtasib@gmail.com>
Leila Muhtasib <muhtasib@gmail.com> writes:
Show 13 quoted lines
> @@ -553,8 +562,13 @@ int cmd_log(int argc, const char **argv, const char *prefix) > init_revisions(&rev, prefix); > rev.always_show_header = 1; > memset(&opt, 0, sizeof(opt)); > - opt.def = "HEAD"; > + opt.def = default_to_head_if_exists(); > + > cmd_log_init(argc, argv, prefix, &rev, &opt); > + > + if (!opt.def && !rev.cmdline.nr) > + return 0; > + > return cmd_log_walk(&rev);
Do you even need these four new lines if you do not error out? Doesn't log_walk() return successfully if there is nothing in the queue anyway?
Show 6 quoted lines
> @@ -1128,7 +1142,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) > DIFF_OPT_SET(&rev.diffopt, RECURSIVE); > rev.subject_prefix = fmt_patch_subject_prefix; > memset(&s_r_opt, 0, sizeof(s_r_opt)); > - s_r_opt.def = "HEAD"; > + s_r_opt.def = default_to_head_if_exists();
I didn't think about other commands, but I do not think format-patch wants to silently succeed without doing anything---it is definitely a user error, no?