--- /dev/null
+Return-Path: <david@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id B42CC431FBD\r
+ for <notmuch@notmuchmail.org>; Sat, 8 Mar 2014 04:43:40 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Gv0-hjyu7YvC for <notmuch@notmuchmail.org>;\r
+ Sat, 8 Mar 2014 04:43:33 -0800 (PST)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 61152431FB6\r
+ for <notmuch@notmuchmail.org>; Sat, 8 Mar 2014 04:43:33 -0800 (PST)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1WMGbC-0003DJ-Kt; Sat, 08 Mar 2014 08:43:30 -0400\r
+Received: (nullmailer pid 20837 invoked by uid 1000); Sat, 08 Mar 2014\r
+ 12:43:26 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: "W. Trevor King" <wking@tremily.us>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with\r
+ @{upstream}\r
+In-Reply-To:\r
+ <80db13662a0313711ca3a91e338a63d35e64a83c.1391898002.git.wking@tremily.us>\r
+References:\r
+ <80db13662a0313711ca3a91e338a63d35e64a83c.1391898002.git.wking@tremily.us>\r
+User-Agent: Notmuch/0.17+106~g0421995 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sat, 08 Mar 2014 08:43:26 -0400\r
+Message-ID: <87siqsrhch.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 08 Mar 2014 12:43:40 -0000\r
+\r
+"W. Trevor King" <wking@tremily.us> writes:\r
+\r
+\r
+> +sub do_clone {\r
+> + my $repository = shift;\r
+> + system ('git', 'clone', '--bare', $repository, $NMBGIT) == 0\r
+> + or die "'git clone' exited with nonzero value\n";\r
+> + my $branch = git ('symbolic-ref', 'HEAD');\r
+> + $branch =~ s|^refs/heads/||;\r
+> + git ('config', 'remote.origin.fetch', '+refs/heads/*:refs/remotes/origin/*');\r
+> + git ('config', "branch.$branch.remote", 'origin');\r
+> + git ('config', "branch.$branch.merge", 'refs/heads/$branch');\r
+> + do_fetch();\r
+> +}\r
+\r
+I think doing a fetch immediately after a clone deserves a comment.\r
+\r
+> \r
+> @@ -473,7 +487,7 @@ sub diff_index {\r
+> sub diff_refs {\r
+> my $filter = shift;\r
+> my $ref1 = shift || 'HEAD';\r
+> - my $ref2 = shift || 'FETCH_HEAD';\r
+> + my $ref2 = shift || '@{upstream}';\r
+\r
+I wonder about hard-coding '@{upstream}' in several places. What do you\r
+think about a global "constant"? OF course it was hard-coded FETCH_HEAD\r
+before, but I think not in quite as many places.\r