Re: [PATCH 1/4] Add a simple option parser for use by builtin-commit.c.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jonas Fonseca <fonseca@...>
Cc: <gitster@...>, <git@...>
Date: Monday, October 1, 2007 - 12:26 pm

On Sun, 2007-09-30 at 15:11 +0200, Jonas Fonseca wrote:

Hi Jonas,

That's sounds like a good plan.  In fact, in you want to update the
patch with your changes (they all sound good) and start porting over
some of the other builtins feel free.  I don't have much time follow up
on these comments right now, but I will get to it eventually - unless
you beat me to it of course ;)  I will update builtin-commit.c to work
with whatever changes you introduce once I get around to updating that
patch.


That's an oversight, good catch.


Yeah, that looks nicer.  I think the goto structure is a leftover from
when there was more logic between the loop and the switch.  It's good to
get some fresh eyes on this code.  Junio didn't like the OPTION_LAST
terminator, so I changed the interface to take a count.  We can do

	if (i == count)
		usage();
	else switch (options[i].type) {
		...
	}

of course.


That would be fine, yes.


Yup.


Sure, that's friendlier.


Yeah, that might be nice.  We can add it in a follow-on patch, if the
list agrees that it's a good thing, I guess.


I don't ever use it myself and I think it's more confusing than helpful.
I only added it to avoid introducing behavior changes in the port.  I
don't have strong feelings either way.


Hehe, yeah, that's how I did it first.  I don't have a strong preference
for terminator elements vs. ARRAY_SIZE(), but Junio prefers the
ARRAY_SIZE() approach, I guess.  At this point I'm just trying the get
the patches upstream...


No objections, I think that looks better too.


Heh, that's what I do myself :)

thanks for the comments,
Kristian


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/4] Add a simple option parser for use by builtin-co..., Kristian Høgsberg, (Thu Sep 27, 12:50 am)
Re: [PATCH 1/4] Add a simple option parser for use by builti..., Kristian , (Mon Oct 1, 12:26 pm)
Re: [PATCH 1/4] Add a simple option parser for use by builti..., Johannes Schindelin, (Mon Oct 1, 2:13 pm)
Re: [PATCH 1/4] Add a simple option parser for use by builti..., Johannes Schindelin, (Mon Oct 1, 6:14 am)
Re: [PATCH 1/4] Add a simple option parser for use by builti..., Johannes Schindelin, (Mon Oct 1, 7:39 am)
[PATCH 2/4] This exports the update() function from builtin-..., Kristian Høgsberg, (Thu Sep 27, 12:50 am)
Re: [PATCH 2/4] This exports the update() function from buil..., Johannes Schindelin, (Thu Sep 27, 7:47 am)
[PATCH 3/4] Implement git commit as a builtin command., Kristian Høgsberg, (Thu Sep 27, 12:50 am)