Re: [PATCH 4/4] Implement git commit and status as a builtin commands.
- From
Björn Steinbrink <b.steinbrink@gmx.de>
- Date
- Nov 5, 2007, 19:23 UTC
- Message-ID
- <20071105192347.GA29997@atjola.homenet>
- In-Reply-To
- <1194289073.13968.16.camel@hinata.boston.redhat.com>
On 2007.11.05 13:57:53 -0500, Kristian Høgsberg wrote:
Show 6 quoted lines
> 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)
Show 9 quoted lines
> 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).
Show 12 quoted lines
> 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