Thread (13 messages) flat view 13 messages, 5 authors, 2016-07-09

Re: [PATCH] revert: clarify seemingly bogus OPT_END repetition

From: Michael J Gruber <hidden>
Date: 2016-07-06 11:09:20

Johannes Schindelin venit, vidit, dixit 06.07.2016 09:01:
Hi Peff & Jacob,

On Tue, 5 Jul 2016, Jacob Keller wrote:
quoted
On Tue, Jul 5, 2016 at 1:44 PM, Jeff King [off-list ref] wrote:
quoted
On Tue, Jul 05, 2016 at 04:28:20PM -0400, Jeff King wrote:

Something like the patch below.

I admit this isn't buggy _now_, so this is potentially just churn. It
does make further patches look nicer, though (they don't have to add
apparently meaningless OPT_END() slots).

-- >8 --
Subject: [PATCH] parse_options: allocate a new array when concatenating

In exactly one callers (builtin/revert.c), we build up the
options list dynamically from multiple arrays. We do so by
manually inserting "filler" entries into one array, and then
copying the other array into the allocated space.

This is tedious and error-prone, as you have to adjust the
filler any time the second array is modified (although we do
at least check and die() when the counts do not match up).

Instead, let's just allocate a new array.
This seems much preferable to me.
Yes, this is better than my patch.

BTW Jacob, would you terribly mind cutting the quoted parts properly (I
cut 112 lines)? It may not seem like much, but I seem to spend more and
more of my email time budget on skimming unaddressed remainders of quoted
mails, and I would much rather spend that time on something productive.
OTOH, I often have to look up the original message because people cut
too much, or because they take one sentence out of context.

It is not unheard of that a MUA can collapse and expand properly quoted
parts on request...

Michael
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help