Re: [PATCH v3 4/5] format-patch: teach --no-base

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

 



René Scharfe <l.s.r@xxxxxx> writes:

> Clearing the global variable base_auto feels unclean to me, as does the
> introduction of a callback for that purpose.  Why not set base_commit
> after reading the config and before parsing command line options to
> reflect base_auto?  That would achieve the intended precedence in a
> simpler way, something like this:

Nice.


>
> diff --git a/builtin/log.c b/builtin/log.c
> index a26f223ab4..af1b0d0209 100644
> --- a/builtin/log.c
> +++ b/builtin/log.c
> @@ -1714,6 +1714,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
>  		rev.mime_boundary = default_attach;
>  		rev.no_inline = 1;
>  	}
> +	if (base_auto)
> +		base_commit = "auto";
>
>  	/*
>  	 * Parse the arguments before setup_revisions(), or something
> @@ -1973,7 +1975,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
>  	}
>
>  	memset(&bases, 0, sizeof(bases));
> -	if (base_commit || base_auto) {
> +	if (base_commit) {
>  		struct commit *base = get_base_commit(base_commit, list, nr);
>  		reset_revision_walk();
>  		clear_object_flags(UNINTERESTING);




[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]

  Powered by Linux