Re: [PATCH v2] log: Handle new repository case.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Leila Muhtasib <muhtasib@xxxxxxxxx> writes:

> @@ -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?

> @@ -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?

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]