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

[PATCH v2] remote-bzr: fix export of utf-8 authors

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Aug 28, 2013, 21:14 UTC
Message-ID
<1377724480-18649-1-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<CAPig+cSt6HCuB2VOj_-C+e7BeXJD72hKdtNN3ueyKn6B4DSu7A@mail.gmail.com>
Reported-by: Joakim Verona <joakim@verona.se>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-bzr |  1 +
 contrib/remote-helpers/test-bzr.sh    | 30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index c3a3cac..08b0b61 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -168,6 +168,7 @@ class Parser:
         if not m:
             return None
         _, name, email, date, tz = m.groups()
+        name = name.decode('utf-8')
         committer = '%s <%s>' % (name, email)
         tz = int(tz)
         tz = ((tz / 100) * 3600) + ((tz % 100) * 60)
diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh
index dce281f..b0d70fd 100755
--- a/contrib/remote-helpers/test-bzr.sh
+++ b/contrib/remote-helpers/test-bzr.sh
@@ -358,4 +358,34 @@ test_expect_success 'strip' '
 	test_cmp expected actual
 '
 
+test_expect_success 'export utf-8 authors' '
+	test_when_finished "rm -rf bzrrepo gitrepo && LC_ALL=C && unset GIT_COMMITTER_NAME" &&
+
+	LC_ALL=en_US.UTF-8
+	export LC_ALL
+
+	GIT_COMMITTER_NAME="Grégoire"
+	export GIT_COMMITTER_NAME
+
+	bzr init bzrrepo &&
+
+	(
+	git init gitrepo &&
+	cd gitrepo &&
+	echo greg >> content &&
+	git add content &&
+	git commit -m one &&
+	git remote add bzr "bzr::../bzrrepo" &&
+	git push bzr
+	) &&
+
+	(
+	cd bzrrepo &&
+	bzr log | grep "^committer: " > ../actual
+	) &&
+
+	echo "committer: Grégoire <committer@example.com>" > expected &&
+	test_cmp expected actual
+'
+
 test_done
-- 
1.8.4-fc-3-g64bc480
Previous: Eric SunshineNext: Felipe Contreras
Message 20 of 32 in “remote-{hg,bzr}: updates”
  1. 0/8 remote-{hg,bzr}: updatesFelipe Contreras, Aug 28, 2013
  2. 1/8 remote-bzr: fix export of utf-8 authorsFelipe Contreras, Aug 28, 2013
  3. Matthieu MoyAug 28, 2013
  4. Felipe ContrerasAug 28, 2013
  5. Antoine PelisseAug 28, 2013
  6. Felipe ContrerasAug 28, 2013
  7. Felipe ContrerasAug 28, 2013
  8. Matthieu MoyAug 28, 2013
  9. Felipe ContrerasAug 28, 2013
  10. Junio C HamanoAug 28, 2013
  11. Felipe ContrerasAug 28, 2013
  12. Re* [PATCH 1/8] remote-bzr: fix export of utf-8 authorsJunio C Hamano, Aug 29, 2013
  13. Junio C HamanoAug 29, 2013
  14. Michael HaggertySep 1, 2013
  15. Antoine PelisseAug 29, 2013
  16. Junio C HamanoAug 29, 2013
  17. Junio C HamanoAug 29, 2013
  18. Michael HaggertySep 1, 2013
  19. Eric SunshineAug 28, 2013
  20. remote-bzr: fix export of utf-8 authorsFelipe Contreras, Aug 28, 2013
  21. 2/8 remote-bzr: make bzr branches configurable per-repoFelipe Contreras, Aug 28, 2013
  22. 3/8 remote-hg: fix testFelipe Contreras, Aug 28, 2013
  23. 4/8 remote-hg: add missing &&s in the testFelipe Contreras, Aug 28, 2013
  24. 5/8 remote-hg: improve basic testFelipe Contreras, Aug 28, 2013
  25. 6/8 remote-helpers: trivial style fixesFelipe Contreras, Aug 28, 2013
  26. 7/8 remote-helpers: cleanup more global variablesFelipe Contreras, Aug 28, 2013
  27. 8/8 remote-hg: support for notesFelipe Contreras, Aug 28, 2013
  28. Junio C HamanoAug 29, 2013
  29. remote-hg: support for notesFelipe Contreras, Aug 29, 2013
  30. Junio C HamanoAug 29, 2013
  31. remote-hg: support for notesFelipe Contreras, Aug 29, 2013
  32. Junio C HamanoAug 29, 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.