Re: [PATCH v2 3/3] range-diff: optionally accept pathspecs

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

 



"Johannes Schindelin via GitGitGadget" <gitgitgadget@xxxxxxxxx>
writes:

> +	for (i = 0; i < argc; i++)
> +		if (!strcmp(argv[i], "--")) {
> +			dash_dash = i;
> +			break;
> +		}
> +
> +	if (dash_dash == 3 ||
> +	    (dash_dash < 0 && argc > 2 &&
> +	     !get_oid_committish(argv[0], &oid) &&
> +	     !get_oid_committish(argv[1], &oid) &&
> +	     !get_oid_committish(argv[2], &oid))) {
> +		if (dash_dash < 0)
> +			; /* already validated arguments */
> +		else if (get_oid_committish(argv[0], &oid))
>  			usage_msg_optf(_("not a revision: '%s'"),
>  				       builtin_range_diff_usage, options,
>  				       argv[0]);

Very reasonable.  We won't ever have "--" on the command line as
anything but a dash-dash (i.e. there is no option to the command
that can take any string), and thanks to the previous step, this
addition falls in place very naturally.  Very nicely done.

Will replace.  I _think_ this is ready for 'next', but let's see if
others spot problems for a few days.

THanks.



[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