{"thread":{"id":"17953","subject":"[PATCH/RFC 1/6] tag: read signature","startedAt":"2009-02-22T18:06:37Z","lastAt":"2009-02-22T18:25:21Z","messageCount":3,"participants":["Marc-André Lureau","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"105797","messageId":"e29894ca0902221006y4b0e29e7ucc8a04e8e6e42f4@mail.gmail.com","threadId":"17953","inReplyTo":null,"subject":"[PATCH/RFC 1/6] tag: read signature","fromName":"Marc-André Lureau","fromEmail":"marcandre.lureau@gmail.com","sentAt":"2009-02-22T18:06:37Z","receivedAt":"2009-02-22T18:06:37Z","isPatch":true,"sender":{"key":"marcandre.lureau@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9381?v=4"},"body":"Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com>\n---\n tag.c |   11 ++++++++---\n tag.h |    2 +-\n 2 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/tag.c b/tag.c\nindex 4470d2b..42e5b22 100644\n--- a/tag.c\n+++ b/tag.c\n@@ -38,9 +38,9 @@ struct tag *lookup_tag(const unsigned char *sha1)\n\n int parse_tag_buffer(struct tag *item, void *data, unsigned long size)\n {\n-\tint typelen, taglen;\n+\tint typelen, taglen, siglen;\n \tunsigned char sha1[20];\n-\tconst char *type_line, *tag_line, *sig_line;\n+\tconst char *type_line, *tag_line, *sig_line, *msg_line;\n \tchar type[20];\n \tconst char *start = data;\n\n@@ -62,9 +62,12 @@ int parse_tag_buffer(struct tag *item, void *data,\nunsigned long size)\n \t\treturn -1;\n\n \tsig_line = memchr(tag_line, '\\n', size - (tag_line - start));\n+\tif (!sig_line || memcmp(\"tagger \", ++sig_line, 7))\n+\t\treturn -1;\n+\n+\tmsg_line = memchr(sig_line, '\\n', size - (sig_line - start));\n \tif (!sig_line)\n \t\treturn -1;\n-\tsig_line++;\n\n \ttypelen = tag_line - type_line - strlen(\"type \\n\");\n \tif (typelen >= 20)\n@@ -73,6 +76,8 @@ int parse_tag_buffer(struct tag *item, void *data,\nunsigned long size)\n \ttype[typelen] = '\\0';\n \ttaglen = sig_line - tag_line - strlen(\"tag \\n\");\n \titem->tag = xmemdupz(tag_line + 4, taglen);\n+\tsiglen = msg_line - sig_line - strlen(\"tagger \\n\");\n+\titem->signature = xmemdupz(sig_line + 7, siglen);\n\n \tif (!strcmp(type, blob_type)) {\n \t\titem->tagged = &lookup_blob(sha1)->object;\ndiff --git a/tag.h b/tag.h\nindex 7a0cb00..bc2cab3 100644\n--- a/tag.h\n+++ b/tag.h\n@@ -9,7 +9,7 @@ struct tag {\n \tstruct object object;\n \tstruct object *tagged;\n \tchar *tag;\n-\tchar *signature; /* not actually implemented */\n+\tchar *signature;\n };\n\n extern struct tag *lookup_tag(const unsigned char *sha1);\n-- \n1.6.2.rc1.28.g05ef4.dirty\n"},{"id":"105803","messageId":"7vskm6xrm7.fsf@gitster.siamese.dyndns.org","threadId":"17953","inReplyTo":"e29894ca0902221006y4b0e29e7ucc8a04e8e6e42f4@mail.gmail.com","subject":"Re: [PATCH/RFC 1/6] tag: read signature","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-22T18:18:24Z","receivedAt":"2009-02-22T18:18:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marc-André Lureau <marcandre.lureau@gmail.com> writes:\n\n> diff --git a/tag.h b/tag.h\n> index 7a0cb00..bc2cab3 100644\n> --- a/tag.h\n> +++ b/tag.h\n> @@ -9,7 +9,7 @@ struct tag {\n>  \tstruct object object;\n>  \tstruct object *tagged;\n>  \tchar *tag;\n> -\tchar *signature; /* not actually implemented */\n> +\tchar *signature;\n>  };\n\nI do not speak for Daniel, but I think the original intent of \"signature\"\nis about the GnuPG signature, not the \"tagger\" field.\n\nAnd this is not an objection.  The use of GnuPG is accidental and at the\nlow level of the object layer like this codepath we would not necessarily\nwant to be married to it.  Grabbing and parsing the tagger field like your\npatches 1/6 and 2/6 did would be more appropriate.\n\nBut then we would probably want to rename this field \"tagger\" (and then\nthe timestamp field you add in the next patch \"tagger_date\").\n"},{"id":"105805","messageId":"e29894ca0902221025t5e015c96ycb90afaec4a33124@mail.gmail.com","threadId":"17953","inReplyTo":"7vskm6xrm7.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH/RFC 1/6] tag: read signature","fromName":"Marc-André Lureau","fromEmail":"marcandre.lureau@gmail.com","sentAt":"2009-02-22T18:25:21Z","receivedAt":"2009-02-22T18:25:21Z","isPatch":true,"sender":{"key":"marcandre.lureau@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9381?v=4"},"body":"Hi\n\nOn Sun, Feb 22, 2009 at 8:18 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Marc-André Lureau <marcandre.lureau@gmail.com> writes:\n>\n>> diff --git a/tag.h b/tag.h\n>> index 7a0cb00..bc2cab3 100644\n>> --- a/tag.h\n>> +++ b/tag.h\n>> @@ -9,7 +9,7 @@ struct tag {\n>>       struct object object;\n>>       struct object *tagged;\n>>       char *tag;\n>> -     char *signature; /* not actually implemented */\n>> +     char *signature;\n>>  };\n>\n> I do not speak for Daniel, but I think the original intent of \"signature\"\n> is about the GnuPG signature, not the \"tagger\" field.\n>\n> And this is not an objection.  The use of GnuPG is accidental and at the\n> low level of the object layer like this codepath we would not necessarily\n> want to be married to it.  Grabbing and parsing the tagger field like your\n> patches 1/6 and 2/6 did would be more appropriate.\n>\n> But then we would probably want to rename this field \"tagger\" (and then\n> the timestamp field you add in the next patch \"tagger_date\").\n>\n\nYes, I though the same. But when I saw the way it was parsed before\n(the value of sig_line), I was not sure about naming.\nI agree it would be better to name it \"tagger\".\n\nregards,\n\n-- \nMarc-André Lureau\nSent from: Helsinki Southern Finland Finland.\n"}]}