Subject: Re: git ls-files -o under .git/ prints all repository files

From: Simon 'corecode' Schubert <[email-masked]>
Date: Fri, 19 Jan 2007 09:07:02 +0100

Alex Riesen wrote:
>> I guess you are not serious.  I wonder, why does git-ls-files ever
>> list files under .git?  I'd just say:  fail if you want to list $GIT_DIR.
> 
> Not list. Clean. What's wrong with listing them?

i would claim .git to be off limits and unrelated to the working dir (file-wise).  if you want to list files there, do a find . or so.  After all you wouldn't expect cd /usr && git-ls-files -o work there unless you have a /.git or /usr/.git, right?

>>  Maybe other tools should do so as well.
>>
>> % cd .hg && hg status -A .
>> abort: path contains illegal component: .hg
>>
>> I think this is a sensible thing to do.
> 
> No, it isn't. It is not unlikely to have repo in repo
> (and some people already have them).
> Mercurial is wrong here.

what do you mean with repo-in-repo?  something like .git/.git?  My suggestion does not break this:

% mkdir foo && cd foo && git init
% cd .git && git init
% 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
info/exclude
% git ls-files -o ..
fatal: '..' is outside repository

Here the repo root is "foo/.git" and not "foo".

So my suggestion still stands:  .git is off limits.

cheers
  simon

-- 
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \