{"thread":{"id":"34789","subject":"[PATCH 1/8] remote-bzr: fix export of utf-8 authors","startedAt":"2013-08-28T19:23:05Z","lastAt":"2013-09-01T04:09:26Z","messageCount":32,"participants":["Felipe Contreras","Matthieu Moy","Eric Sunshine","Antoine Pelisse","Junio C Hamano","Michael Haggerty"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"226096","messageId":"1377717793-27170-1-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":null,"subject":"[PATCH 0/8] remote-{hg,bzr}: updates","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T19:23:05Z","receivedAt":"2013-08-28T19:23:05Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Felipe Contreras (8):\n  remote-bzr: fix export of utf-8 authors\n  remote-bzr: make bzr branches configurable per-repo\n  remote-hg: fix test\n  remote-hg: add missing &&s in the test\n  remote-hg: improve basic test\n  remote-helpers: trivial style fixes\n  remote-helpers: cleanup more global variables\n  remote-hg: support for notes\n\n contrib/remote-helpers/git-remote-bzr | 47 +++++++------------------\n contrib/remote-helpers/git-remote-hg  | 65 +++++++++++++++++++----------------\n contrib/remote-helpers/test-bzr.sh    | 30 ++++++++++++++++\n contrib/remote-helpers/test-hg.sh     | 10 +++---\n 4 files changed, 82 insertions(+), 70 deletions(-)\n\n-- \n1.8.4-fc\n"},{"id":"226095","messageId":"1377717793-27170-2-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"1377717793-27170-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T19:23:06Z","receivedAt":"2013-08-28T19:23:06Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Reported-by: Joakim Verona <joakim@verona.se>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr |  1 +\n contrib/remote-helpers/test-bzr.sh    | 30 ++++++++++++++++++++++++++++++\n 2 files changed, 31 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex c3a3cac..08b0b61 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -168,6 +168,7 @@ class Parser:\n         if not m:\n             return None\n         _, name, email, date, tz = m.groups()\n+        name = name.decode('utf-8')\n         committer = '%s <%s>' % (name, email)\n         tz = int(tz)\n         tz = ((tz / 100) * 3600) + ((tz % 100) * 60)\ndiff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh\nindex dce281f..ef8992a 100755\n--- a/contrib/remote-helpers/test-bzr.sh\n+++ b/contrib/remote-helpers/test-bzr.sh\n@@ -358,4 +358,34 @@ test_expect_success 'strip' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'export utf-8 authors' '\n+\ttest_when_finished \"rm -rf bzrrepo gitrepo && LC_ALL=C && unset GIT_COMMITTER_NAME\" &&\n+\n+\tLC_ALL=en_US.UTF-8\n+\texport LC_ALL\n+\n+\tGIT_COMMITTER_NAME=\"Grégoire\"\n+\texport GIT_COMMITTER_NAME\n+\n+\tbzr init bzrrepo &&\n+\n+\t(\n+\tgit init gitrepo &&\n+\tcd gitrepo &&\n+\techo greg >> content &&\n+\tgit add content &&\n+\tgit commit -m one\n+\tgit remote add bzr \"bzr::../bzrrepo\" &&\n+\tgit push bzr\n+\t) &&\n+\n+\t(\n+\tcd bzrrepo &&\n+\tbzr log | grep \"^committer: \" > ../actual\n+\t) &&\n+\n+\techo \"committer: Grégoire <committer@example.com>\" > expected &&\n+\ttest_cmp expected actual\n+'\n+\n test_done\n-- \n1.8.4-fc\n"},{"id":"226098","messageId":"1377717793-27170-3-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"1377717793-27170-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 2/8] remote-bzr: make bzr branches configurable per-repo","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T19:23:07Z","receivedAt":"2013-08-28T19:23:07Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Different repositories have different branches, some are are even\nbranches themselves.\n\nReported-by: Peter Niederlag <netservice@niekom.de>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 13 ++++++++++---\n 1 file changed, 10 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 08b0b61..a7d2ac9 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -13,8 +13,11 @@\n # or\n # % git clone bzr::lp:myrepo\n #\n-# If you want to specify which branches you want track (per repo):\n-# git config remote-bzr.branches 'trunk, devel, test'\n+# If you want to specify which branches you want to track (per repo):\n+# % git config remote.origin.bzr-branches 'trunk, devel, test'\n+#\n+# Where 'origin' is the name of the repository you want to specify the\n+# branches.\n #\n \n import sys\n@@ -852,9 +855,13 @@ def get_repo(url, alias):\n             except bzrlib.errors.NoRepositoryPresent:\n                 pass\n \n-    wanted = get_config('remote-bzr.branches').rstrip().split(', ')\n+    wanted = get_config('remote.%s.bzr-branches' % alias).rstrip().split(', ')\n     # stupid python\n     wanted = [e for e in wanted if e]\n+    if not wanted:\n+        wanted = get_config('remote-bzr.branches').rstrip().split(', ')\n+        # stupid python\n+        wanted = [e for e in wanted if e]\n \n     if not wanted:\n         try:\n-- \n1.8.4-fc\n"},{"id":"226097","messageId":"1377717793-27170-4-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"1377717793-27170-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 3/8] remote-hg: fix test","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T19:23:08Z","receivedAt":"2013-08-28T19:23:08Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"It wasn't being checked properly before; those refs never existed.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/test-hg.sh | 2 --\n 1 file changed, 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh\nindex f7ce8aa..cbf8617 100755\n--- a/contrib/remote-helpers/test-hg.sh\n+++ b/contrib/remote-helpers/test-hg.sh\n@@ -580,8 +580,6 @@ test_expect_success 'remote big push fetch first' '\n \tcheck_push 1 --all <<-EOF\n \tmaster\n \tgood_bmark\n-\tnew_bmark:new\n-\tnew_branch:new\n \tbad_bmark:fetch-first\n \tbranches/bad_branch:festch-first\n \tEOF\n-- \n1.8.4-fc\n"},{"id":"226099","messageId":"1377717793-27170-5-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"1377717793-27170-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 4/8] remote-hg: add missing &&s in the test","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T19:23:09Z","receivedAt":"2013-08-28T19:23:09Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/test-hg.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh\nindex cbf8617..94b0bba 100755\n--- a/contrib/remote-helpers/test-hg.sh\n+++ b/contrib/remote-helpers/test-hg.sh\n@@ -577,7 +577,7 @@ test_expect_success 'remote big push fetch first' '\n \techo five > content &&\n \tgit commit -q -a -m five &&\n \n-\tcheck_push 1 --all <<-EOF\n+\tcheck_push 1 --all <<-EOF &&\n \tmaster\n \tgood_bmark\n \tbad_bmark:fetch-first\n@@ -633,7 +633,7 @@ test_expect_failure 'remote big push dry-run' '\n \t(\n \tcd gitrepo &&\n \n-\tcheck_push 0 --dry-run --all <<-EOF\n+\tcheck_push 1 --dry-run --all <<-EOF &&\n \tmaster\n \tgood_bmark\n \tbranches/good_branch\n-- \n1.8.4-fc\n"},{"id":"226100","messageId":"1377717793-27170-6-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"1377717793-27170-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 5/8] remote-hg: improve basic test","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T19:23:10Z","receivedAt":"2013-08-28T19:23:10Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"It appears 'let' is not present in all shells.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/test-hg.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh\nindex 94b0bba..5a6f745 100755\n--- a/contrib/remote-helpers/test-hg.sh\n+++ b/contrib/remote-helpers/test-hg.sh\n@@ -75,10 +75,10 @@ check_push () {\n \t\t\tgrep \"^   [a-f0-9]*\\.\\.[a-f0-9]* *${branch} -> ${branch}$\" error || ref_ret=1\n \t\t\t;;\n \t\tesac\n-\t\tlet 'ref_ret' && echo \"match for '$branch' failed\" && break\n+\t\ttest $ref_ret -ne 0 && echo \"match for '$branch' failed\" && break\n \tdone\n \n-\tif let 'expected_ret != ret || ref_ret'\n+\tif test $expected_ret -ne $ret -o $ref_ret -ne 0\n \tthen\n \t\treturn 1\n \tfi\n-- \n1.8.4-fc\n"},{"id":"226101","messageId":"1377717793-27170-7-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"1377717793-27170-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 6/8] remote-helpers: trivial style fixes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T19:23:11Z","receivedAt":"2013-08-28T19:23:11Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"In accordance with pep8.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 4 ++--\n contrib/remote-helpers/git-remote-hg  | 2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex a7d2ac9..e4fdfb0 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -488,7 +488,7 @@ class CustomTree():\n             add_entry(fid, dirname, 'directory')\n             return fid\n \n-        def add_entry(fid, path, kind, mode = None):\n+        def add_entry(fid, path, kind, mode=None):\n             dirname, basename = os.path.split(path)\n             parent_fid = get_parent(dirname, basename)\n \n@@ -509,7 +509,7 @@ class CustomTree():\n             self.files[path] = [change[0], None]\n             changes.append(change)\n \n-        def update_entry(fid, path, kind, mode = None):\n+        def update_entry(fid, path, kind, mode=None):\n             dirname, basename = os.path.split(path)\n             parent_fid = get_parent(dirname, basename)\n \ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex d2ff0e2..178a5a5 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -1079,7 +1079,7 @@ def do_export(parser):\n             author, msg = parsed_tags.get(tag, (None, None))\n             if mode == 'git':\n                 if not msg:\n-                    msg = 'Added tag %s for changeset %s' % (tag, node[:12]);\n+                    msg = 'Added tag %s for changeset %s' % (tag, node[:12])\n                 tagnode, branch = write_tag(parser.repo, tag, node, msg, author)\n                 p_revs[tagnode] = 'refs/heads/branches/' + gitref(branch)\n             else:\n-- \n1.8.4-fc\n"},{"id":"226102","messageId":"1377717793-27170-8-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"1377717793-27170-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 7/8] remote-helpers: cleanup more global variables","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T19:23:12Z","receivedAt":"2013-08-28T19:23:12Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"They don't need to be specified if they are not going to be set.\n\nSuggested-by: Dusty Phillips <dusty@linux.ca>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 29 -----------------------------\n contrib/remote-helpers/git-remote-hg  | 30 ++----------------------------\n 2 files changed, 2 insertions(+), 57 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex e4fdfb0..42cec58 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -178,11 +178,9 @@ class Parser:\n         return (committer, int(date), tz)\n \n def rev_to_mark(rev):\n-    global marks\n     return marks.from_rev(rev)\n \n def mark_to_rev(mark):\n-    global marks\n     return marks.to_rev(mark)\n \n def fixup_user(user):\n@@ -237,8 +235,6 @@ def get_filechanges(cur, prev):\n     return modified, removed\n \n def export_files(tree, files):\n-    global marks, filenodes\n-\n     final = []\n     for path, fid in files.iteritems():\n         kind = tree.kind(fid)\n@@ -280,8 +276,6 @@ def export_files(tree, files):\n     return final\n \n def export_branch(repo, name):\n-    global prefix\n-\n     ref = '%s/heads/%s' % (prefix, name)\n     tip = marks.get_tip(name)\n \n@@ -382,16 +376,12 @@ def export_branch(repo, name):\n     marks.set_tip(name, revid)\n \n def export_tag(repo, name):\n-    global tags, prefix\n-\n     ref = '%s/tags/%s' % (prefix, name)\n     print \"reset %s\" % ref\n     print \"from :%u\" % rev_to_mark(tags[name])\n     print\n \n def do_import(parser):\n-    global dirname\n-\n     repo = parser.repo\n     path = os.path.join(dirname, 'marks-git')\n \n@@ -417,8 +407,6 @@ def do_import(parser):\n     sys.stdout.flush()\n \n def parse_blob(parser):\n-    global blob_marks\n-\n     parser.next()\n     mark = parser.get_mark()\n     parser.next()\n@@ -429,8 +417,6 @@ def parse_blob(parser):\n class CustomTree():\n \n     def __init__(self, branch, revid, parents, files):\n-        global files_cache\n-\n         self.updates = {}\n         self.branch = branch\n \n@@ -587,9 +573,6 @@ def c_style_unescape(string):\n     return string\n \n def parse_commit(parser):\n-    global marks, blob_marks, parsed_refs\n-    global mode\n-\n     parents = []\n \n     ref = parser[1]\n@@ -661,8 +644,6 @@ def parse_commit(parser):\n     marks.new_mark(revid, commit_mark)\n \n def parse_reset(parser):\n-    global parsed_refs\n-\n     ref = parser[1]\n     parser.next()\n \n@@ -678,8 +659,6 @@ def parse_reset(parser):\n     parsed_refs[ref] = mark_to_rev(from_mark)\n \n def do_export(parser):\n-    global parsed_refs, dirname\n-\n     parser.next()\n \n     for line in parser.each_block('done'):\n@@ -728,8 +707,6 @@ def do_export(parser):\n     print\n \n def do_capabilities(parser):\n-    global dirname\n-\n     print \"import\"\n     print \"export\"\n     print \"refspec refs/heads/*:%s/heads/*\" % prefix\n@@ -747,8 +724,6 @@ def ref_is_valid(name):\n     return not True in [c in name for c in '~^: \\\\']\n \n def do_list(parser):\n-    global tags\n-\n     master_branch = None\n \n     for name in branches:\n@@ -782,8 +757,6 @@ def clone(path, remote_branch):\n     return remote_branch.sprout(bdir, repository=repo)\n \n def get_remote_branch(name):\n-    global dirname, branches\n-\n     remote_branch = bzrlib.branch.Branch.open(branches[name])\n     if isinstance(remote_branch.user_transport, bzrlib.transport.local.LocalTransport):\n         return remote_branch\n@@ -825,8 +798,6 @@ def find_branches(repo):\n             yield name, branch.base\n \n def get_repo(url, alias):\n-    global dirname, peer, branches\n-\n     normal_url = bzrlib.urlutils.normalize_url(url)\n     origin = bzrlib.bzrdir.BzrDir.open(url)\n     is_local = isinstance(origin.transport, bzrlib.transport.local.LocalTransport)\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 178a5a5..307d82c 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -227,8 +227,6 @@ class Parser:\n         return sys.stdin.read(size)\n \n     def get_author(self):\n-        global bad_mail\n-\n         ex = None\n         m = RAW_AUTHOR_RE.match(self.line)\n         if not m:\n@@ -261,8 +259,6 @@ def fix_file_path(path):\n     return os.path.relpath(path, '/')\n \n def export_files(files):\n-    global marks, filenodes\n-\n     final = []\n     for f in files:\n         fid = node.hex(f.filenode())\n@@ -344,8 +340,6 @@ def fixup_user_hg(user):\n     return (name, mail)\n \n def fixup_user(user):\n-    global mode, bad_mail\n-\n     if mode == 'git':\n         name, mail = fixup_user_git(user)\n     else:\n@@ -374,7 +368,7 @@ def updatebookmarks(repo, peer):\n         bookmarks.write(repo)\n \n def get_repo(url, alias):\n-    global dirname, peer\n+    global peer\n \n     myui = ui.ui()\n     myui.setconfig('ui', 'interactive', 'off')\n@@ -429,16 +423,12 @@ def get_repo(url, alias):\n     return repo\n \n def rev_to_mark(rev):\n-    global marks\n     return marks.from_rev(rev.hex())\n \n def mark_to_rev(mark):\n-    global marks\n     return marks.to_rev(mark)\n \n def export_ref(repo, name, kind, head):\n-    global prefix, marks, mode\n-\n     ename = '%s/%s' % (kind, name)\n     try:\n         tip = marks.get_tip(ename)\n@@ -550,12 +540,9 @@ def export_branch(repo, branch):\n     export_ref(repo, branch, 'branches', head)\n \n def export_head(repo):\n-    global g_head\n     export_ref(repo, g_head[0], 'bookmarks', g_head[1])\n \n def do_capabilities(parser):\n-    global prefix, dirname\n-\n     print \"import\"\n     print \"export\"\n     print \"refspec refs/heads/branches/*:%s/branches/*\" % prefix\n@@ -575,8 +562,6 @@ def branch_tip(branch):\n     return branches[branch][-1]\n \n def get_branch_tip(repo, branch):\n-    global branches\n-\n     heads = branches.get(hgref(branch), None)\n     if not heads:\n         return None\n@@ -589,7 +574,7 @@ def get_branch_tip(repo, branch):\n     return heads[0]\n \n def list_head(repo, cur):\n-    global g_head, bmarks, fake_bmark\n+    global g_head, fake_bmark\n \n     if 'default' not in branches:\n         # empty repo\n@@ -605,8 +590,6 @@ def list_head(repo, cur):\n     g_head = (head, node)\n \n def do_list(parser):\n-    global branches, bmarks, track_branches\n-\n     repo = parser.repo\n     for bmark, node in bookmarks.listbookmarks(repo).iteritems():\n         bmarks[bmark] = repo[node]\n@@ -674,8 +657,6 @@ def do_import(parser):\n     print 'done'\n \n def parse_blob(parser):\n-    global blob_marks\n-\n     parser.next()\n     mark = parser.get_mark()\n     parser.next()\n@@ -692,9 +673,6 @@ def get_merge_files(repo, p1, p2, files):\n             files[e] = f\n \n def parse_commit(parser):\n-    global marks, blob_marks, parsed_refs\n-    global mode\n-\n     from_mark = merge_mark = None\n \n     ref = parser[1]\n@@ -812,8 +790,6 @@ def parse_commit(parser):\n     marks.new_mark(node, commit_mark)\n \n def parse_reset(parser):\n-    global parsed_refs\n-\n     ref = parser[1]\n     parser.next()\n     # ugh\n@@ -1006,8 +982,6 @@ def check_tip(ref, kind, name, heads):\n         return tip in heads\n \n def do_export(parser):\n-    global parsed_refs, bmarks, peer\n-\n     p_bmarks = []\n     p_revs = {}\n \n-- \n1.8.4-fc\n"},{"id":"226103","messageId":"1377717793-27170-9-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"1377717793-27170-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 8/8] remote-hg: support for notes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T19:23:13Z","receivedAt":"2013-08-28T19:23:13Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 33 ++++++++++++++++++++++++++++++++-\n 1 file changed, 32 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 307d82c..0dbda75 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -23,6 +23,7 @@ import subprocess\n import urllib\n import atexit\n import urlparse, hashlib\n+import time as ptime\n \n #\n # If you are not in hg-git-compat mode and want to disable the tracking of\n@@ -126,6 +127,7 @@ class Marks:\n         self.rev_marks = {}\n         self.last_mark = 0\n         self.version = 0\n+        self.last_note = 0\n \n     def load(self):\n         if not os.path.exists(self.path):\n@@ -137,6 +139,7 @@ class Marks:\n         self.marks = tmp['marks']\n         self.last_mark = tmp['last-mark']\n         self.version = tmp.get('version', 1)\n+        self.last_note = tmp.get('last-note', 0)\n \n         for rev, mark in self.marks.iteritems():\n             self.rev_marks[mark] = rev\n@@ -150,7 +153,7 @@ class Marks:\n         self.version = 2\n \n     def dict(self):\n-        return { 'tips': self.tips, 'marks': self.marks, 'last-mark' : self.last_mark, 'version' : self.version }\n+        return { 'tips': self.tips, 'marks': self.marks, 'last-mark' : self.last_mark, 'version' : self.version, 'last-note' : self.last_note }\n \n     def store(self):\n         json.dump(self.dict(), open(self.path, 'w'))\n@@ -525,6 +528,31 @@ def export_ref(repo, name, kind, head):\n     print \"from :%u\" % rev_to_mark(head)\n     print\n \n+    pending_revs = set(revs) - notes\n+    if pending_revs:\n+        note_mark = marks.next_mark()\n+        ref = \"refs/notes/hg\"\n+\n+        print \"commit %s\" % ref\n+        print \"mark :%d\" % (note_mark)\n+        print \"committer remote-hg <> %s\" % (ptime.strftime('%s %z'))\n+        desc = \"Notes for %s\\n\" % (name)\n+        print \"data %d\" % (len(desc))\n+        print desc\n+        if marks.last_note:\n+            print \"from :%u\" % marks.last_note\n+\n+        for rev in pending_revs:\n+            notes.add(rev)\n+            c = repo[rev]\n+            print \"N inline :%u\" % rev_to_mark(c)\n+            msg = c.hex()\n+            print \"data %d\" % (len(msg))\n+            print msg\n+        print\n+\n+        marks.last_note = note_mark\n+\n     marks.set_tip(ename, head.hex())\n \n def export_tag(repo, tag):\n@@ -629,6 +657,7 @@ def do_import(parser):\n         print \"feature import-marks=%s\" % path\n     print \"feature export-marks=%s\" % path\n     print \"feature force\"\n+    print \"feature notes\"\n     sys.stdout.flush()\n \n     tmp = encoding.encoding\n@@ -1126,6 +1155,7 @@ def main(args):\n     global filenodes\n     global fake_bmark, hg_version\n     global dry_run\n+    global notes, alias\n \n     alias = args[1]\n     url = args[2]\n@@ -1165,6 +1195,7 @@ def main(args):\n     except:\n         hg_version = None\n     dry_run = False\n+    notes = set()\n \n     repo = get_repo(url, alias)\n     prefix = 'refs/hg/%s' % alias\n-- \n1.8.4-fc\n"},{"id":"226107","messageId":"vpqhae97f8j.fsf@anie.imag.fr","threadId":"34789","inReplyTo":"1377717793-27170-2-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-28T20:05:48Z","receivedAt":"2013-08-28T20:05:48Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> +\techo greg >> content &&\n> +\tgit add content &&\n> +\tgit commit -m one\n\ntest_commit would make it shorter.\n\n> +\tbzr log | grep \"^committer: \" > ../actual\n> +\t) &&\n> +\n> +\techo \"committer: Grégoire <committer@example.com>\" > expected &&\n\nGit's source code usually says >../actual and >expected, without space\nafter '>'.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"226111","messageId":"CAPig+cSt6HCuB2VOj_-C+e7BeXJD72hKdtNN3ueyKn6B4DSu7A@mail.gmail.com","threadId":"34789","inReplyTo":"1377717793-27170-2-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-08-28T20:35:54Z","receivedAt":"2013-08-28T20:35:54Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Aug 28, 2013 at 3:23 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> Reported-by: Joakim Verona <joakim@verona.se>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  contrib/remote-helpers/git-remote-bzr |  1 +\n>  contrib/remote-helpers/test-bzr.sh    | 30 ++++++++++++++++++++++++++++++\n>  2 files changed, 31 insertions(+)\n>\n> diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh\n> index dce281f..ef8992a 100755\n> --- a/contrib/remote-helpers/test-bzr.sh\n> +++ b/contrib/remote-helpers/test-bzr.sh\n> @@ -358,4 +358,34 @@ test_expect_success 'strip' '\n>         test_cmp expected actual\n>  '\n>\n> +test_expect_success 'export utf-8 authors' '\n> +       test_when_finished \"rm -rf bzrrepo gitrepo && LC_ALL=C && unset GIT_COMMITTER_NAME\" &&\n> +\n> +       LC_ALL=en_US.UTF-8\n> +       export LC_ALL\n> +\n> +       GIT_COMMITTER_NAME=\"Grégoire\"\n> +       export GIT_COMMITTER_NAME\n> +\n> +       bzr init bzrrepo &&\n> +\n> +       (\n> +       git init gitrepo &&\n> +       cd gitrepo &&\n> +       echo greg >> content &&\n> +       git add content &&\n> +       git commit -m one\n\nBroken &&-chain.\n\n> +       git remote add bzr \"bzr::../bzrrepo\" &&\n> +       git push bzr\n> +       ) &&\n> +\n> +       (\n> +       cd bzrrepo &&\n> +       bzr log | grep \"^committer: \" > ../actual\n> +       ) &&\n> +\n> +       echo \"committer: Grégoire <committer@example.com>\" > expected &&\n> +       test_cmp expected actual\n> +'\n> +\n>  test_done\n> --\n"},{"id":"226112","messageId":"CAMP44s2bu9gUE=McYq1prhjC3O2CRj1W_Yc+-CjTkk6Gc3JFTw@mail.gmail.com","threadId":"34789","inReplyTo":"vpqhae97f8j.fsf@anie.imag.fr","subject":"Re: [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T20:48:34Z","receivedAt":"2013-08-28T20:48:34Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Aug 28, 2013 at 3:05 PM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> +     echo greg >> content &&\n>> +     git add content &&\n>> +     git commit -m one\n>\n> test_commit would make it shorter.\n\nAnd it would make it inconsistent with the rest of the script.\n\n>> +     bzr log | grep \"^committer: \" > ../actual\n>> +     ) &&\n>> +\n>> +     echo \"committer: Grégoire <committer@example.com>\" > expected &&\n>\n> Git's source code usually says >../actual and >expected, without space\n> after '>'.\n\nNot that usually:\n\n% git grep ' > ' t/*.sh | wc -l\n1943\n\n-- \nFelipe Contreras\n"},{"id":"226113","messageId":"CALWbr2xi1+EKHry4GRwLv=SwRUsaTKLQc6RUfuPKEre4pcpaFg@mail.gmail.com","threadId":"34789","inReplyTo":"CAMP44s2bu9gUE=McYq1prhjC3O2CRj1W_Yc+-CjTkk6Gc3JFTw@mail.gmail.com","subject":"Re: [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-08-28T20:54:41Z","receivedAt":"2013-08-28T20:54:41Z","isPatch":true,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"On Wed, Aug 28, 2013 at 10:48 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> On Wed, Aug 28, 2013 at 3:05 PM, Matthieu Moy\n> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>\n>>> +     echo greg >> content &&\n>>> +     git add content &&\n>>> +     git commit -m one\n>>\n>> test_commit would make it shorter.\n>\n> And it would make it inconsistent with the rest of the script.\n>\n>>> +     bzr log | grep \"^committer: \" > ../actual\n>>> +     ) &&\n>>> +\n>>> +     echo \"committer: Grégoire <committer@example.com>\" > expected &&\n>>\n>> Git's source code usually says >../actual and >expected, without space\n>> after '>'.\n>\n> Not that usually:\n>\n> % git grep ' > ' t/*.sh | wc -l\n> 1943\n\nThere are many false positive in that count.\n\nAs in this one:\n$ git grep ' >[^ ]' -- t/*.sh | wc -l\n10354\n"},{"id":"226115","messageId":"vpqy57l4jcx.fsf@anie.imag.fr","threadId":"34789","inReplyTo":"CAMP44s2bu9gUE=McYq1prhjC3O2CRj1W_Yc+-CjTkk6Gc3JFTw@mail.gmail.com","subject":"Re: [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-28T21:05:02Z","receivedAt":"2013-08-28T21:05:02Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Wed, Aug 28, 2013 at 3:05 PM, Matthieu Moy\n> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>\n>>> +     bzr log | grep \"^committer: \" > ../actual\n>>> +     ) &&\n>>> +\n>>> +     echo \"committer: Grégoire <committer@example.com>\" > expected &&\n>>\n>> Git's source code usually says >../actual and >expected, without space\n>> after '>'.\n>\n> Not that usually:\n>\n> % git grep ' > ' t/*.sh | wc -l\n> 1943\n\nDo I really need to quote the paragraph in CodingGuidelines?\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"226117","messageId":"1377724480-18649-1-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"CAPig+cSt6HCuB2VOj_-C+e7BeXJD72hKdtNN3ueyKn6B4DSu7A@mail.gmail.com","subject":"[PATCH v2] remote-bzr: fix export of utf-8 authors","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T21:14:40Z","receivedAt":"2013-08-28T21:14:40Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Reported-by: Joakim Verona <joakim@verona.se>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr |  1 +\n contrib/remote-helpers/test-bzr.sh    | 30 ++++++++++++++++++++++++++++++\n 2 files changed, 31 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex c3a3cac..08b0b61 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -168,6 +168,7 @@ class Parser:\n         if not m:\n             return None\n         _, name, email, date, tz = m.groups()\n+        name = name.decode('utf-8')\n         committer = '%s <%s>' % (name, email)\n         tz = int(tz)\n         tz = ((tz / 100) * 3600) + ((tz % 100) * 60)\ndiff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh\nindex dce281f..b0d70fd 100755\n--- a/contrib/remote-helpers/test-bzr.sh\n+++ b/contrib/remote-helpers/test-bzr.sh\n@@ -358,4 +358,34 @@ test_expect_success 'strip' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'export utf-8 authors' '\n+\ttest_when_finished \"rm -rf bzrrepo gitrepo && LC_ALL=C && unset GIT_COMMITTER_NAME\" &&\n+\n+\tLC_ALL=en_US.UTF-8\n+\texport LC_ALL\n+\n+\tGIT_COMMITTER_NAME=\"Grégoire\"\n+\texport GIT_COMMITTER_NAME\n+\n+\tbzr init bzrrepo &&\n+\n+\t(\n+\tgit init gitrepo &&\n+\tcd gitrepo &&\n+\techo greg >> content &&\n+\tgit add content &&\n+\tgit commit -m one &&\n+\tgit remote add bzr \"bzr::../bzrrepo\" &&\n+\tgit push bzr\n+\t) &&\n+\n+\t(\n+\tcd bzrrepo &&\n+\tbzr log | grep \"^committer: \" > ../actual\n+\t) &&\n+\n+\techo \"committer: Grégoire <committer@example.com>\" > expected &&\n+\ttest_cmp expected actual\n+'\n+\n test_done\n-- \n1.8.4-fc-3-g64bc480\n"},{"id":"226118","messageId":"CAMP44s2G0Nm56q30EXgjpatsJhQZgiJ6uxr83o_74TsUAnHt3w@mail.gmail.com","threadId":"34789","inReplyTo":"CALWbr2xi1+EKHry4GRwLv=SwRUsaTKLQc6RUfuPKEre4pcpaFg@mail.gmail.com","subject":"Re: [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T21:21:02Z","receivedAt":"2013-08-28T21:21:02Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Aug 28, 2013 at 3:54 PM, Antoine Pelisse <apelisse@gmail.com> wrote:\n> On Wed, Aug 28, 2013 at 10:48 PM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>> On Wed, Aug 28, 2013 at 3:05 PM, Matthieu Moy\n>> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>>\n>>>> +     echo greg >> content &&\n>>>> +     git add content &&\n>>>> +     git commit -m one\n>>>\n>>> test_commit would make it shorter.\n>>\n>> And it would make it inconsistent with the rest of the script.\n>>\n>>>> +     bzr log | grep \"^committer: \" > ../actual\n>>>> +     ) &&\n>>>> +\n>>>> +     echo \"committer: Grégoire <committer@example.com>\" > expected &&\n>>>\n>>> Git's source code usually says >../actual and >expected, without space\n>>> after '>'.\n>>\n>> Not that usually:\n>>\n>> % git grep ' > ' t/*.sh | wc -l\n>> 1943\n>\n> There are many false positive in that count.\n>\n> As in this one:\n> $ git grep ' >[^ ]' -- t/*.sh | wc -l\n> 10354\n\nTen thousand is still a lot, and the claim remains: it's far from\nunusual to follow this style.\n\n-- \nFelipe Contreras\n"},{"id":"226119","messageId":"CAMP44s2HydaSUe-VH9yf_6fo0jYqntKGnvQ2DxgYoNpw92SkMw@mail.gmail.com","threadId":"34789","inReplyTo":"vpqy57l4jcx.fsf@anie.imag.fr","subject":"Re: [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T21:21:41Z","receivedAt":"2013-08-28T21:21:41Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Aug 28, 2013 at 4:05 PM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> On Wed, Aug 28, 2013 at 3:05 PM, Matthieu Moy\n>> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>>\n>>>> +     bzr log | grep \"^committer: \" > ../actual\n>>>> +     ) &&\n>>>> +\n>>>> +     echo \"committer: Grégoire <committer@example.com>\" > expected &&\n>>>\n>>> Git's source code usually says >../actual and >expected, without space\n>>> after '>'.\n>>\n>> Not that usually:\n>>\n>> % git grep ' > ' t/*.sh | wc -l\n>> 1943\n>\n> Do I really need to quote the paragraph in CodingGuidelines?\n\nDo I need to explain what a guideline is?\n\n-- \nFelipe Contreras\n"},{"id":"226120","messageId":"CAMP44s1P1NgusfH4oS4y-NNCXsNNrECSd5je01D6HL_=p7OHBw@mail.gmail.com","threadId":"34789","inReplyTo":"CAMP44s2G0Nm56q30EXgjpatsJhQZgiJ6uxr83o_74TsUAnHt3w@mail.gmail.com","subject":"Re: [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T21:38:54Z","receivedAt":"2013-08-28T21:38:54Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Aug 28, 2013 at 4:21 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> On Wed, Aug 28, 2013 at 3:54 PM, Antoine Pelisse <apelisse@gmail.com> wrote:\n>> On Wed, Aug 28, 2013 at 10:48 PM, Felipe Contreras\n>> <felipe.contreras@gmail.com> wrote:\n>>> On Wed, Aug 28, 2013 at 3:05 PM, Matthieu Moy\n>>> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>>>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>>>\n>>>>> +     echo greg >> content &&\n>>>>> +     git add content &&\n>>>>> +     git commit -m one\n>>>>\n>>>> test_commit would make it shorter.\n>>>\n>>> And it would make it inconsistent with the rest of the script.\n>>>\n>>>>> +     bzr log | grep \"^committer: \" > ../actual\n>>>>> +     ) &&\n>>>>> +\n>>>>> +     echo \"committer: Grégoire <committer@example.com>\" > expected &&\n>>>>\n>>>> Git's source code usually says >../actual and >expected, without space\n>>>> after '>'.\n>>>\n>>> Not that usually:\n>>>\n>>> % git grep ' > ' t/*.sh | wc -l\n>>> 1943\n>>\n>> There are many false positive in that count.\n>>\n>> As in this one:\n>> $ git grep ' >[^ ]' -- t/*.sh | wc -l\n>> 10354\n>\n> Ten thousand is still a lot, and the claim remains: it's far from\n> unusual to follow this style.\n\nEr, I read that command wrong, but whatever the actual number is, the\npoint is that there's a lot.\n\nIn fact, I could only count 43 false positives in that command:\n\nt/annotate-tests.sh:test_expect_success 'blame -L X (X > nlines)' '\nt/annotate-tests.sh:test_expect_success 'blame -L ,Y (Y > nlines)' '\nt/lib-diff-alternative.sh:    if(n > 1)\nt/lib-diff-alternative.sh:    if(n > 2)\nt/lib-diff-alternative.sh:+    if(n > 2)\nt/lib-diff-alternative.sh:-    if(n > 1)\nt/t3800-mktag.sh: > 0 +0000\nt/t4041-diff-submodule-option.sh:  > Add foo3 ($added foo3)\nt/t4041-diff-submodule-option.sh:  > Add foo3 ($added foo3)\nt/t4041-diff-submodule-option.sh:  > Add foo3 ($added foo3)\nt/t4041-diff-submodule-option.sh:  > Add foo5 ($added foo5)\nt/t4041-diff-submodule-option.sh:  > Add foo4 ($added foo4)\nt/t4041-diff-submodule-option.sh:  > change\nt/t4041-diff-submodule-option.sh:  > change\nt/t4041-diff-submodule-option.sh:  > change\nt/t4041-diff-submodule-option.sh:  > change\nt/t4041-diff-submodule-option.sh:  > change\nt/t4041-diff-submodule-option.sh:  > change\nt/t4041-diff-submodule-option.sh:  > change\nt/t4041-diff-submodule-option.sh:  > change\nt/t7401-submodule-summary.sh:  > Add foo2\nt/t7401-submodule-summary.sh:  > Add foo2\nt/t7401-submodule-summary.sh:  > Add foo2\nt/t7401-submodule-summary.sh:  > Add foo3\nt/t7401-submodule-summary.sh:  > Add foo3\nt/t7401-submodule-summary.sh:  > Add foo5\nt/t7401-submodule-summary.sh:  > Add foo4\nt/t7401-submodule-summary.sh:  > Add foo5\nt/t7401-submodule-summary.sh:  > Add foo4\nt/t7401-submodule-summary.sh:  > Add foo5\nt/t7401-submodule-summary.sh:  > Add foo7\nt/t7401-submodule-summary.sh:  > Add foo9\nt/t7401-submodule-summary.sh:  > Add foo9\nt/t7401-submodule-summary.sh:  > Add foo9\nt/t7401-submodule-summary.sh:#   > Add foo9\nt/t7508-status.sh:#   > Add foo\nt/t7508-status.sh:#   > Add foo\nt/t7508-status.sh:#   > Add bar\nt/t7508-status.sh:#   > Add bar\nt/t7508-status.sh:#   > Add bar\nt/t7508-status.sh:#   > 2nd commit\nt/t7508-status.sh:;   > Add bar\nt/t7508-status.sh:;   > 2nd commit\n\n-- \nFelipe Contreras\n"},{"id":"226124","messageId":"xmqq7gf58okw.fsf@gitster.dls.corp.google.com","threadId":"34789","inReplyTo":"vpqy57l4jcx.fsf@anie.imag.fr","subject":"Re: [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-28T21:58:39Z","receivedAt":"2013-08-28T21:58:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> On Wed, Aug 28, 2013 at 3:05 PM, Matthieu Moy\n>> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>>\n>>>> +     bzr log | grep \"^committer: \" > ../actual\n>>>> +     ) &&\n>>>> +\n>>>> +     echo \"committer: Grégoire <committer@example.com>\" > expected &&\n>>>\n>>> Git's source code usually says >../actual and >expected, without space\n>>> after '>'.\n>>\n>> Not that usually:\n>>\n>> % git grep ' > ' t/*.sh | wc -l\n>> 1943\n>\n> Do I really need to quote the paragraph in CodingGuidelines?\n\nExisting violations are not an excuse to make things worse by adding\nmore.  I think with these comments we can expect a reroll coming,\nand it should be trivial for any contributor to fix it while at it.\n"},{"id":"226127","messageId":"CAMP44s0t71X8dhTVmeEoGEbgsUiVWsKYe5eYj=tCN0oB96cSqQ@mail.gmail.com","threadId":"34789","inReplyTo":"xmqq7gf58okw.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-28T22:25:58Z","receivedAt":"2013-08-28T22:25:58Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Aug 28, 2013 at 4:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>\n>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>\n>>> On Wed, Aug 28, 2013 at 3:05 PM, Matthieu Moy\n>>> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>>>\n>>>>> +     bzr log | grep \"^committer: \" > ../actual\n>>>>> +     ) &&\n>>>>> +\n>>>>> +     echo \"committer: Grégoire <committer@example.com>\" > expected &&\n>>>>\n>>>> Git's source code usually says >../actual and >expected, without space\n>>>> after '>'.\n>>>\n>>> Not that usually:\n>>>\n>>> % git grep ' > ' t/*.sh | wc -l\n>>> 1943\n>>\n>> Do I really need to quote the paragraph in CodingGuidelines?\n>\n> Existing violations are not an excuse to make things worse by adding\n> more.\n\n1)\n\nBy definition following a guideline is not mandatory:\nhttps://en.wikipedia.org/wiki/Guideline\n\nViolation is a too strong word for not following something that is not\nmandatory in the first place; deviation is a more appropriate word.\n\n2)\n\nThis code is part of the 'contrib' area, and part of the tests, most\nof the code in this area doesn't even have tests.\n\n3)\n\nBlindly following guidelines is not a good idea.\n\ncmd >out\ncmd >out 2>err\nif (n > 1)\ncmd1 | cmd2\n\nClearly, those are inconsistent.\n\ncmd > out\ncmd > out 2> err\nif (n > 1)\ncmd1 | cmd2\n\nThose are not.\n\nFortunately since these rules are only guidelines, there's no need to\nengage in bike-sheding argumentation if the code deviates from\nguideline, specially for this insignificantly trivial issue.\n\nBlocking a patch that would be obviously advantageous for the users on\nthe basis of a single white-space on the tests which aren't even run\nby default is simply stupid.\n\n> I think with these comments we can expect a reroll coming,\n> and it should be trivial for any contributor to fix it while at it.\n\nI already send the update, I do not see the need for any more changes,\nso no more changes will come from me unless there is valid feedback.\n\nIf it makes you happier, apply this:\n\nFrom 7db40fa6b2780f9b5787c7d38f0d2dac01b175d3 Mon Sep 17 00:00:00 2001\nFrom: Felipe Contreras <felipe.contreras@gmail.com>\nDate: Sun, 4 Aug 2013 19:27:51 -0500\nSubject: [PATCH] remote-bzr: fix export of utf-8 authors\n\nReported-by: Joakim Verona <joakim@verona.se>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr\nb/contrib/remote-helpers/git-remote-bzr\nindex c3a3cac..08b0b61 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -168,6 +168,7 @@ class Parser:\n         if not m:\n             return None\n         _, name, email, date, tz = m.groups()\n+        name = name.decode('utf-8')\n         committer = '%s <%s>' % (name, email)\n         tz = int(tz)\n         tz = ((tz / 100) * 3600) + ((tz % 100) * 60)\n-- \n1.8.4-fc-3-g64bc480\n\nThere, there is no more test GUIDEline \"violation\".\n\n-- \nFelipe Contreras\n"},{"id":"226234","messageId":"xmqqa9k049qc.fsf@gitster.dls.corp.google.com","threadId":"34789","inReplyTo":"1377717793-27170-9-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 8/8] remote-hg: support for notes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-29T18:45:15Z","receivedAt":"2013-08-29T18:45:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> @@ -629,6 +657,7 @@ def do_import(parser):\n>          print \"feature import-marks=%s\" % path\n>      print \"feature export-marks=%s\" % path\n>      print \"feature force\"\n> +    print \"feature notes\"\n\nThe remaining patches in the series seem reasonable, but this patch\nseems to rely on an undefined feature \"notes\", whose design has not\nbeen discussed here.  Will queue without this one for now.\n"},{"id":"226266","messageId":"xmqqhae82nsb.fsf_-_@gitster.dls.corp.google.com","threadId":"34789","inReplyTo":"xmqq7gf58okw.fsf@gitster.dls.corp.google.com","subject":"Re* [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-29T21:24:36Z","receivedAt":"2013-08-29T21:24:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>\n>> Do I really need to quote the paragraph in CodingGuidelines?\n>\n> Existing violations are not an excuse to make things worse by adding\n> more.  I think with these comments we can expect a reroll coming,\n> and it should be trivial for any contributor to fix it while at it.\n\nActually, I think not fixing it inside that 1/8 is good, as there\nare many existing \"cmd > file\" (and worse, \"cmd > file-$x\") in these\ntest-*.sh scripts.  Clean-up is better done as a follow-up patch.\n\nHere are two that I noticed.\n\n-- >8 --\nSubject: [PATCH 9/8] contrib/remote-helpers: style updates for test scripts\n\nDuring the review of the main series it was noticed that these test\nscripts can use updates to conform to our coding style better, but\nfixing the style should be done in a patch separate from the main\nseries.\n\nThis updates the test-*.sh scripts only for styles:\n\n * We do not leave SP between a redirection operator and the\n   filename;\n\n * We change line before \"then\", \"do\", etc. rather than terminating\n   the condition for \"if\"/\"while\" and list for \"for\" with a\n   semicolon;\n\n * When HERE document does not use any expansion, we quote the end\n   marker (e.g. \"cat <<\\EOF\" not \"cat <<EOF\") to signal the readers\n   that there is no funny substitution to worry about when reading\n   the code.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n contrib/remote-helpers/test-bzr.sh       | 112 +++++++++++-----------\n contrib/remote-helpers/test-hg-bidi.sh   |  52 ++++++-----\n contrib/remote-helpers/test-hg-hg-git.sh | 156 +++++++++++++++++--------------\n contrib/remote-helpers/test-hg.sh        | 154 +++++++++++++++---------------\n 4 files changed, 248 insertions(+), 226 deletions(-)\n\ndiff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh\nindex b0d70fd..5c50251 100755\n--- a/contrib/remote-helpers/test-bzr.sh\n+++ b/contrib/remote-helpers/test-bzr.sh\n@@ -7,19 +7,21 @@ test_description='Test remote-bzr'\n \n . ./test-lib.sh\n \n-if ! test_have_prereq PYTHON; then\n+if ! test_have_prereq PYTHON\n+then\n \tskip_all='skipping remote-bzr tests; python not available'\n \ttest_done\n fi\n \n-if ! python -c 'import bzrlib'; then\n+if ! python -c 'import bzrlib'\n+then\n \tskip_all='skipping remote-bzr tests; bzr not available'\n \ttest_done\n fi\n \n check () {\n-\techo $3 > expected &&\n-\tgit --git-dir=$1/.git log --format='%s' -1 $2 > actual\n+\techo $3 >expected &&\n+\tgit --git-dir=$1/.git log --format='%s' -1 $2 >actual\n \ttest_cmp expected actual\n }\n \n@@ -29,7 +31,7 @@ test_expect_success 'cloning' '\n \t(\n \tbzr init bzrrepo &&\n \tcd bzrrepo &&\n-\techo one > content &&\n+\techo one >content &&\n \tbzr add content &&\n \tbzr commit -m one\n \t) &&\n@@ -41,7 +43,7 @@ test_expect_success 'cloning' '\n test_expect_success 'pulling' '\n \t(\n \tcd bzrrepo &&\n-\techo two > content &&\n+\techo two >content &&\n \tbzr commit -m two\n \t) &&\n \n@@ -53,13 +55,13 @@ test_expect_success 'pulling' '\n test_expect_success 'pushing' '\n \t(\n \tcd gitrepo &&\n-\techo three > content &&\n+\techo three >content &&\n \tgit commit -a -m three &&\n \tgit push\n \t) &&\n \n-\techo three > expected &&\n-\tcat bzrrepo/content > actual &&\n+\techo three >expected &&\n+\tcat bzrrepo/content >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -67,16 +69,16 @@ test_expect_success 'roundtrip' '\n \t(\n \tcd gitrepo &&\n \tgit pull &&\n-\tgit log --format=\"%s\" -1 origin/master > actual\n+\tgit log --format=\"%s\" -1 origin/master >actual\n \t) &&\n-\techo three > expected &&\n+\techo three >expected &&\n \ttest_cmp expected actual &&\n \n \t(cd gitrepo && git push && git pull) &&\n \n \t(\n \tcd bzrrepo &&\n-\techo four > content &&\n+\techo four >content &&\n \tbzr commit -m four\n \t) &&\n \n@@ -86,19 +88,19 @@ test_expect_success 'roundtrip' '\n \n \t(\n \tcd gitrepo &&\n-\techo five > content &&\n+\techo five >content &&\n \tgit commit -a -m five &&\n \tgit push && git pull\n \t) &&\n \n \t(cd bzrrepo && bzr revert) &&\n \n-\techo five > expected &&\n-\tcat bzrrepo/content > actual &&\n+\techo five >expected &&\n+\tcat bzrrepo/content >actual &&\n \ttest_cmp expected actual\n '\n \n-cat > expected <<EOF\n+cat >expected <<\\EOF\n 100644 blob 54f9d6da5c91d556e6b54340b1327573073030af\tcontent\n 100755 blob 68769579c3eaadbe555379b9c3538e6628bae1eb\texecutable\n 120000 blob 6b584e8ece562ebffc15d38808cd6b98fc3d97ea\tlink\n@@ -107,7 +109,7 @@ EOF\n test_expect_success 'special modes' '\n \t(\n \tcd bzrrepo &&\n-\techo exec > executable\n+\techo exec >executable\n \tchmod +x executable &&\n \tbzr add executable\n \tbzr commit -m exec &&\n@@ -122,21 +124,21 @@ test_expect_success 'special modes' '\n \t(\n \tcd gitrepo &&\n \tgit pull\n-\tgit ls-tree HEAD > ../actual\n+\tgit ls-tree HEAD >../actual\n \t) &&\n \n \ttest_cmp expected actual &&\n \n \t(\n \tcd gitrepo &&\n-\tgit cat-file -p HEAD:link > ../actual\n+\tgit cat-file -p HEAD:link >../actual\n \t) &&\n \n-\tprintf content > expected &&\n+\tprintf content >expected &&\n \ttest_cmp expected actual\n '\n \n-cat > expected <<EOF\n+cat >expected <<\\EOF\n 100644 blob 54f9d6da5c91d556e6b54340b1327573073030af\tcontent\n 100755 blob 68769579c3eaadbe555379b9c3538e6628bae1eb\texecutable\n 120000 blob 6b584e8ece562ebffc15d38808cd6b98fc3d97ea\tlink\n@@ -147,8 +149,8 @@ test_expect_success 'moving directory' '\n \t(\n \tcd bzrrepo &&\n \tmkdir movedir &&\n-\techo one > movedir/one &&\n-\techo two > movedir/two &&\n+\techo one >movedir/one &&\n+\techo two >movedir/two &&\n \tbzr add movedir &&\n \tbzr commit -m movedir &&\n \tbzr mv movedir movedir-new &&\n@@ -158,7 +160,7 @@ test_expect_success 'moving directory' '\n \t(\n \tcd gitrepo &&\n \tgit pull &&\n-\tgit ls-tree HEAD > ../actual\n+\tgit ls-tree HEAD >../actual\n \t) &&\n \n \ttest_cmp expected actual\n@@ -167,7 +169,7 @@ test_expect_success 'moving directory' '\n test_expect_success 'different authors' '\n \t(\n \tcd bzrrepo &&\n-\techo john >> content &&\n+\techo john >>content &&\n \tbzr commit -m john \\\n \t  --author \"Jane Rey <jrey@example.com>\" \\\n \t  --author \"John Doe <jdoe@example.com>\"\n@@ -176,10 +178,10 @@ test_expect_success 'different authors' '\n \t(\n \tcd gitrepo &&\n \tgit pull &&\n-\tgit show --format=\"%an <%ae>, %cn <%ce>\" --quiet > ../actual\n+\tgit show --format=\"%an <%ae>, %cn <%ce>\" --quiet >../actual\n \t) &&\n \n-\techo \"Jane Rey <jrey@example.com>, A U Thor <author@example.com>\" > expected &&\n+\techo \"Jane Rey <jrey@example.com>, A U Thor <author@example.com>\" >expected &&\n \ttest_cmp expected actual\n '\n \n@@ -196,12 +198,12 @@ test_expect_success 'fetch utf-8 filenames' '\n \tbzr init bzrrepo &&\n \tcd bzrrepo &&\n \n-\techo test >> \"ærø\" &&\n+\techo test >>\"ærø\" &&\n \tbzr add \"ærø\" &&\n-\techo test >> \"ø~?\" &&\n+\techo test >>\"ø~?\" &&\n \tbzr add \"ø~?\" &&\n \tbzr commit -m add-utf-8 &&\n-\techo test >> \"ærø\" &&\n+\techo test >>\"ærø\" &&\n \tbzr commit -m test-utf-8 &&\n \tbzr rm \"ø~?\" &&\n \tbzr mv \"ærø\" \"ø~?\" &&\n@@ -211,9 +213,9 @@ test_expect_success 'fetch utf-8 filenames' '\n \t(\n \tgit clone \"bzr::bzrrepo\" gitrepo &&\n \tcd gitrepo &&\n-\tgit -c core.quotepath=false ls-files > ../actual\n+\tgit -c core.quotepath=false ls-files >../actual\n \t) &&\n-\techo \"ø~?\" > expected &&\n+\techo \"ø~?\" >expected &&\n \ttest_cmp expected actual\n '\n \n@@ -229,7 +231,7 @@ test_expect_success 'push utf-8 filenames' '\n \tbzr init bzrrepo &&\n \tcd bzrrepo &&\n \n-\techo one >> content &&\n+\techo one >>content &&\n \tbzr add content &&\n \tbzr commit -m one\n \t) &&\n@@ -238,15 +240,15 @@ test_expect_success 'push utf-8 filenames' '\n \tgit clone \"bzr::bzrrepo\" gitrepo &&\n \tcd gitrepo &&\n \n-\techo test >> \"ærø\" &&\n+\techo test >>\"ærø\" &&\n \tgit add \"ærø\" &&\n \tgit commit -m utf-8 &&\n \n \tgit push\n \t) &&\n \n-\t(cd bzrrepo && bzr ls > ../actual) &&\n-\tprintf \"content\\nærø\\n\" > expected &&\n+\t(cd bzrrepo && bzr ls >../actual) &&\n+\tprintf \"content\\nærø\\n\" >expected &&\n \ttest_cmp expected actual\n '\n \n@@ -256,7 +258,7 @@ test_expect_success 'pushing a merge' '\n \t(\n \tbzr init bzrrepo &&\n \tcd bzrrepo &&\n-\techo one > content &&\n+\techo one >content &&\n \tbzr add content &&\n \tbzr commit -m one\n \t) &&\n@@ -265,27 +267,27 @@ test_expect_success 'pushing a merge' '\n \n \t(\n \tcd bzrrepo &&\n-\techo two > content &&\n+\techo two >content &&\n \tbzr commit -m two\n \t) &&\n \n \t(\n \tcd gitrepo &&\n-\techo three > content &&\n+\techo three >content &&\n \tgit commit -a -m three &&\n \tgit fetch &&\n \tgit merge origin/master || true &&\n-\techo three > content &&\n+\techo three >content &&\n \tgit commit -a --no-edit &&\n \tgit push\n \t) &&\n \n-\techo three > expected &&\n-\tcat bzrrepo/content > actual &&\n+\techo three >expected &&\n+\tcat bzrrepo/content >actual &&\n \ttest_cmp expected actual\n '\n \n-cat > expected <<EOF\n+cat >expected <<\\EOF\n origin/HEAD\n origin/branch\n origin/trunk\n@@ -299,7 +301,7 @@ test_expect_success 'proper bzr repo' '\n \t(\n \tbzr init bzrrepo/trunk &&\n \tcd bzrrepo/trunk &&\n-\techo one >> content &&\n+\techo one >>content &&\n \tbzr add content &&\n \tbzr commit -m one\n \t) &&\n@@ -307,14 +309,14 @@ test_expect_success 'proper bzr repo' '\n \t(\n \tbzr branch bzrrepo/trunk bzrrepo/branch &&\n \tcd bzrrepo/branch &&\n-\techo two >> content &&\n+\techo two >>content &&\n \tbzr commit -m one\n \t) &&\n \n \t(\n \tgit clone \"bzr::bzrrepo\" gitrepo &&\n \tcd gitrepo &&\n-\tgit for-each-ref --format \"%(refname:short)\" refs/remotes/origin > ../actual\n+\tgit for-each-ref --format \"%(refname:short)\" refs/remotes/origin >../actual\n \t) &&\n \n \ttest_cmp expected actual\n@@ -327,11 +329,11 @@ test_expect_success 'strip' '\n \tbzr init bzrrepo &&\n \tcd bzrrepo &&\n \n-\techo one >> content &&\n+\techo one >>content &&\n \tbzr add content &&\n \tbzr commit -m one &&\n \n-\techo two >> content &&\n+\techo two >>content &&\n \tbzr commit -m two\n \t) &&\n \n@@ -341,18 +343,18 @@ test_expect_success 'strip' '\n \tcd bzrrepo &&\n \tbzr uncommit --force &&\n \n-\techo three >> content &&\n+\techo three >>content &&\n \tbzr commit -m three &&\n \n-\techo four >> content &&\n+\techo four >>content &&\n \tbzr commit -m four &&\n-\tbzr log --line | sed -e \"s/^[0-9][0-9]*: //\" > ../expected\n+\tbzr log --line | sed -e \"s/^[0-9][0-9]*: //\" >../expected\n \t) &&\n \n \t(\n \tcd gitrepo &&\n \tgit fetch &&\n-\tgit log --format=\"%an %ad %s\" --date=short origin/master > ../actual\n+\tgit log --format=\"%an %ad %s\" --date=short origin/master >../actual\n \t) &&\n \n \ttest_cmp expected actual\n@@ -372,7 +374,7 @@ test_expect_success 'export utf-8 authors' '\n \t(\n \tgit init gitrepo &&\n \tcd gitrepo &&\n-\techo greg >> content &&\n+\techo greg >>content &&\n \tgit add content &&\n \tgit commit -m one &&\n \tgit remote add bzr \"bzr::../bzrrepo\" &&\n@@ -381,10 +383,10 @@ test_expect_success 'export utf-8 authors' '\n \n \t(\n \tcd bzrrepo &&\n-\tbzr log | grep \"^committer: \" > ../actual\n+\tbzr log | grep \"^committer: \" >../actual\n \t) &&\n \n-\techo \"committer: Grégoire <committer@example.com>\" > expected &&\n+\techo \"committer: Grégoire <committer@example.com>\" >expected &&\n \ttest_cmp expected actual\n '\n \ndiff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.sh\nindex f83d67d..e24c51d 100755\n--- a/contrib/remote-helpers/test-hg-bidi.sh\n+++ b/contrib/remote-helpers/test-hg-bidi.sh\n@@ -10,12 +10,14 @@ test_description='Test bidirectionality of remote-hg'\n \n . ./test-lib.sh\n \n-if ! test_have_prereq PYTHON; then\n+if ! test_have_prereq PYTHON\n+then\n \tskip_all='skipping remote-hg tests; python not available'\n \ttest_done\n fi\n \n-if ! python -c 'import mercurial'; then\n+if ! python -c 'import mercurial'\n+then\n \tskip_all='skipping remote-hg tests; mercurial not available'\n \ttest_done\n fi\n@@ -43,7 +45,7 @@ hg_push () {\n \tgit checkout -q -b tmp &&\n \tgit fetch -q \"hg::../$1\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&\n \tgit checkout -q @{-1} &&\n-\tgit branch -q -D tmp 2> /dev/null || true\n+\tgit branch -q -D tmp 2>/dev/null || true\n \t)\n }\n \n@@ -62,7 +64,7 @@ setup () {\n \techo \"tag = -d \\\"0 0\\\"\"\n \techo \"[extensions]\"\n \techo \"graphlog =\"\n-\t) >> \"$HOME\"/.hgrc &&\n+\t) >>\"$HOME\"/.hgrc &&\n \tgit config --global remote-hg.hg-git-compat true\n \tgit config --global remote-hg.track-branches true\n \n@@ -81,22 +83,22 @@ test_expect_success 'encoding' '\n \tgit init -q gitrepo &&\n \tcd gitrepo &&\n \n-\techo alpha > alpha &&\n+\techo alpha >alpha &&\n \tgit add alpha &&\n \tgit commit -m \"add älphà\" &&\n \n \tGIT_AUTHOR_NAME=\"tést èncödîng\" &&\n \texport GIT_AUTHOR_NAME &&\n-\techo beta > beta &&\n+\techo beta >beta &&\n \tgit add beta &&\n \tgit commit -m \"add beta\" &&\n \n-\techo gamma > gamma &&\n+\techo gamma >gamma &&\n \tgit add gamma &&\n \tgit commit -m \"add gämmâ\" &&\n \n \t: TODO git config i18n.commitencoding latin-1 &&\n-\techo delta > delta &&\n+\techo delta >delta &&\n \tgit add delta &&\n \tgit commit -m \"add déltà\"\n \t) &&\n@@ -105,8 +107,8 @@ test_expect_success 'encoding' '\n \tgit_clone hgrepo gitrepo2 &&\n \thg_clone gitrepo2 hgrepo2 &&\n \n-\tHGENCODING=utf-8 hg_log hgrepo > expected &&\n-\tHGENCODING=utf-8 hg_log hgrepo2 > actual &&\n+\tHGENCODING=utf-8 hg_log hgrepo >expected &&\n+\tHGENCODING=utf-8 hg_log hgrepo2 >actual &&\n \n \ttest_cmp expected actual\n '\n@@ -117,14 +119,14 @@ test_expect_success 'file removal' '\n \t(\n \tgit init -q gitrepo &&\n \tcd gitrepo &&\n-\techo alpha > alpha &&\n+\techo alpha >alpha &&\n \tgit add alpha &&\n \tgit commit -m \"add alpha\" &&\n-\techo beta > beta &&\n+\techo beta >beta &&\n \tgit add beta &&\n \tgit commit -m \"add beta\"\n \tmkdir foo &&\n-\techo blah > foo/bar &&\n+\techo blah >foo/bar &&\n \tgit add foo &&\n \tgit commit -m \"add foo\" &&\n \tgit rm alpha &&\n@@ -137,8 +139,8 @@ test_expect_success 'file removal' '\n \tgit_clone hgrepo gitrepo2 &&\n \thg_clone gitrepo2 hgrepo2 &&\n \n-\thg_log hgrepo > expected &&\n-\thg_log hgrepo2 > actual &&\n+\thg_log hgrepo >expected &&\n+\thg_log hgrepo2 >actual &&\n \n \ttest_cmp expected actual\n '\n@@ -150,12 +152,12 @@ test_expect_success 'git tags' '\n \tgit init -q gitrepo &&\n \tcd gitrepo &&\n \tgit config receive.denyCurrentBranch ignore &&\n-\techo alpha > alpha &&\n+\techo alpha >alpha &&\n \tgit add alpha &&\n \tgit commit -m \"add alpha\" &&\n \tgit tag alpha &&\n \n-\techo beta > beta &&\n+\techo beta >beta &&\n \tgit add beta &&\n \tgit commit -m \"add beta\" &&\n \tgit tag -a -m \"added tag beta\" beta\n@@ -165,8 +167,8 @@ test_expect_success 'git tags' '\n \tgit_clone hgrepo gitrepo2 &&\n \thg_clone gitrepo2 hgrepo2 &&\n \n-\thg_log hgrepo > expected &&\n-\thg_log hgrepo2 > actual &&\n+\thg_log hgrepo >expected &&\n+\thg_log hgrepo2 >actual &&\n \n \ttest_cmp expected actual\n '\n@@ -178,7 +180,7 @@ test_expect_success 'hg branch' '\n \tgit init -q gitrepo &&\n \tcd gitrepo &&\n \n-\techo alpha > alpha &&\n+\techo alpha >alpha &&\n \tgit add alpha &&\n \tgit commit -q -m \"add alpha\" &&\n \tgit checkout -q -b not-master\n@@ -201,8 +203,8 @@ test_expect_success 'hg branch' '\n \t: Back to the common revision &&\n \t(cd hgrepo && hg checkout default) &&\n \n-\thg_log hgrepo > expected &&\n-\thg_log hgrepo2 > actual &&\n+\thg_log hgrepo >expected &&\n+\thg_log hgrepo2 >actual &&\n \n \ttest_cmp expected actual\n '\n@@ -214,7 +216,7 @@ test_expect_success 'hg tags' '\n \tgit init -q gitrepo &&\n \tcd gitrepo &&\n \n-\techo alpha > alpha &&\n+\techo alpha >alpha &&\n \tgit add alpha &&\n \tgit commit -m \"add alpha\" &&\n \tgit checkout -q -b not-master\n@@ -231,8 +233,8 @@ test_expect_success 'hg tags' '\n \thg_push hgrepo gitrepo &&\n \thg_clone gitrepo hgrepo2 &&\n \n-\thg_log hgrepo > expected &&\n-\thg_log hgrepo2 > actual &&\n+\thg_log hgrepo >expected &&\n+\thg_log hgrepo2 >actual &&\n \n \ttest_cmp expected actual\n '\ndiff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh\nindex 2219284..a5123ca 100755\n--- a/contrib/remote-helpers/test-hg-hg-git.sh\n+++ b/contrib/remote-helpers/test-hg-hg-git.sh\n@@ -10,17 +10,20 @@ test_description='Test remote-hg output compared to hg-git'\n \n . ./test-lib.sh\n \n-if ! test_have_prereq PYTHON; then\n+if ! test_have_prereq PYTHON\n+then\n \tskip_all='skipping remote-hg tests; python not available'\n \ttest_done\n fi\n \n-if ! python -c 'import mercurial'; then\n+if ! python -c 'import mercurial'\n+then\n \tskip_all='skipping remote-hg tests; mercurial not available'\n \ttest_done\n fi\n \n-if ! python -c 'import hggit'; then\n+if ! python -c 'import hggit'\n+then\n \tskip_all='skipping remote-hg tests; hg-git not available'\n \ttest_done\n fi\n@@ -66,7 +69,7 @@ hg_push_git () {\n \tgit fetch -q \"hg::../$1\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&\n \tgit branch -D default &&\n \tgit checkout -q @{-1} &&\n-\tgit branch -q -D tmp 2> /dev/null || true\n+\tgit branch -q -D tmp 2>/dev/null || true\n \t)\n }\n \n@@ -100,7 +103,7 @@ setup () {\n \techo \"hgext.bookmarks =\"\n \techo \"hggit =\"\n \techo \"graphlog =\"\n-\t) >> \"$HOME\"/.hgrc &&\n+\t) >>\"$HOME\"/.hgrc &&\n \tgit config --global receive.denycurrentbranch warn\n \tgit config --global remote-hg.hg-git-compat true\n \tgit config --global remote-hg.track-branches false\n@@ -121,7 +124,7 @@ test_expect_success 'executable bit' '\n \t(\n \tgit init -q gitrepo &&\n \tcd gitrepo &&\n-\techo alpha > alpha &&\n+\techo alpha >alpha &&\n \tchmod 0644 alpha &&\n \tgit add alpha &&\n \tgit commit -m \"add alpha\" &&\n@@ -133,17 +136,18 @@ test_expect_success 'executable bit' '\n \tgit commit -m \"clear executable bit\"\n \t) &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\t(\n \t\thg_clone_$x gitrepo hgrepo-$x &&\n \t\tcd hgrepo-$x &&\n \t\thg_log . &&\n \t\thg manifest -r 1 -v &&\n \t\thg manifest -v\n-\t\t) > output-$x &&\n+\t\t) >output-$x &&\n \n \t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n-\t\tgit_log gitrepo2-$x > log-$x\n+\t\tgit_log gitrepo2-$x >log-$x\n \tdone &&\n \n \ttest_cmp output-hg output-git &&\n@@ -156,7 +160,7 @@ test_expect_success 'symlink' '\n \t(\n \tgit init -q gitrepo &&\n \tcd gitrepo &&\n-\techo alpha > alpha &&\n+\techo alpha >alpha &&\n \tgit add alpha &&\n \tgit commit -m \"add alpha\" &&\n \tln -s alpha beta &&\n@@ -164,16 +168,17 @@ test_expect_success 'symlink' '\n \tgit commit -m \"add beta\"\n \t) &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\t(\n \t\thg_clone_$x gitrepo hgrepo-$x &&\n \t\tcd hgrepo-$x &&\n \t\thg_log . &&\n \t\thg manifest -v\n-\t\t) > output-$x &&\n+\t\t) >output-$x &&\n \n \t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n-\t\tgit_log gitrepo2-$x > log-$x\n+\t\tgit_log gitrepo2-$x >log-$x\n \tdone &&\n \n \ttest_cmp output-hg output-git &&\n@@ -186,28 +191,29 @@ test_expect_success 'merge conflict 1' '\n \t(\n \thg init hgrepo1 &&\n \tcd hgrepo1 &&\n-\techo A > afile &&\n+\techo A >afile &&\n \thg add afile &&\n \thg ci -m \"origin\" &&\n \n-\techo B > afile &&\n+\techo B >afile &&\n \thg ci -m \"A->B\" &&\n \n \thg up -r0 &&\n-\techo C > afile &&\n+\techo C >afile &&\n \thg ci -m \"A->C\" &&\n \n \thg merge -r1 &&\n-\techo C > afile &&\n+\techo C >afile &&\n \thg resolve -m afile &&\n \thg ci -m \"merge to C\"\n \t) &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n \t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\t\thg_log hgrepo2-$x > hg-log-$x &&\n-\t\tgit_log gitrepo-$x > git-log-$x\n+\t\thg_log hgrepo2-$x >hg-log-$x &&\n+\t\tgit_log gitrepo-$x >git-log-$x\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -220,28 +226,29 @@ test_expect_success 'merge conflict 2' '\n \t(\n \thg init hgrepo1 &&\n \tcd hgrepo1 &&\n-\techo A > afile &&\n+\techo A >afile &&\n \thg add afile &&\n \thg ci -m \"origin\" &&\n \n-\techo B > afile &&\n+\techo B >afile &&\n \thg ci -m \"A->B\" &&\n \n \thg up -r0 &&\n-\techo C > afile &&\n+\techo C >afile &&\n \thg ci -m \"A->C\" &&\n \n \thg merge -r1 || true &&\n-\techo B > afile &&\n+\techo B >afile &&\n \thg resolve -m afile &&\n \thg ci -m \"merge to B\"\n \t) &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n \t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\t\thg_log hgrepo2-$x > hg-log-$x &&\n-\t\tgit_log gitrepo-$x > git-log-$x\n+\t\thg_log hgrepo2-$x >hg-log-$x &&\n+\t\tgit_log gitrepo-$x >git-log-$x\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -254,29 +261,30 @@ test_expect_success 'converged merge' '\n \t(\n \thg init hgrepo1 &&\n \tcd hgrepo1 &&\n-\techo A > afile &&\n+\techo A >afile &&\n \thg add afile &&\n \thg ci -m \"origin\" &&\n \n-\techo B > afile &&\n+\techo B >afile &&\n \thg ci -m \"A->B\" &&\n \n-\techo C > afile &&\n+\techo C >afile &&\n \thg ci -m \"B->C\" &&\n \n \thg up -r0 &&\n-\techo C > afile &&\n+\techo C >afile &&\n \thg ci -m \"A->C\" &&\n \n \thg merge -r2 || true &&\n \thg ci -m \"merge\"\n \t) &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n \t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\t\thg_log hgrepo2-$x > hg-log-$x &&\n-\t\tgit_log gitrepo-$x > git-log-$x\n+\t\thg_log hgrepo2-$x >hg-log-$x &&\n+\t\tgit_log gitrepo-$x >git-log-$x\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -290,32 +298,33 @@ test_expect_success 'encoding' '\n \tgit init -q gitrepo &&\n \tcd gitrepo &&\n \n-\techo alpha > alpha &&\n+\techo alpha >alpha &&\n \tgit add alpha &&\n \tgit commit -m \"add älphà\" &&\n \n \tGIT_AUTHOR_NAME=\"tést èncödîng\" &&\n \texport GIT_AUTHOR_NAME &&\n-\techo beta > beta &&\n+\techo beta >beta &&\n \tgit add beta &&\n \tgit commit -m \"add beta\" &&\n \n-\techo gamma > gamma &&\n+\techo gamma >gamma &&\n \tgit add gamma &&\n \tgit commit -m \"add gämmâ\" &&\n \n \t: TODO git config i18n.commitencoding latin-1 &&\n-\techo delta > delta &&\n+\techo delta >delta &&\n \tgit add delta &&\n \tgit commit -m \"add déltà\"\n \t) &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\thg_clone_$x gitrepo hgrepo-$x &&\n \t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n \n-\t\tHGENCODING=utf-8 hg_log hgrepo-$x > hg-log-$x &&\n-\t\tgit_log gitrepo2-$x > git-log-$x\n+\t\tHGENCODING=utf-8 hg_log hgrepo-$x >hg-log-$x &&\n+\t\tgit_log gitrepo2-$x >git-log-$x\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -328,14 +337,14 @@ test_expect_success 'file removal' '\n \t(\n \tgit init -q gitrepo &&\n \tcd gitrepo &&\n-\techo alpha > alpha &&\n+\techo alpha >alpha &&\n \tgit add alpha &&\n \tgit commit -m \"add alpha\" &&\n-\techo beta > beta &&\n+\techo beta >beta &&\n \tgit add beta &&\n \tgit commit -m \"add beta\"\n \tmkdir foo &&\n-\techo blah > foo/bar &&\n+\techo blah >foo/bar &&\n \tgit add foo &&\n \tgit commit -m \"add foo\" &&\n \tgit rm alpha &&\n@@ -344,17 +353,18 @@ test_expect_success 'file removal' '\n \tgit commit -m \"remove foo/bar\"\n \t) &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\t(\n \t\thg_clone_$x gitrepo hgrepo-$x &&\n \t\tcd hgrepo-$x &&\n \t\thg_log . &&\n \t\thg manifest -r 3 &&\n \t\thg manifest\n-\t\t) > output-$x &&\n+\t\t) >output-$x &&\n \n \t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n-\t\tgit_log gitrepo2-$x > log-$x\n+\t\tgit_log gitrepo2-$x >log-$x\n \tdone &&\n \n \ttest_cmp output-hg output-git &&\n@@ -368,20 +378,21 @@ test_expect_success 'git tags' '\n \tgit init -q gitrepo &&\n \tcd gitrepo &&\n \tgit config receive.denyCurrentBranch ignore &&\n-\techo alpha > alpha &&\n+\techo alpha >alpha &&\n \tgit add alpha &&\n \tgit commit -m \"add alpha\" &&\n \tgit tag alpha &&\n \n-\techo beta > beta &&\n+\techo beta >beta &&\n \tgit add beta &&\n \tgit commit -m \"add beta\" &&\n \tgit tag -a -m \"added tag beta\" beta\n \t) &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\thg_clone_$x gitrepo hgrepo-$x &&\n-\t\thg_log hgrepo-$x > log-$x\n+\t\thg_log hgrepo-$x >log-$x\n \tdone &&\n \n \ttest_cmp log-hg log-git\n@@ -390,12 +401,13 @@ test_expect_success 'git tags' '\n test_expect_success 'hg author' '\n \ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\t(\n \t\tgit init -q gitrepo-$x &&\n \t\tcd gitrepo-$x &&\n \n-\t\techo alpha > alpha &&\n+\t\techo alpha >alpha &&\n \t\tgit add alpha &&\n \t\tgit commit -m \"add alpha\" &&\n \t\tgit checkout -q -b not-master\n@@ -406,38 +418,38 @@ test_expect_success 'hg author' '\n \t\tcd hgrepo-$x &&\n \n \t\thg co master &&\n-\t\techo beta > beta &&\n+\t\techo beta >beta &&\n \t\thg add beta &&\n \t\thg commit -u \"test\" -m \"add beta\" &&\n \n-\t\techo gamma >> beta &&\n+\t\techo gamma >>beta &&\n \t\thg commit -u \"test <test@example.com> (comment)\" -m \"modify beta\" &&\n \n-\t\techo gamma > gamma &&\n+\t\techo gamma >gamma &&\n \t\thg add gamma &&\n \t\thg commit -u \"<test@example.com>\" -m \"add gamma\" &&\n \n-\t\techo delta > delta &&\n+\t\techo delta >delta &&\n \t\thg add delta &&\n \t\thg commit -u \"name<test@example.com>\" -m \"add delta\" &&\n \n-\t\techo epsilon > epsilon &&\n+\t\techo epsilon >epsilon &&\n \t\thg add epsilon &&\n \t\thg commit -u \"name <test@example.com\" -m \"add epsilon\" &&\n \n-\t\techo zeta > zeta &&\n+\t\techo zeta >zeta &&\n \t\thg add zeta &&\n \t\thg commit -u \" test \" -m \"add zeta\" &&\n \n-\t\techo eta > eta &&\n+\t\techo eta >eta &&\n \t\thg add eta &&\n \t\thg commit -u \"test < test@example.com >\" -m \"add eta\" &&\n \n-\t\techo theta > theta &&\n+\t\techo theta >theta &&\n \t\thg add theta &&\n \t\thg commit -u \"test >test@example.com>\" -m \"add theta\" &&\n \n-\t\techo iota > iota &&\n+\t\techo iota >iota &&\n \t\thg add iota &&\n \t\thg commit -u \"test <test <at> example <dot> com>\" -m \"add iota\"\n \t\t) &&\n@@ -445,8 +457,8 @@ test_expect_success 'hg author' '\n \t\thg_push_$x hgrepo-$x gitrepo-$x &&\n \t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n \n-\t\thg_log hgrepo2-$x > hg-log-$x &&\n-\t\tgit_log gitrepo-$x > git-log-$x\n+\t\thg_log hgrepo2-$x >hg-log-$x &&\n+\t\tgit_log gitrepo-$x >git-log-$x\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -456,12 +468,13 @@ test_expect_success 'hg author' '\n test_expect_success 'hg branch' '\n \ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\t(\n \t\tgit init -q gitrepo-$x &&\n \t\tcd gitrepo-$x &&\n \n-\t\techo alpha > alpha &&\n+\t\techo alpha >alpha &&\n \t\tgit add alpha &&\n \t\tgit commit -q -m \"add alpha\" &&\n \t\tgit checkout -q -b not-master\n@@ -481,8 +494,8 @@ test_expect_success 'hg branch' '\n \t\thg_push_$x hgrepo-$x gitrepo-$x &&\n \t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n \n-\t\thg_log hgrepo2-$x > hg-log-$x &&\n-\t\tgit_log gitrepo-$x > git-log-$x\n+\t\thg_log hgrepo2-$x >hg-log-$x &&\n+\t\tgit_log gitrepo-$x >git-log-$x\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -492,12 +505,13 @@ test_expect_success 'hg branch' '\n test_expect_success 'hg tags' '\n \ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n \n-\tfor x in hg git; do\n+\tfor x in hg git\n+\tdo\n \t\t(\n \t\tgit init -q gitrepo-$x &&\n \t\tcd gitrepo-$x &&\n \n-\t\techo alpha > alpha &&\n+\t\techo alpha >alpha &&\n \t\tgit add alpha &&\n \t\tgit commit -m \"add alpha\" &&\n \t\tgit checkout -q -b not-master\n@@ -518,7 +532,7 @@ test_expect_success 'hg tags' '\n \t\tgit --git-dir=gitrepo-$x/.git tag -l &&\n \t\thg_log hgrepo2-$x &&\n \t\tcat hgrepo2-$x/.hgtags\n-\t\t) > output-$x\n+\t\t) >output-$x\n \tdone &&\n \n \ttest_cmp output-hg output-git\ndiff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh\nindex 5a6f745..72f745d 100755\n--- a/contrib/remote-helpers/test-hg.sh\n+++ b/contrib/remote-helpers/test-hg.sh\n@@ -10,40 +10,44 @@ test_description='Test remote-hg'\n \n . ./test-lib.sh\n \n-if ! test_have_prereq PYTHON; then\n+if ! test_have_prereq PYTHON\n+then\n \tskip_all='skipping remote-hg tests; python not available'\n \ttest_done\n fi\n \n-if ! python -c 'import mercurial'; then\n+if ! python -c 'import mercurial'\n+then\n \tskip_all='skipping remote-hg tests; mercurial not available'\n \ttest_done\n fi\n \n check () {\n-\techo $3 > expected &&\n-\tgit --git-dir=$1/.git log --format='%s' -1 $2 > actual\n+\techo $3 >expected &&\n+\tgit --git-dir=$1/.git log --format='%s' -1 $2 >actual\n \ttest_cmp expected actual\n }\n \n check_branch () {\n-\tif [ -n \"$3\" ]; then\n-\t\techo $3 > expected &&\n-\t\thg -R $1 log -r $2 --template '{desc}\\n' > actual &&\n+\tif test -n \"$3\"\n+\tthen\n+\t\techo $3 >expected &&\n+\t\thg -R $1 log -r $2 --template '{desc}\\n' >actual &&\n \t\ttest_cmp expected actual\n \telse\n-\t\thg -R $1 branches > out &&\n+\t\thg -R $1 branches >out &&\n \t\t! grep $2 out\n \tfi\n }\n \n check_bookmark () {\n-\tif [ -n \"$3\" ]; then\n-\t\techo $3 > expected &&\n-\t\thg -R $1 log -r \"bookmark('$2')\" --template '{desc}\\n' > actual &&\n+\tif test -n \"$3\"\n+\tthen\n+\t\techo $3 >expected &&\n+\t\thg -R $1 log -r \"bookmark('$2')\" --template '{desc}\\n' >actual &&\n \t\ttest_cmp expected actual\n \telse\n-\t\thg -R $1 bookmarks > out &&\n+\t\thg -R $1 bookmarks >out &&\n \t\t! grep $2 out\n \tfi\n }\n@@ -52,7 +56,7 @@ check_push () {\n \tlocal expected_ret=$1 ret=0 ref_ret=0 IFS=':'\n \n \tshift\n-\tgit push origin \"$@\" 2> error\n+\tgit push origin \"$@\" 2>error\n \tret=$?\n \tcat error\n \n@@ -92,7 +96,7 @@ setup () {\n \techo \"username = H G Wells <wells@example.com>\"\n \techo \"[extensions]\"\n \techo \"mq =\"\n-\t) >> \"$HOME\"/.hgrc &&\n+\t) >>\"$HOME\"/.hgrc &&\n \n \tGIT_AUTHOR_DATE=\"2007-01-01 00:00:00 +0230\" &&\n \tGIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\" &&\n@@ -107,7 +111,7 @@ test_expect_success 'cloning' '\n \t(\n \thg init hgrepo &&\n \tcd hgrepo &&\n-\techo zero > content &&\n+\techo zero >content &&\n \thg add content &&\n \thg commit -m zero\n \t) &&\n@@ -122,7 +126,7 @@ test_expect_success 'cloning with branches' '\n \t(\n \tcd hgrepo &&\n \thg branch next &&\n-\techo next > content &&\n+\techo next >content &&\n \thg commit -m next\n \t) &&\n \n@@ -137,7 +141,7 @@ test_expect_success 'cloning with bookmarks' '\n \tcd hgrepo &&\n \thg checkout default &&\n \thg bookmark feature-a &&\n-\techo feature-a > content &&\n+\techo feature-a >content &&\n \thg commit -m feature-a\n \t) &&\n \n@@ -157,7 +161,7 @@ test_expect_success 'update bookmark' '\n \tgit clone \"hg::hgrepo\" gitrepo &&\n \tcd gitrepo &&\n \tgit checkout --quiet devel &&\n-\techo devel > content &&\n+\techo devel >content &&\n \tgit commit -a -m devel &&\n \tgit push --quiet\n \t) &&\n@@ -172,7 +176,7 @@ test_expect_success 'new bookmark' '\n \tgit clone \"hg::hgrepo\" gitrepo &&\n \tcd gitrepo &&\n \tgit checkout --quiet -b feature-b &&\n-\techo feature-b > content &&\n+\techo feature-b >content &&\n \tgit commit -a -m feature-b &&\n \tgit push --quiet origin feature-b\n \t) &&\n@@ -184,9 +188,9 @@ test_expect_success 'new bookmark' '\n rm -rf hgrepo\n \n author_test () {\n-\techo $1 >> content &&\n+\techo $1 >>content &&\n \thg commit -u \"$2\" -m \"add $1\" &&\n-\techo \"$3\" >> ../expected\n+\techo \"$3\" >>../expected\n }\n \n test_expect_success 'authors' '\n@@ -199,7 +203,7 @@ test_expect_success 'authors' '\n \ttouch content &&\n \thg add content &&\n \n-\t> ../expected &&\n+\t>../expected &&\n \tauthor_test alpha \"\" \"H G Wells <wells@example.com>\" &&\n \tauthor_test beta \"test\" \"test <unknown>\" &&\n \tauthor_test beta \"test <test@example.com> (comment)\" \"test <test@example.com>\" &&\n@@ -214,7 +218,7 @@ test_expect_success 'authors' '\n \t) &&\n \n \tgit clone \"hg::hgrepo\" gitrepo &&\n-\tgit --git-dir=gitrepo/.git log --reverse --format=\"%an <%ae>\" > actual &&\n+\tgit --git-dir=gitrepo/.git log --reverse --format=\"%an <%ae>\" >actual &&\n \n \ttest_cmp expected actual\n '\n@@ -226,11 +230,11 @@ test_expect_success 'strip' '\n \thg init hgrepo &&\n \tcd hgrepo &&\n \n-\techo one >> content &&\n+\techo one >>content &&\n \thg add content &&\n \thg commit -m one &&\n \n-\techo two >> content &&\n+\techo two >>content &&\n \thg commit -m two\n \t) &&\n \n@@ -240,20 +244,20 @@ test_expect_success 'strip' '\n \tcd hgrepo &&\n \thg strip 1 &&\n \n-\techo three >> content &&\n+\techo three >>content &&\n \thg commit -m three &&\n \n-\techo four >> content &&\n+\techo four >>content &&\n \thg commit -m four\n \t) &&\n \n \t(\n \tcd gitrepo &&\n \tgit fetch &&\n-\tgit log --format=\"%s\" origin/master > ../actual\n+\tgit log --format=\"%s\" origin/master >../actual\n \t) &&\n \n-\thg -R hgrepo log --template \"{desc}\\n\" > expected &&\n+\thg -R hgrepo log --template \"{desc}\\n\" >expected &&\n \ttest_cmp actual expected\n '\n \n@@ -263,18 +267,18 @@ test_expect_success 'remote push with master bookmark' '\n \t(\n \thg init hgrepo &&\n \tcd hgrepo &&\n-\techo zero > content &&\n+\techo zero >content &&\n \thg add content &&\n \thg commit -m zero &&\n \thg bookmark master &&\n-\techo one > content &&\n+\techo one >content &&\n \thg commit -m one\n \t) &&\n \n \t(\n \tgit clone \"hg::hgrepo\" gitrepo &&\n \tcd gitrepo &&\n-\techo two > content &&\n+\techo two >content &&\n \tgit commit -a -m two &&\n \tgit push\n \t) &&\n@@ -282,7 +286,7 @@ test_expect_success 'remote push with master bookmark' '\n \tcheck_branch hgrepo default two\n '\n \n-cat > expected <<EOF\n+cat >expected <<\\EOF\n changeset:   0:6e2126489d3d\n tag:         tip\n user:        A U Thor <author@example.com>\n@@ -300,13 +304,13 @@ test_expect_success 'remote push from master branch' '\n \tgit init gitrepo &&\n \tcd gitrepo &&\n \tgit remote add origin \"hg::../hgrepo\" &&\n-\techo one > content &&\n+\techo one >content &&\n \tgit add content &&\n \tgit commit -a -m one &&\n \tgit push origin master\n \t) &&\n \n-\thg -R hgrepo log > actual &&\n+\thg -R hgrepo log >actual &&\n \tcat actual &&\n \ttest_cmp expected actual &&\n \n@@ -322,7 +326,7 @@ test_expect_success 'remote cloning' '\n \t(\n \thg init hgrepo &&\n \tcd hgrepo &&\n-\techo zero > content &&\n+\techo zero >content &&\n \thg add content &&\n \thg commit -m zero\n \t) &&\n@@ -343,7 +347,7 @@ test_expect_success 'remote update bookmark' '\n \tgit clone \"hg::hgrepo\" gitrepo &&\n \tcd gitrepo &&\n \tgit checkout --quiet devel &&\n-\techo devel > content &&\n+\techo devel >content &&\n \tgit commit -a -m devel &&\n \tgit push --quiet\n \t) &&\n@@ -358,7 +362,7 @@ test_expect_success 'remote new bookmark' '\n \tgit clone \"hg::hgrepo\" gitrepo &&\n \tcd gitrepo &&\n \tgit checkout --quiet -b feature-b &&\n-\techo feature-b > content &&\n+\techo feature-b >content &&\n \tgit commit -a -m feature-b &&\n \tgit push --quiet origin feature-b\n \t) &&\n@@ -374,15 +378,15 @@ test_expect_success 'remote push diverged' '\n \t(\n \tcd hgrepo &&\n \thg checkout default &&\n-\techo bump > content &&\n+\techo bump >content &&\n \thg commit -m bump\n \t) &&\n \n \t(\n \tcd gitrepo &&\n-\techo diverge > content &&\n+\techo diverge >content &&\n \tgit commit -a -m diverged &&\n-\tcheck_push 1 <<-EOF\n+\tcheck_push 1 <<-\\EOF\n \tmaster:non-fast-forward\n \tEOF\n \t) &&\n@@ -403,16 +407,16 @@ test_expect_success 'remote update bookmark diverge' '\n \n \t(\n \tcd hgrepo &&\n-\techo \"bump bookmark\" > content &&\n+\techo \"bump bookmark\" >content &&\n \thg commit -m \"bump bookmark\"\n \t) &&\n \n \t(\n \tcd gitrepo &&\n \tgit checkout --quiet diverge &&\n-\techo diverge > content &&\n+\techo diverge >content &&\n \tgit commit -a -m diverge &&\n-\tcheck_push 1 <<-EOF\n+\tcheck_push 1 <<-\\EOF\n \tdiverge:fetch-first\n \tEOF\n \t) &&\n@@ -427,7 +431,7 @@ test_expect_success 'remote new bookmark multiple branch head' '\n \tgit clone \"hg::hgrepo\" gitrepo &&\n \tcd gitrepo &&\n \tgit checkout --quiet -b feature-c HEAD^ &&\n-\techo feature-c > content &&\n+\techo feature-c >content &&\n \tgit commit -a -m feature-c &&\n \tgit push --quiet origin feature-c\n \t) &&\n@@ -442,20 +446,20 @@ setup_big_push () {\n \t(\n \thg init hgrepo &&\n \tcd hgrepo &&\n-\techo zero > content &&\n+\techo zero >content &&\n \thg add content &&\n \thg commit -m zero &&\n \thg bookmark bad_bmark1 &&\n-\techo one > content &&\n+\techo one >content &&\n \thg commit -m one &&\n \thg bookmark bad_bmark2 &&\n \thg bookmark good_bmark &&\n \thg bookmark -i good_bmark &&\n \thg -q branch good_branch &&\n-\techo \"good branch\" > content &&\n+\techo \"good branch\" >content &&\n \thg commit -m \"good branch\" &&\n \thg -q branch bad_branch &&\n-\techo \"bad branch\" > content &&\n+\techo \"bad branch\" >content &&\n \thg commit -m \"bad branch\"\n \t) &&\n \n@@ -463,40 +467,40 @@ setup_big_push () {\n \n \t(\n \tcd gitrepo &&\n-\techo two > content &&\n+\techo two >content &&\n \tgit commit -q -a -m two &&\n \n \tgit checkout -q good_bmark &&\n-\techo three > content &&\n+\techo three >content &&\n \tgit commit -q -a -m three &&\n \n \tgit checkout -q bad_bmark1 &&\n \tgit reset --hard HEAD^ &&\n-\techo four > content &&\n+\techo four >content &&\n \tgit commit -q -a -m four &&\n \n \tgit checkout -q bad_bmark2 &&\n \tgit reset --hard HEAD^ &&\n-\techo five > content &&\n+\techo five >content &&\n \tgit commit -q -a -m five &&\n \n \tgit checkout -q -b new_bmark master &&\n-\techo six > content &&\n+\techo six >content &&\n \tgit commit -q -a -m six &&\n \n \tgit checkout -q branches/good_branch &&\n-\techo seven > content &&\n+\techo seven >content &&\n \tgit commit -q -a -m seven &&\n-\techo eight > content &&\n+\techo eight >content &&\n \tgit commit -q -a -m eight &&\n \n \tgit checkout -q branches/bad_branch &&\n \tgit reset --hard HEAD^ &&\n-\techo nine > content &&\n+\techo nine >content &&\n \tgit commit -q -a -m nine &&\n \n \tgit checkout -q -b branches/new_branch master &&\n-\techo ten > content &&\n+\techo ten >content &&\n \tgit commit -q -a -m ten\n \t)\n }\n@@ -509,7 +513,7 @@ test_expect_success 'remote big push' '\n \t(\n \tcd gitrepo &&\n \n-\tcheck_push 1 --all <<-EOF\n+\tcheck_push 1 --all <<-\\EOF\n \tmaster\n \tgood_bmark\n \tbranches/good_branch\n@@ -537,17 +541,17 @@ test_expect_success 'remote big push fetch first' '\n \t(\n \thg init hgrepo &&\n \tcd hgrepo &&\n-\techo zero > content &&\n+\techo zero >content &&\n \thg add content &&\n \thg commit -m zero &&\n \thg bookmark bad_bmark &&\n \thg bookmark good_bmark &&\n \thg bookmark -i good_bmark &&\n \thg -q branch good_branch &&\n-\techo \"good branch\" > content &&\n+\techo \"good branch\" >content &&\n \thg commit -m \"good branch\" &&\n \thg -q branch bad_branch &&\n-\techo \"bad branch\" > content &&\n+\techo \"bad branch\" >content &&\n \thg commit -m \"bad branch\"\n \t) &&\n \n@@ -556,28 +560,28 @@ test_expect_success 'remote big push fetch first' '\n \t(\n \tcd hgrepo &&\n \thg bookmark -f bad_bmark &&\n-\techo update_bmark > content &&\n+\techo update_bmark >content &&\n \thg commit -m \"update bmark\"\n \t) &&\n \n \t(\n \tcd gitrepo &&\n-\techo two > content &&\n+\techo two >content &&\n \tgit commit -q -a -m two &&\n \n \tgit checkout -q good_bmark &&\n-\techo three > content &&\n+\techo three >content &&\n \tgit commit -q -a -m three &&\n \n \tgit checkout -q bad_bmark &&\n-\techo four > content &&\n+\techo four >content &&\n \tgit commit -q -a -m four &&\n \n \tgit checkout -q branches/bad_branch &&\n-\techo five > content &&\n+\techo five >content &&\n \tgit commit -q -a -m five &&\n \n-\tcheck_push 1 --all <<-EOF &&\n+\tcheck_push 1 --all <<-\\EOF &&\n \tmaster\n \tgood_bmark\n \tbad_bmark:fetch-first\n@@ -586,7 +590,7 @@ test_expect_success 'remote big push fetch first' '\n \n \tgit fetch &&\n \n-\tcheck_push 1 --all <<-EOF\n+\tcheck_push 1 --all <<-\\EOF\n \tmaster\n \tgood_bmark\n \tbad_bmark:non-fast-forward\n@@ -603,7 +607,7 @@ test_expect_failure 'remote big push force' '\n \t(\n \tcd gitrepo &&\n \n-\tcheck_push 0 --force --all <<-EOF\n+\tcheck_push 0 --force --all <<-\\EOF\n \tmaster\n \tgood_bmark\n \tbranches/good_branch\n@@ -633,7 +637,7 @@ test_expect_failure 'remote big push dry-run' '\n \t(\n \tcd gitrepo &&\n \n-\tcheck_push 1 --dry-run --all <<-EOF &&\n+\tcheck_push 1 --dry-run --all <<-\\EOF &&\n \tmaster\n \tgood_bmark\n \tbranches/good_branch\n@@ -644,7 +648,7 @@ test_expect_failure 'remote big push dry-run' '\n \tbranches/bad_branch:non-fast-forward\n \tEOF\n \n-\tcheck_push 0 --dry-run master good_bmark new_bmark branches/good_branch branches/new_branch <<-EOF\n+\tcheck_push 0 --dry-run master good_bmark new_bmark branches/good_branch branches/new_branch <<-\\EOF\n \tmaster\n \tgood_bmark\n \tbranches/good_branch\n@@ -669,10 +673,10 @@ test_expect_success 'remote double failed push' '\n \t(\n \thg init hgrepo &&\n \tcd hgrepo &&\n-\techo zero > content &&\n+\techo zero >content &&\n \thg add content &&\n \thg commit -m zero &&\n-\techo one > content &&\n+\techo one >content &&\n \thg commit -m one\n \t) &&\n \n@@ -680,7 +684,7 @@ test_expect_success 'remote double failed push' '\n \tgit clone \"hg::hgrepo\" gitrepo &&\n \tcd gitrepo &&\n \tgit reset --hard HEAD^ &&\n-\techo two > content &&\n+\techo two >content &&\n \tgit commit -a -m two &&\n \ttest_expect_code 1 git push &&\n \ttest_expect_code 1 git push\n-- \n1.8.4-335-g2c126a6\n"},{"id":"226267","messageId":"xmqqd2ow2nqi.fsf@gitster.dls.corp.google.com","threadId":"34789","inReplyTo":"xmqqhae82nsb.fsf_-_@gitster.dls.corp.google.com","subject":"Re: Re* [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-29T21:25:41Z","receivedAt":"2013-08-29T21:25:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Actually, I think not fixing it inside that 1/8 is good, as there\n> are many existing \"cmd > file\" (and worse, \"cmd > file-$x\") in these\n> test-*.sh scripts.  Clean-up is better done as a follow-up patch.\n>\n> Here are two that I noticed.\n>\n> -- >8 --\n> Subject: [PATCH 9/8] contrib/remote-helpers: style updates for test scripts\n\nAnd here is the second one.\n\n-- >8 --\nSubject: [PATCH 10/8] remote-helpers: quote variable references in redirection targets\n\nEven though it is not required by POSIX to double-quote the\nredirection target in a variable, our code does so because some\nversions of bash issue a warning without the quotes.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n contrib/remote-helpers/test-hg-hg-git.sh | 40 ++++++++++++++++----------------\n 1 file changed, 20 insertions(+), 20 deletions(-)\n\ndiff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh\nindex a5123ca..6dcd95d 100755\n--- a/contrib/remote-helpers/test-hg-hg-git.sh\n+++ b/contrib/remote-helpers/test-hg-hg-git.sh\n@@ -144,10 +144,10 @@ test_expect_success 'executable bit' '\n \t\thg_log . &&\n \t\thg manifest -r 1 -v &&\n \t\thg manifest -v\n-\t\t) >output-$x &&\n+\t\t) >\"output-$x\" &&\n \n \t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n-\t\tgit_log gitrepo2-$x >log-$x\n+\t\tgit_log gitrepo2-$x >\"log-$x\"\n \tdone &&\n \n \ttest_cmp output-hg output-git &&\n@@ -175,10 +175,10 @@ test_expect_success 'symlink' '\n \t\tcd hgrepo-$x &&\n \t\thg_log . &&\n \t\thg manifest -v\n-\t\t) >output-$x &&\n+\t\t) >\"output-$x\" &&\n \n \t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n-\t\tgit_log gitrepo2-$x >log-$x\n+\t\tgit_log gitrepo2-$x >\"log-$x\"\n \tdone &&\n \n \ttest_cmp output-hg output-git &&\n@@ -212,8 +212,8 @@ test_expect_success 'merge conflict 1' '\n \tdo\n \t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n \t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\t\thg_log hgrepo2-$x >hg-log-$x &&\n-\t\tgit_log gitrepo-$x >git-log-$x\n+\t\thg_log hgrepo2-$x >\"hg-log-$x\" &&\n+\t\tgit_log gitrepo-$x >\"git-log-$x\"\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -247,8 +247,8 @@ test_expect_success 'merge conflict 2' '\n \tdo\n \t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n \t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\t\thg_log hgrepo2-$x >hg-log-$x &&\n-\t\tgit_log gitrepo-$x >git-log-$x\n+\t\thg_log hgrepo2-$x >\"hg-log-$x\" &&\n+\t\tgit_log gitrepo-$x >\"git-log-$x\"\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -283,8 +283,8 @@ test_expect_success 'converged merge' '\n \tdo\n \t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n \t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\t\thg_log hgrepo2-$x >hg-log-$x &&\n-\t\tgit_log gitrepo-$x >git-log-$x\n+\t\thg_log hgrepo2-$x >\"hg-log-$x\" &&\n+\t\tgit_log gitrepo-$x >\"git-log-$x\"\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -323,8 +323,8 @@ test_expect_success 'encoding' '\n \t\thg_clone_$x gitrepo hgrepo-$x &&\n \t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n \n-\t\tHGENCODING=utf-8 hg_log hgrepo-$x >hg-log-$x &&\n-\t\tgit_log gitrepo2-$x >git-log-$x\n+\t\tHGENCODING=utf-8 hg_log hgrepo-$x >\"hg-log-$x\" &&\n+\t\tgit_log gitrepo2-$x >\"git-log-$x\"\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -361,10 +361,10 @@ test_expect_success 'file removal' '\n \t\thg_log . &&\n \t\thg manifest -r 3 &&\n \t\thg manifest\n-\t\t) >output-$x &&\n+\t\t) >\"output-$x\" &&\n \n \t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n-\t\tgit_log gitrepo2-$x >log-$x\n+\t\tgit_log gitrepo2-$x >\"log-$x\"\n \tdone &&\n \n \ttest_cmp output-hg output-git &&\n@@ -392,7 +392,7 @@ test_expect_success 'git tags' '\n \tfor x in hg git\n \tdo\n \t\thg_clone_$x gitrepo hgrepo-$x &&\n-\t\thg_log hgrepo-$x >log-$x\n+\t\thg_log hgrepo-$x >\"log-$x\"\n \tdone &&\n \n \ttest_cmp log-hg log-git\n@@ -457,8 +457,8 @@ test_expect_success 'hg author' '\n \t\thg_push_$x hgrepo-$x gitrepo-$x &&\n \t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n \n-\t\thg_log hgrepo2-$x >hg-log-$x &&\n-\t\tgit_log gitrepo-$x >git-log-$x\n+\t\thg_log hgrepo2-$x >\"hg-log-$x\" &&\n+\t\tgit_log gitrepo-$x >\"git-log-$x\"\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -494,8 +494,8 @@ test_expect_success 'hg branch' '\n \t\thg_push_$x hgrepo-$x gitrepo-$x &&\n \t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n \n-\t\thg_log hgrepo2-$x >hg-log-$x &&\n-\t\tgit_log gitrepo-$x >git-log-$x\n+\t\thg_log hgrepo2-$x >\"hg-log-$x\" &&\n+\t\tgit_log gitrepo-$x >\"git-log-$x\"\n \tdone &&\n \n \ttest_cmp hg-log-hg hg-log-git &&\n@@ -532,7 +532,7 @@ test_expect_success 'hg tags' '\n \t\tgit --git-dir=gitrepo-$x/.git tag -l &&\n \t\thg_log hgrepo2-$x &&\n \t\tcat hgrepo2-$x/.hgtags\n-\t\t) >output-$x\n+\t\t) >\"output-$x\"\n \tdone &&\n \n \ttest_cmp output-hg output-git\n-- \n1.8.4-335-g2c126a6\n"},{"id":"226268","messageId":"CALWbr2xe8jC4QnLTEOWJX_kn_FcQjSafPn=NKd3UsK9fO5f=_g@mail.gmail.com","threadId":"34789","inReplyTo":"xmqqhae82nsb.fsf_-_@gitster.dls.corp.google.com","subject":"Re: Re* [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-08-29T21:28:35Z","receivedAt":"2013-08-29T21:28:35Z","isPatch":true,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"On Thu, Aug 29, 2013 at 11:24 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> -- >8 --\n> Subject: [PATCH 9/8] contrib/remote-helpers: style updates for test scripts\n>\n> During the review of the main series it was noticed that these test\n> scripts can use updates to conform to our coding style better, but\n> fixing the style should be done in a patch separate from the main\n> series.\n>\n> This updates the test-*.sh scripts only for styles:\n>\n>  * We do not leave SP between a redirection operator and the\n>    filename;\n>\n>  * We change line before \"then\", \"do\", etc. rather than terminating\n>    the condition for \"if\"/\"while\" and list for \"for\" with a\n>    semicolon;\n>\n>  * When HERE document does not use any expansion, we quote the end\n>    marker (e.g. \"cat <<\\EOF\" not \"cat <<EOF\") to signal the readers\n>    that there is no funny substitution to worry about when reading\n>    the code.\n\nMay I ask what pattern you used to replace all these or if you went\nthrough manually ?\n"},{"id":"226269","messageId":"xmqq8uzk2mzb.fsf@gitster.dls.corp.google.com","threadId":"34789","inReplyTo":"CALWbr2xe8jC4QnLTEOWJX_kn_FcQjSafPn=NKd3UsK9fO5f=_g@mail.gmail.com","subject":"Re: Re* [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-29T21:42:00Z","receivedAt":"2013-08-29T21:42:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Antoine Pelisse <apelisse@gmail.com> writes:\n\n> On Thu, Aug 29, 2013 at 11:24 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> -- >8 --\n>> Subject: [PATCH 9/8] contrib/remote-helpers: style updates for test scripts\n>>\n>> During the review of the main series it was noticed that these test\n>> scripts can use updates to conform to our coding style better, but\n>> fixing the style should be done in a patch separate from the main\n>> series.\n>>\n>> This updates the test-*.sh scripts only for styles:\n>>\n>>  * We do not leave SP between a redirection operator and the\n>>    filename;\n>>\n>>  * We change line before \"then\", \"do\", etc. rather than terminating\n>>    the condition for \"if\"/\"while\" and list for \"for\" with a\n>>    semicolon;\n>>\n>>  * When HERE document does not use any expansion, we quote the end\n>>    marker (e.g. \"cat <<\\EOF\" not \"cat <<EOF\") to signal the readers\n>>    that there is no funny substitution to worry about when reading\n>>    the code.\n>\n> May I ask what pattern you used to replace all these or if you went\n> through manually ?\n\n\"M-x query-replace\" from \"> \" to \">\" with manual inspection. I never\nuse full automation myself, as I do not trust that I am careful\nenough and it is prone to unexpected changes that I can easily miss.\n"},{"id":"226270","messageId":"xmqq4na82mus.fsf@gitster.dls.corp.google.com","threadId":"34789","inReplyTo":"xmqq8uzk2mzb.fsf@gitster.dls.corp.google.com","subject":"Re: Re* [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-29T21:44:43Z","receivedAt":"2013-08-29T21:44:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> May I ask what pattern you used to replace all these or if you went\n>> through manually ?\n>\n> \"M-x query-replace\" from \"> \" to \">\" with manual inspection. I never\n> use full automation myself, as I do not trust that I am careful\n> enough and it is prone to unexpected changes that I can easily miss.\n\n... I forgot to add:\n\n    An extra pair of eyeballs to make sure I didn't make stupid\n    misconversions is greatly appreciated.\n\nThanks.\n"},{"id":"226272","messageId":"1377813000-24465-1-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"xmqqa9k049qc.fsf@gitster.dls.corp.google.com","subject":"[PATCH] remote-hg: support for notes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T21:50:00Z","receivedAt":"2013-08-29T21:50:00Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 32 +++++++++++++++++++++++++++++++-\n 1 file changed, 31 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 307d82c..e49fcfa 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -23,6 +23,7 @@ import subprocess\n import urllib\n import atexit\n import urlparse, hashlib\n+import time as ptime\n \n #\n # If you are not in hg-git-compat mode and want to disable the tracking of\n@@ -126,6 +127,7 @@ class Marks:\n         self.rev_marks = {}\n         self.last_mark = 0\n         self.version = 0\n+        self.last_note = 0\n \n     def load(self):\n         if not os.path.exists(self.path):\n@@ -137,6 +139,7 @@ class Marks:\n         self.marks = tmp['marks']\n         self.last_mark = tmp['last-mark']\n         self.version = tmp.get('version', 1)\n+        self.last_note = tmp.get('last-note', 0)\n \n         for rev, mark in self.marks.iteritems():\n             self.rev_marks[mark] = rev\n@@ -150,7 +153,7 @@ class Marks:\n         self.version = 2\n \n     def dict(self):\n-        return { 'tips': self.tips, 'marks': self.marks, 'last-mark' : self.last_mark, 'version' : self.version }\n+        return { 'tips': self.tips, 'marks': self.marks, 'last-mark' : self.last_mark, 'version' : self.version, 'last-note' : self.last_note }\n \n     def store(self):\n         json.dump(self.dict(), open(self.path, 'w'))\n@@ -525,6 +528,31 @@ def export_ref(repo, name, kind, head):\n     print \"from :%u\" % rev_to_mark(head)\n     print\n \n+    pending_revs = set(revs) - notes\n+    if pending_revs:\n+        note_mark = marks.next_mark()\n+        ref = \"refs/notes/hg\"\n+\n+        print \"commit %s\" % ref\n+        print \"mark :%d\" % (note_mark)\n+        print \"committer remote-hg <> %s\" % (ptime.strftime('%s %z'))\n+        desc = \"Notes for %s\\n\" % (name)\n+        print \"data %d\" % (len(desc))\n+        print desc\n+        if marks.last_note:\n+            print \"from :%u\" % marks.last_note\n+\n+        for rev in pending_revs:\n+            notes.add(rev)\n+            c = repo[rev]\n+            print \"N inline :%u\" % rev_to_mark(c)\n+            msg = c.hex()\n+            print \"data %d\" % (len(msg))\n+            print msg\n+        print\n+\n+        marks.last_note = note_mark\n+\n     marks.set_tip(ename, head.hex())\n \n def export_tag(repo, tag):\n@@ -1126,6 +1154,7 @@ def main(args):\n     global filenodes\n     global fake_bmark, hg_version\n     global dry_run\n+    global notes, alias\n \n     alias = args[1]\n     url = args[2]\n@@ -1165,6 +1194,7 @@ def main(args):\n     except:\n         hg_version = None\n     dry_run = False\n+    notes = set()\n \n     repo = get_repo(url, alias)\n     prefix = 'refs/hg/%s' % alias\n-- \n1.8.4-fc\n"},{"id":"226275","messageId":"xmqqzjs016zx.fsf@gitster.dls.corp.google.com","threadId":"34789","inReplyTo":"1377813000-24465-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH] remote-hg: support for notes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-29T22:12:34Z","receivedAt":"2013-08-29T22:12:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n\nI somehow find this way under-explained to be useful for its users.\n\nIs it clear what \"support for notes\" means in the context of\nremote-hg?  Do we send data stored in our notes when we push back to\nHg?  Does Hg have a mechanism to store additional data out of band,\nand we add notes when we pull from Hg?  Or does this \"support\" do\nsomething else, and if so what does it do?\n\n>  contrib/remote-helpers/git-remote-hg | 32 +++++++++++++++++++++++++++++++-\n>  1 file changed, 31 insertions(+), 1 deletion(-)\n>\n> diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\n> index 307d82c..e49fcfa 100755\n> --- a/contrib/remote-helpers/git-remote-hg\n> +++ b/contrib/remote-helpers/git-remote-hg\n> @@ -23,6 +23,7 @@ import subprocess\n>  import urllib\n>  import atexit\n>  import urlparse, hashlib\n> +import time as ptime\n>  \n>  #\n>  # If you are not in hg-git-compat mode and want to disable the tracking of\n> @@ -126,6 +127,7 @@ class Marks:\n>          self.rev_marks = {}\n>          self.last_mark = 0\n>          self.version = 0\n> +        self.last_note = 0\n>  \n>      def load(self):\n>          if not os.path.exists(self.path):\n> @@ -137,6 +139,7 @@ class Marks:\n>          self.marks = tmp['marks']\n>          self.last_mark = tmp['last-mark']\n>          self.version = tmp.get('version', 1)\n> +        self.last_note = tmp.get('last-note', 0)\n>  \n>          for rev, mark in self.marks.iteritems():\n>              self.rev_marks[mark] = rev\n> @@ -150,7 +153,7 @@ class Marks:\n>          self.version = 2\n>  \n>      def dict(self):\n> -        return { 'tips': self.tips, 'marks': self.marks, 'last-mark' : self.last_mark, 'version' : self.version }\n> +        return { 'tips': self.tips, 'marks': self.marks, 'last-mark' : self.last_mark, 'version' : self.version, 'last-note' : self.last_note }\n>  \n>      def store(self):\n>          json.dump(self.dict(), open(self.path, 'w'))\n> @@ -525,6 +528,31 @@ def export_ref(repo, name, kind, head):\n>      print \"from :%u\" % rev_to_mark(head)\n>      print\n>  \n> +    pending_revs = set(revs) - notes\n> +    if pending_revs:\n> +        note_mark = marks.next_mark()\n> +        ref = \"refs/notes/hg\"\n> +\n> +        print \"commit %s\" % ref\n> +        print \"mark :%d\" % (note_mark)\n> +        print \"committer remote-hg <> %s\" % (ptime.strftime('%s %z'))\n> +        desc = \"Notes for %s\\n\" % (name)\n> +        print \"data %d\" % (len(desc))\n> +        print desc\n> +        if marks.last_note:\n> +            print \"from :%u\" % marks.last_note\n> +\n> +        for rev in pending_revs:\n> +            notes.add(rev)\n> +            c = repo[rev]\n> +            print \"N inline :%u\" % rev_to_mark(c)\n> +            msg = c.hex()\n> +            print \"data %d\" % (len(msg))\n> +            print msg\n> +        print\n> +\n> +        marks.last_note = note_mark\n> +\n>      marks.set_tip(ename, head.hex())\n>  \n>  def export_tag(repo, tag):\n> @@ -1126,6 +1154,7 @@ def main(args):\n>      global filenodes\n>      global fake_bmark, hg_version\n>      global dry_run\n> +    global notes, alias\n>  \n>      alias = args[1]\n>      url = args[2]\n> @@ -1165,6 +1194,7 @@ def main(args):\n>      except:\n>          hg_version = None\n>      dry_run = False\n> +    notes = set()\n>  \n>      repo = get_repo(url, alias)\n>      prefix = 'refs/hg/%s' % alias\n"},{"id":"226277","messageId":"1377815390-1480-1-git-send-email-felipe.contreras@gmail.com","threadId":"34789","inReplyTo":"xmqqzjs016zx.fsf@gitster.dls.corp.google.com","subject":"[PATCH v3] remote-hg: support for notes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T22:29:50Z","receivedAt":"2013-08-29T22:29:50Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Keep track of Mercurial revisions as Git notes under the 'refs/notes/hg'\nref, this way, the user can easily see which Mercurial revision\ncorrespond to certain Git commit.\n\nUnfortunately, there's no way to efficiently update the notes after\ndoing an export (push), so they'll have to be updated when importing\n(fetching).\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 35 ++++++++++++++++++++++++++++++++++-\n 1 file changed, 34 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 307d82c..7f50b40 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -23,8 +23,12 @@ import subprocess\n import urllib\n import atexit\n import urlparse, hashlib\n+import time as ptime\n \n #\n+# If you want to see Mercurial revisions as Git commit notes:\n+# git config core.notesRef refs/notes/hg\n+#\n # If you are not in hg-git-compat mode and want to disable the tracking of\n # named branches:\n # git config --global remote-hg.track-branches false\n@@ -126,6 +130,7 @@ class Marks:\n         self.rev_marks = {}\n         self.last_mark = 0\n         self.version = 0\n+        self.last_note = 0\n \n     def load(self):\n         if not os.path.exists(self.path):\n@@ -137,6 +142,7 @@ class Marks:\n         self.marks = tmp['marks']\n         self.last_mark = tmp['last-mark']\n         self.version = tmp.get('version', 1)\n+        self.last_note = tmp.get('last-note', 0)\n \n         for rev, mark in self.marks.iteritems():\n             self.rev_marks[mark] = rev\n@@ -150,7 +156,7 @@ class Marks:\n         self.version = 2\n \n     def dict(self):\n-        return { 'tips': self.tips, 'marks': self.marks, 'last-mark' : self.last_mark, 'version' : self.version }\n+        return { 'tips': self.tips, 'marks': self.marks, 'last-mark' : self.last_mark, 'version' : self.version, 'last-note' : self.last_note }\n \n     def store(self):\n         json.dump(self.dict(), open(self.path, 'w'))\n@@ -525,6 +531,31 @@ def export_ref(repo, name, kind, head):\n     print \"from :%u\" % rev_to_mark(head)\n     print\n \n+    pending_revs = set(revs) - notes\n+    if pending_revs:\n+        note_mark = marks.next_mark()\n+        ref = \"refs/notes/hg\"\n+\n+        print \"commit %s\" % ref\n+        print \"mark :%d\" % (note_mark)\n+        print \"committer remote-hg <> %s\" % (ptime.strftime('%s %z'))\n+        desc = \"Notes for %s\\n\" % (name)\n+        print \"data %d\" % (len(desc))\n+        print desc\n+        if marks.last_note:\n+            print \"from :%u\" % marks.last_note\n+\n+        for rev in pending_revs:\n+            notes.add(rev)\n+            c = repo[rev]\n+            print \"N inline :%u\" % rev_to_mark(c)\n+            msg = c.hex()\n+            print \"data %d\" % (len(msg))\n+            print msg\n+        print\n+\n+        marks.last_note = note_mark\n+\n     marks.set_tip(ename, head.hex())\n \n def export_tag(repo, tag):\n@@ -1126,6 +1157,7 @@ def main(args):\n     global filenodes\n     global fake_bmark, hg_version\n     global dry_run\n+    global notes, alias\n \n     alias = args[1]\n     url = args[2]\n@@ -1165,6 +1197,7 @@ def main(args):\n     except:\n         hg_version = None\n     dry_run = False\n+    notes = set()\n \n     repo = get_repo(url, alias)\n     prefix = 'refs/hg/%s' % alias\n-- \n1.8.4-fc\n"},{"id":"226281","messageId":"xmqqr4dc15b3.fsf@gitster.dls.corp.google.com","threadId":"34789","inReplyTo":"1377815390-1480-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v3] remote-hg: support for notes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-29T22:49:04Z","receivedAt":"2013-08-29T22:49:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> Keep track of Mercurial revisions as Git notes under the 'refs/notes/hg'\n> ref, this way, the user can easily see which Mercurial revision\n> correspond to certain Git commit.\n>\n> Unfortunately, there's no way to efficiently update the notes after\n> doing an export (push), so they'll have to be updated when importing\n> (fetching).\n>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  contrib/remote-helpers/git-remote-hg | 35 ++++++++++++++++++++++++++++++++++-\n>  1 file changed, 34 insertions(+), 1 deletion(-)\n>\n> diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\n> index 307d82c..7f50b40 100755\n> --- a/contrib/remote-helpers/git-remote-hg\n> +++ b/contrib/remote-helpers/git-remote-hg\n> @@ -23,8 +23,12 @@ import subprocess\n>  import urllib\n>  import atexit\n>  import urlparse, hashlib\n> +import time as ptime\n>  \n>  #\n> +# If you want to see Mercurial revisions as Git commit notes:\n> +# git config core.notesRef refs/notes/hg\n> +#\n\nYup.  This is better.  Will queue.\n"},{"id":"226461","messageId":"5222BC8A.3020605@alum.mit.edu","threadId":"34789","inReplyTo":"xmqqhae82nsb.fsf_-_@gitster.dls.corp.google.com","subject":"Re: Re* [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2013-09-01T04:03:22Z","receivedAt":"2013-09-01T04:03:22Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 08/29/2013 11:24 PM, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>>\n>>> Do I really need to quote the paragraph in CodingGuidelines?\n>>\n>> Existing violations are not an excuse to make things worse by adding\n>> more.  I think with these comments we can expect a reroll coming,\n>> and it should be trivial for any contributor to fix it while at it.\n> \n> Actually, I think not fixing it inside that 1/8 is good, as there\n> are many existing \"cmd > file\" (and worse, \"cmd > file-$x\") in these\n> test-*.sh scripts.  Clean-up is better done as a follow-up patch.\n> \n> Here are two that I noticed.\n> \n> -- >8 --\n> Subject: [PATCH 9/8] contrib/remote-helpers: style updates for test scripts\n> \n> During the review of the main series it was noticed that these test\n> scripts can use updates to conform to our coding style better, but\n> fixing the style should be done in a patch separate from the main\n> series.\n> \n> This updates the test-*.sh scripts only for styles:\n\ns/styles/style/\n\n> \n>  * We do not leave SP between a redirection operator and the\n>    filename;\n> \n>  * We change line before \"then\", \"do\", etc. rather than terminating\n>    the condition for \"if\"/\"while\" and list for \"for\" with a\n>    semicolon;\n> \n>  * When HERE document does not use any expansion, we quote the end\n>    marker (e.g. \"cat <<\\EOF\" not \"cat <<EOF\") to signal the readers\n>    that there is no funny substitution to worry about when reading\n>    the code.\n> \n\nPlease add\n\n    * We use \"test\" rather than \"[\".\n\n, as you made a few such changes as well.\n\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  contrib/remote-helpers/test-bzr.sh       | 112 +++++++++++-----------\n>  contrib/remote-helpers/test-hg-bidi.sh   |  52 ++++++-----\n>  contrib/remote-helpers/test-hg-hg-git.sh | 156 +++++++++++++++++--------------\n>  contrib/remote-helpers/test-hg.sh        | 154 +++++++++++++++---------------\n>  4 files changed, 248 insertions(+), 226 deletions(-)\n> \n> [...]\n\nAll of the changes in the patch look good to me.\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"},{"id":"226460","messageId":"5222BDF6.3080009@alum.mit.edu","threadId":"34789","inReplyTo":"xmqqd2ow2nqi.fsf@gitster.dls.corp.google.com","subject":"Re: Re* [PATCH 1/8] remote-bzr: fix export of utf-8 authors","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2013-09-01T04:09:26Z","receivedAt":"2013-09-01T04:09:26Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 08/29/2013 11:25 PM, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> Actually, I think not fixing it inside that 1/8 is good, as there\n>> are many existing \"cmd > file\" (and worse, \"cmd > file-$x\") in these\n>> test-*.sh scripts.  Clean-up is better done as a follow-up patch.\n>>\n>> Here are two that I noticed.\n>>\n>> -- >8 --\n>> Subject: [PATCH 9/8] contrib/remote-helpers: style updates for test scripts\n> \n> And here is the second one.\n> \n> -- >8 --\n> Subject: [PATCH 10/8] remote-helpers: quote variable references in redirection targets\n> \n> Even though it is not required by POSIX to double-quote the\n> redirection target in a variable, our code does so because some\n> versions of bash issue a warning without the quotes.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  contrib/remote-helpers/test-hg-hg-git.sh | 40 ++++++++++++++++----------------\n>  1 file changed, 20 insertions(+), 20 deletions(-)\n> [...]\n\nLooks good.\n\nReviewed-by: Michael Haggerty <mhagger@alum.mit.edu>\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"}]}