From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: git ls-files -o under .git/ prints all repository files Date: Fri, 19 Jan 2007 10:04:12 +0900 Message-ID: <87r6trsu7n.wl@mail2.atmark-techno.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-From: git-owner@vger.kernel.org Fri Jan 19 02:36:11 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 1H7ifp-00025L-RB for gcvg-git@gmane.org; Fri, 19 Jan 2007 02:36:10 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932842AbXASBgE (ORCPT ); Thu, 18 Jan 2007 20:36:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932843AbXASBgD (ORCPT ); Thu, 18 Jan 2007 20:36:03 -0500 Received: from mail2.atmark-techno.com ([210.191.215.173]:50338 "EHLO mail2.atmark-techno.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932842AbXASBgC (ORCPT ); Thu, 18 Jan 2007 20:36:02 -0500 X-Greylist: delayed 1906 seconds by postgrey-1.27 at vger.kernel.org; Thu, 18 Jan 2007 20:36:02 EST 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 090B529DFA; Fri, 19 Jan 2007 10:04:12 +0900 (JST) To: git@vger.kernel.org User-Agent: Wanderlust/2.14.0 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Hi all, 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. I'm not sure how we should fix this. should we 1) prevent to run any git command under .git unless .git is also managed by git (ie. .git/.git or something exists) 2) prevent ls-files -o to print any files under .git/ even if we are in the directory. the way to reproduce is: $ git init Initialized empty Git repository in .git/ $ echo hello > hello.c $ git add . $ git commit -m initial Created initial commit b40c824b521f6c60434043f0cce08a88b4031ed8 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 hello.c $ cd .git $ git ls-files -o HEAD config description hooks/applypatch-msg hooks/commit-msg hooks/post-commit hooks/post-update hooks/pre-applypatch hooks/pre-commit hooks/pre-rebase hooks/update index info/exclude logs/refs/heads/master objects/b4/0c824b521f6c60434043f0cce08a88b4031ed8 objects/bc/2d2dcb34e8313627d45ad6ef38beddf560501d objects/ce/013625030ba8dba906f756967f9e9ca394464a refs/heads/master $ git clean Removing HEAD Not removing branches/ Removing config Removing description Not removing hooks/ Removing index Not removing info/ Not removing logs/ Not removing objects/ Not removing refs/ Not removing remotes/ $ cd .. $ git ls-files fatal: Not a git repository $ -- yashi