Linus Torvalds [off-list ref] writes:
On Mon, Nov 7, 2011 at 7:00 PM, Junio C Hamano [off-list ref] wrote:
quoted
This is a re-roll of the fourth iteration.
Ok, this all looks fine to me.
Clean series, and everything looks fine.
The one thing I wondered about is what happens when you merge two
signed tags. Maybe I read the patch wrong, but it *looks* to me like
the code just appends them all together with nothing in between. Is it
still parseable?
Eek.
The mergetag stuff is a dump of "cat-file tag" so if you have a line that
begins with "object " the parsing side (which does not exist yet) would
have trouble. We would need to devise e.g. adding number of lines at the
beginning, or something.
On Mon, Nov 7, 2011 at 9:10 PM, Junio C Hamano [off-list ref] wrote:
Eek.
The mergetag stuff is a dump of "cat-file tag" so if you have a line that
begins with "object " the parsing side (which does not exist yet) would
have trouble. We would need to devise e.g. adding number of lines at the
beginning, or something.
Might I suggest making it simpler still to parse?
Change "strbuf_add_lines()" to have two *different* prefixes: one for
the first line, and one for "continuation lines".
Then you can just use the same prefix if you want to - and get the
semantics you have now for that helper.
But instead of just having "mergetag" as the prefix for all the lines
copied from the merge, wouldn't it be nice and easy to have "mergetag"
as the prefix for the *first* line of each copied tag, but then have
some other tag for lines 2..n?
I think that would be *way* easier to parse, and I think something
like that could be a good generic model for any multi-line thing -
have the first line tagged, and the rest have just the continuation
marker. You don't really need to repeat the tag over and over again
each line, it just causes ambiguoity as shown by this example.
But I don't have any really strong opinions on it. I just think it's a
good idea to make it easy to parse both mechanically and
human-visually, and "number of lines" doesn't strike me as being very
human-friendly.
Linus