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

[PATCH 1/4] remote-hg: avoid buggy strftime()

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Dec 7, 2013, 13:09 UTC
Message-ID
<1386421783-27781-2-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1386421783-27781-1-git-send-email-felipe.contreras@gmail.com>
From: jcb91 <joshuacookebarnes@gmail.com>
  error on pull: fatal: Invalid raw date "" in ident: remote-hg <>

Neither %s nor %z are officially supported by python, they may work on some (most?) platforms, but not all.

removed strftime use of %s and %z, which are not officially supported by python, with standard formats
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-hg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index c6026b9..a81d59e 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -538,7 +538,7 @@ def export_ref(repo, name, kind, head):
 
         print "commit %s" % ref
         print "mark :%d" % (note_mark)
-        print "committer remote-hg <> %s" % (ptime.strftime('%s %z'))
+        print "committer remote-hg <> %d %s" % (ptime.time(), gittz(ptime.timezone))
         desc = "Notes for %s\n" % (name)
         print "data %d" % (len(desc))
         print desc
-- 
1.8.4.2+fc1
Previous: Felipe ContrerasNext: Felipe Contreras
Message 2 of 8 in “remote-helpers: fixes”
  1. 0/4 remote-helpers: fixesFelipe Contreras, Dec 7, 2013
  2. 1/4 remote-hg: avoid buggy strftime()Felipe Contreras, Dec 7, 2013
  3. 2/4 remote-helpers: add extra safety checksFelipe Contreras, Dec 7, 2013
  4. 3/4 remote-hg: fix 'shared path' pathFelipe Contreras, Dec 7, 2013
  5. Antoine PelisseDec 13, 2013
  6. Junio C HamanoDec 17, 2013
  7. remote-hg: test 'shared_path' in a moved cloneAntoine Pelisse, Dec 23, 2013
  8. 4/4 remote-hg: add tests for special filenamesFelipe Contreras, Dec 7, 2013

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.