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

[PATCH] git-remote-hg: Fix . at end of ref

From
Brian Gernhardt <brian@gernhardtsoftware.com>
Date
Jun 21, 2013, 16:12 UTC
Message-ID
<1371831158-9720-1-git-send-email-brian@gernhardtsoftware.com>

Any Mercurial tag/branch/bookmark that ended with a period would be rejected by fast-import. The repository could be cloned, but any further fetch would fail.

Use a similar trick to the space handling, but only when the period is at the end of the ref.

Probably need a more general solution to this problem.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
---
 contrib/remote-helpers/git-remote-hg | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 0194c67..7fa6cd7 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -78,9 +78,11 @@ def hgbin(n):
     return node.bin(n)
 
 def hgref(ref):
+    ref = re.sub('_\._$', '.', ref)
     return ref.replace('___', ' ')
 
 def gitref(ref):
+    ref = re.sub('\.$', '_._', ref)
     return ref.replace(' ', '___')
 
 def check_version(*check):
-- 
1.8.3.1.636.g893104c
Message 1 of 1 in “git-remote-hg: Fix . at end of ref”
  1. git-remote-hg: Fix . at end of refBrian Gernhardt, Jun 21, 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.