Re: [WIP/RFC 09/13] git notes merge: Initial implementation handling trivial merges only

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

 



On Saturday 24 July 2010, Stephen Boyd wrote:
>   On 07/23/2010 03:15 AM, Johan Herland wrote:
> > +	if (1<  argc) {
> > +		error("too many parameters");
> > +		usage_with_options(git_notes_merge_usage, options);
> > +	} else if (1>  argc) {
> > +		error("too few parameters");
> > +		usage_with_options(git_notes_merge_usage, options);
> > +	}
> > +
> 
> Looks like it only takes one <notes_ref>. In that case wouldn't it be
> better to say
> 
>      if (argc != 1) {
>          error("Must specify a note ref to merge");
>          usage_with_options(git_notes_merge_usage, options)
>      }

Thanks. I'll squash the following into the next iteration:

...Johan

diff --git a/builtin/notes.c b/builtin/notes.c
index f2bc767..ca0e4d9 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -780,11 +780,8 @@ static int merge(int argc, const char **argv, const char *prefix)
 	argc = parse_options(argc, argv, prefix, options,
 			     git_notes_merge_usage, 0);
 
-	if (1 < argc) {
-		error("too many parameters");
-		usage_with_options(git_notes_merge_usage, options);
-	} else if (1 > argc) {
-		error("too few parameters");
+	if (argc != 1) {
+		error("Must specify a notes ref to merge");
 		usage_with_options(git_notes_merge_usage, options);
 	}
 


-- 
Johan Herland, <johan@xxxxxxxxxxx>
www.herland.net
--
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]