From 42f910e6a270be3a0227d45ac61a5361907f67fd Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 13 Apr 2014 13:30:32 +2100 Subject: [PATCH] [PATCH] nmbug: mark repository as bare on clone --- 30/fb505f1ba63f84133221763d3891ac163cdad1 | 78 +++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 30/fb505f1ba63f84133221763d3891ac163cdad1 diff --git a/30/fb505f1ba63f84133221763d3891ac163cdad1 b/30/fb505f1ba63f84133221763d3891ac163cdad1 new file mode 100644 index 000000000..df92c55a0 --- /dev/null +++ b/30/fb505f1ba63f84133221763d3891ac163cdad1 @@ -0,0 +1,78 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id DB7BD431FC0 + for ; Sat, 12 Apr 2014 09:30:55 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id yEqMccvJCYd7 for ; + Sat, 12 Apr 2014 09:30:51 -0700 (PDT) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0E409431FC3 + for ; Sat, 12 Apr 2014 09:30:51 -0700 (PDT) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1WZ0pM-0004Ow-JE; Sat, 12 Apr 2014 13:30:48 -0300 +Received: (nullmailer pid 5173 invoked by uid 1000); Sat, 12 Apr 2014 + 16:30:44 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH] nmbug: mark repository as bare on clone +Date: Sat, 12 Apr 2014 13:30:32 -0300 +Message-Id: <1397320232-32458-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.9.1 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 12 Apr 2014 16:30:56 -0000 + +As far as I can figure out, if a git repository is non-bare, then it +should either have core.worktree set, or the parent directory should +be the worktree. Since the parent directory is usually the user's home +directory, we don't want that. Although unlikely to be typed by +mistake + +% cd $HOME && ln -s .nmbug .git && git reset --hard + +would delete a bunch of files. +--- + +Hah, I managed to escalate a documentation quibble into a +sortof-security issue. + + devel/nmbug/nmbug | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug +index d6f5213..b18ded7 100755 +--- a/devel/nmbug/nmbug ++++ b/devel/nmbug/nmbug +@@ -134,6 +134,7 @@ sub do_clone { + $repository, $tempwork) == 0 + or die "'git clone' exited with nonzero value\n"; + git ('config', '--unset', 'core.worktree'); ++ git ('config', 'core.bare', 'true'); + } + + sub is_committed { +-- +1.9.1 + -- 2.26.2