git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC 2/6] tag: parse the date

From
Marc-André Lureau <marcandre.lureau@gmail.com>
Date
Feb 22, 2009, 18:06 UTC
Message-ID
<e29894ca0902221006k6da2c8adha858c7b61bdbc3ea@mail.gmail.com>
Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com>
---
 tag.c |    5 ++++-
 tag.h |    1 +
 2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/tag.c b/tag.c
index 42e5b22..eecc636 100644
--- a/tag.c
+++ b/tag.c
@@ -40,7 +40,7 @@ int parse_tag_buffer(struct tag *item, void *data,
unsigned long size)
 {
 	int typelen, taglen, siglen;
 	unsigned char sha1[20];
-	const char *type_line, *tag_line, *sig_line, *msg_line;
+	const char *type_line, *tag_line, *sig_line, *msg_line, *date;
 	char type[20];
 	const char *start = data;

@@ -78,6 +78,9 @@ int parse_tag_buffer(struct tag *item, void *data,
unsigned long size)
 	item->tag = xmemdupz(tag_line + 4, taglen);
 	siglen = msg_line - sig_line - strlen("tagger \n");
 	item->signature = xmemdupz(sig_line + 7, siglen);
+	date = strchr(item->signature, '>');
+	if (date)
+		item->date = strtoul(++date, NULL, 10);

 	if (!strcmp(type, blob_type)) {
 		item->tagged = &lookup_blob(sha1)->object;
diff --git a/tag.h b/tag.h
index bc2cab3..e6edfcf 100644
--- a/tag.h
+++ b/tag.h
@@ -10,6 +10,7 @@ struct tag {
 	struct object *tagged;
 	char *tag;
 	char *signature;
+	unsigned long date;
 };

 extern struct tag *lookup_tag(const unsigned char *sha1);
-- 
1.6.2.rc1.28.g05ef4.dirty
Message 1 of 1 in “tag: parse the date”
  1. 2/6 tag: parse the dateMarc-André Lureau, Feb 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.