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

[PATCH 4/5] remote-bzr: include authors field in pushed commits

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 9, 2014, 18:50 UTC
Message-ID
<1397069404-7451-5-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1397069404-7451-1-git-send-email-felipe.contreras@gmail.com>
From: dequis <dx@dxzone.com.ar>
Tests-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-bzr |  2 ++
 contrib/remote-helpers/test-bzr.sh    | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index 7f354c8..6ca1e97 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -618,10 +618,12 @@ def parse_commit(parser):
         files[path] = f
 
     committer, date, tz = committer
+    author, _, _ = author
     parents = [mark_to_rev(p) for p in parents]
     revid = bzrlib.generate_ids.gen_revision_id(committer, date)
     props = {}
     props['branch-nick'] = branch.nick
+    props['authors'] = author
 
     mtree = CustomTree(branch, revid, parents, files)
     changes = mtree.iter_changes()
diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh
index 1e53ff9..431de3b 100755
--- a/contrib/remote-helpers/test-bzr.sh
+++ b/contrib/remote-helpers/test-bzr.sh
@@ -391,4 +391,28 @@ test_expect_success 'export utf-8 authors' '
 	test_cmp expected actual
 '
 
+test_expect_success 'push different author' '
+	test_when_finished "rm -rf bzrrepo gitrepo" &&
+
+	bzr init bzrrepo &&
+
+	(
+	git init gitrepo &&
+	cd gitrepo &&
+	echo john >> content &&
+	git add content &&
+	git commit -m john --author "John Doe <jdoe@example.com>" &&
+	git remote add bzr "bzr::../bzrrepo" &&
+	git push bzr master
+	) &&
+
+	(
+	cd bzrrepo &&
+	bzr log | grep "^author: " > ../actual
+	) &&
+
+	echo "author: John Doe <jdoe@example.com>" > expected &&
+	test_cmp expected actual
+'
+
 test_done
-- 
1.9.1+fc1
Previous: Felipe ContrerasNext: Felipe Contreras
Message 5 of 8 in “Fixes”
  1. 0/5 FixesFelipe Contreras, Apr 9, 2014
  2. 1/5 remote-helpers: allow all tests running from any dirFelipe Contreras, Apr 9, 2014
  3. 2/5 remote-hg: always normalize pathsFelipe Contreras, Apr 9, 2014
  4. 3/5 remote-bzr: add support for older versionsFelipe Contreras, Apr 9, 2014
  5. 4/5 remote-bzr: include authors field in pushed commitsFelipe Contreras, Apr 9, 2014
  6. 5/5 completion: fix completion of certain aliasesFelipe Contreras, Apr 9, 2014
  7. Junio C HamanoApr 9, 2014
  8. Felipe ContrerasApr 9, 2014

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.