From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: Re: git ls-files -o under .git/ prints all repository files Date: Fri, 19 Jan 2007 16:41:56 +0900 Message-ID: <87k5zjsbsr.wl@mail2.atmark-techno.com> References: <87r6trsu7n.wl@mail2.atmark-techno.com> <7vwt3jjywc.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Jan 19 08:42:04 2007 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1H7oNt-0000Bh-Oz for gcvg-git@gmane.org; Fri, 19 Jan 2007 08:42:02 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964907AbXASHl6 (ORCPT ); Fri, 19 Jan 2007 02:41:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964913AbXASHl6 (ORCPT ); Fri, 19 Jan 2007 02:41:58 -0500 Received: from mail2.atmark-techno.com ([210.191.215.173]:34007 "EHLO mail2.atmark-techno.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964907AbXASHl5 (ORCPT ); Fri, 19 Jan 2007 02:41:57 -0500 Received: from wat.atmark-techno.com.atmark-techno.com (dns1.atmark-techno.com [210.191.215.170]) by mail2.atmark-techno.com (Postfix) with ESMTP id 557F030ABB; Fri, 19 Jan 2007 16:41:56 +0900 (JST) To: Junio C Hamano In-Reply-To: <7vwt3jjywc.fsf@assigned-by-dhcp.cox.net> User-Agent: Wanderlust/2.14.0 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: At Thu, 18 Jan 2007 22:47:47 -0800, Junio C Hamano wrote: > > Yasushi SHOJI writes: > > > ls-files -o prints all files under .git if you are in the .git > > directory. this is pretty dangerous since we now have git clean to > > delete files marked others. > > > > sure in UNIX env., you can easily shoot yourself in the foot. but it'd > > might be nice to help newbies. > > It's amusing to see that people can find obscure ways to shoot > themselves in the foot. > > Amusing problems deserve an equally amusing solution. Unfortunately, the amusing ;-) solution doesn't prevent them all. $ cd .git/objects $ git ls-fiels -o 0f/902e4635d4d7b8e532b485eeeb6399d0910710 bc/2d2dcb34e8313627d45ad6ef38beddf560501d ce/013625030ba8dba906f756967f9e9ca394464a $ git clean -d -x Removing 0f/ Removing bc/ Removing ce/ Removing info/ Removing pack/ I presume that if the cwd is the direct decedent of the current GIT_DIR, ls-files should print error saying "you are not in the working dir". or, just ignore '.git/*' all the time. $ git ls-files -o HEAD config : $ git ls-files -o --exclude='.git/*' $ What do you think? -- yashi