Git development
 help / color / mirror / Atom feed
* git ls-files -o under .git/ prints all repository files
@ 2007-01-19  1:04 Yasushi SHOJI
  2007-01-19  6:47 ` Junio C Hamano
  2007-01-19  8:01 ` Alex Riesen
  0 siblings, 2 replies; 26+ messages in thread
From: Yasushi SHOJI @ 2007-01-19  1:04 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2007-01-24 22:51 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-19  1:04 git ls-files -o under .git/ prints all repository files Yasushi SHOJI
2007-01-19  6:47 ` Junio C Hamano
2007-01-19  7:27   ` Andy Parkins
2007-01-19  8:32     ` Junio C Hamano
2007-01-19  9:04       ` Andy Parkins
2007-01-19  7:41   ` Yasushi SHOJI
2007-01-19  7:51   ` Simon 'corecode' Schubert
2007-01-19  7:57     ` Alex Riesen
2007-01-19  8:07       ` Simon 'corecode' Schubert
2007-01-19  8:32         ` Alex Riesen
2007-01-19  9:04           ` Simon 'corecode' Schubert
2007-01-19  9:33             ` Alex Riesen
2007-01-19 10:10               ` Simon 'corecode' Schubert
2007-01-19 10:38                 ` Alex Riesen
2007-01-19 12:19                   ` Simon 'corecode' Schubert
2007-01-19 13:30       ` Andreas Ericsson
2007-01-19 13:46         ` Matthias Kestenholz
2007-01-19 15:00           ` Johannes Schindelin
2007-01-19 19:03             ` Junio C Hamano
2007-01-23 11:12               ` Yasushi SHOJI
2007-01-23 12:30                 ` [PATCH] Commands requiring a work tree must not run in GIT_DIR Johannes Schindelin
2007-01-24 11:44                   ` Junio C Hamano
2007-01-24 14:14                     ` Johannes Schindelin
2007-01-24 22:51                       ` Junio C Hamano
2007-01-19  8:02   ` git ls-files -o under .git/ prints all repository files Alex Riesen
2007-01-19  8:01 ` Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox