Fredrik Gustafsson [off-list ref] writes:
On Tue, Oct 04, 2011 at 05:24:03PM -0400, Federico Lucifredi wrote:
quoted
Found a minor bug in git today - the error message reported is not
correct when trying to access a repo that is not accessible
permission-wise:
quoted
federico@skyplex:/etc$ git log
fatal: Not a git repository (or any of the parent directories): .git
with correct access permissions, everything works as expected.
So if:
.git/ is a directory with not enought permissions.
../.git/ is a directory with enought permissions.
git would today use ../.git. You suggest that git instead would die
because a .git/ exists? (I'm not saying this is wrong or right).
For that matter, if you have .git/ that is a directory but is not a
repository, and ../.git/ that is, the same situation would arise. I do not
think we should die because .git/ is not a git repository. I do not know
if we should even warn about it.
On Thu, Oct 6, 2011 at 3:49 AM, Junio C Hamano [off-list ref] wrote:
quoted
So if:
.git/ is a directory with not enough permissions.
../.git/ is a directory with enough permissions.
git would today use ../.git. You suggest that git instead would die
because a .git/ exists? (I'm not saying this is wrong or right).
For that matter, if you have .git/ that is a directory but is not a
repository, and ../.git/ that is, the same situation would arise. I do not
think we should die because .git/ is not a git repository. I do not know
if we should even warn about it.
Probably not. On the other hand we should show user how we ignored
.git if we find no good repository in the end. So maybe it's a good
idea to queue up warnings and only print before git calls die("Not a
repository").
--
Duy
On Wed, Oct 05, 2011 at 09:49:00AM -0700, Junio C Hamano wrote:
Fredrik Gustafsson [off-list ref] writes:
quoted
On Tue, Oct 04, 2011 at 05:24:03PM -0400, Federico Lucifredi wrote:
quoted
Found a minor bug in git today - the error message reported is not
correct when trying to access a repo that is not accessible
permission-wise:
quoted
federico@skyplex:/etc$ git log
fatal: Not a git repository (or any of the parent directories): .git
with correct access permissions, everything works as expected.
So if:
.git/ is a directory with not enought permissions.
../.git/ is a directory with enought permissions.
git would today use ../.git. You suggest that git instead would die
because a .git/ exists? (I'm not saying this is wrong or right).
For that matter, if you have .git/ that is a directory but is not a
repository, and ../.git/ that is, the same situation would arise. I do not
think we should die because .git/ is not a git repository. I do not know
if we should even warn about it.
And what about unreadable .git files?
~/tmp/git/outside$ git init
Initialized empty Git repository in /home/szeder/tmp/git/outside/.git/
~/tmp/git/outside$ mkdir inside repo
~/tmp/git/outside$ cd inside/
~/tmp/git/outside/inside$ git init --separate-git-dir=../repo
Initialized empty Git repository in /home/szeder/tmp/git/outside/repo/
~/tmp/git/outside/inside$ git rev-parse --git-dir
/home/szeder/tmp/git/outside/repo
~/tmp/git/outside/inside$ chmod a-r .git
~/tmp/git/outside/inside$ git rev-parse --git-dir
fatal: Error opening '.git': Permission denied
Or a non-gitfile .git file?
~/tmp/git/outside/inside$ chmod a+r .git
~/tmp/git/outside/inside$ echo foo >.git
~/tmp/git/outside/inside$ git rev-parse --git-dir
fatal: Invalid gitfile format: .git
Shouldn't these also be ignored?
Best,
Gábor