Re: [PATCH 4/4] Implement git commit and status as a builtin commands.

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

 



On 2007.11.05 13:57:53 -0500, Kristian Høgsberg wrote:
> On Sat, 2007-11-03 at 16:06 +0100, Björn Steinbrink wrote:
> > On 2007.11.02 11:33:09 -0400, Kristian Høgsberg wrote:
> > > +	if (all && interactive)
> > > +		die("Cannot use -a, --interactive or -i at the same time.");
> > 
> > Shouldn't that be "if (all && (interactive || also))"?

Ah, damn. I (obviously) misread the error message as:
	foo and (bar or bar2)

IOW "and" instead of the first comma.

Actually it should be:
	if ((all && (interactive || also)) || (interactive && also))

(or whatever more simple version you come up with)

> The shell script just has
> 
> case "$all,$interactive,$also,$#" in
> *t,*t,*)
>         die "Cannot use -a, --interactive or -i at the same time." ;;
> 
> which doesn't seem to care about the value of $also.  As far as I
> understand git commit, it doesn't make sense to pass any of -a, -i, -o
> or --interactive at the same time so I guess I could join the checks

Note that there are only two commas. The asterisks catch everything and
$# won't be "t", so that catches anything with at least two t's.

Also note, that the two checks after that one in git-commit.sh as of the
current master (140dd77a5cb2e61dcb942e245a2474fae95e42a5) are broken
(I'll send a patch in a separate mail).

>         if (also && only)
>                 die("Only one of --include/--only can be used.");
>         if (all && interactive)
>                 die("Cannot use -a, --interactive or -i at the same
> time.");
> 
> into something like
> 
> 	if (also + only + all + interactive > 1)              
> 		die("Only one of --include/--only/--all/--interactive can be used.");
> 
> Does that sound right?

--include is not in the manpage, and I only glanced over git-commit.sh,
but yeah, at least to me, that sounds right.

Björn
-
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]

  Powered by Linux