* bogus "fatal: Not a git repository"
@ 2006-05-25 15:22 Linus Torvalds
2006-05-25 21:38 ` Johannes Schindelin
0 siblings, 1 reply; 2+ messages in thread
From: Linus Torvalds @ 2006-05-25 15:22 UTC (permalink / raw
To: Git Mailing List, Junio C Hamano, Johannes Schindelin
I was just testing that "git ls-remote" change by Junio, and when you're
not in a git repository, it gives this totally bogus warning. The _target_
obviously has to be a git repository, but there's no reason why you'd have
to be in a local git repo when doing an ls-remote.
The reason is commit 73136b2e8a8ee024320c5ac6a0f14f912432bf03 by Dscho: it
adds calls to git-repo-config in git-parse-remote.sh to get the remote
shorthands etc.
Now, either we should just hide and ignore the error from git-repo-config
(probably bad, because some errors _are_ valid - like git-repo-config
failing due to bad syntax in the config file), or we should just make
git-repo-config quietly handle the case of not being in a git repository.
This does the latter: just quietly accepting (and doing nothing - trying
to set a value will result in the lock-file failing) our lot in life
sounds better than dying with a bogus error message.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/repo-config.c b/repo-config.c
index 127afd7..08fc4cc 100644
--- a/repo-config.c
+++ b/repo-config.c
@@ -108,7 +108,8 @@ static int get_value(const char* key_, c
int main(int argc, const char **argv)
{
- setup_git_directory();
+ int nongit = 0;
+ setup_git_directory_gently(&nongit);
while (1 < argc) {
if (!strcmp(argv[1], "--int"))
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: bogus "fatal: Not a git repository"
2006-05-25 15:22 bogus "fatal: Not a git repository" Linus Torvalds
@ 2006-05-25 21:38 ` Johannes Schindelin
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Schindelin @ 2006-05-25 21:38 UTC (permalink / raw
To: Linus Torvalds; +Cc: Git Mailing List, Junio C Hamano
Hi,
On Thu, 25 May 2006, Linus Torvalds wrote:
> The reason is commit 73136b2e8a8ee024320c5ac6a0f14f912432bf03 by Dscho: it
> adds calls to git-repo-config in git-parse-remote.sh to get the remote
> shorthands etc.
Yes, I did not think of that special case. Sorry. If you need it, here is
Acked-By: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Ciao,
Dscho
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-05-25 21:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-25 15:22 bogus "fatal: Not a git repository" Linus Torvalds
2006-05-25 21:38 ` Johannes Schindelin
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).