git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:15 UTC

[PATCH] [Outreachy] patch-ids: fix NEEDSWORK timezone parsing in fast-import.c

From
OAOkhuomon Ajayi <okhuomonajayi54@gmail.com>
Date
Oct 9, 2025, 23:49 UTC
Message-ID
<20251009234957.1789543-1-okhuomonajayi54@gmail.com>
Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
---
 builtin/fast-import.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 606c6aea82..695e1a0ae1 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -1959,14 +1959,15 @@ static int validate_raw_date(const char *src, struct strbuf *result, int strict)
 		return -1;
 
 	num = strtoul(src + 1, &endp, 10);
-	/*
-	 * NEEDSWORK: check for brokenness other than num > 1400, such as
-	 *            (num % 100) >= 60, or ((num % 100) % 15) != 0 ?
-	 */
-	if (errno || endp == src + 1 || *endp || /* did not parse */
-	    (strict && (1400 < num))             /* parsed a broken timezone */
-	   )
+	
+
+        unsigned int hours = num / 100;
+        unsigned int minutes = num % 100;
+
+	if (errno || endp == src + 1 || *endp || 
+	    (strict && (num > 1400 || minutes >=60 || minutes % 15 != 0))){
 		return -1;
+	}
 
 	strbuf_addstr(result, orig_src);
 	return 0;
-- 
2.43.0
Next: Kristoffer Haugsbakk
Message 1 of 5 in ā€œ[Outreachy] patch-ids: fix NEEDSWORK timezone parsing in fast-import.cā€
  1. [Outreachy] patch-ids: fix NEEDSWORK timezone parsing in fast-import.cOkhuomon Ajayi, Oct 9, 2025
  2. Kristoffer HaugsbakkOct 9, 2025
  3. Patrick SteinhardtOct 10, 2025
  4. Junio C HamanoOct 10, 2025
  5. Okhuomon AjayiOct 10, 2025

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.