From: Mike Coleman Date: Tue, 29 Apr 2008 23:03:08 GMT Subject: Re: bug: git-diff silently fails when run outside of a repository (v1.5.4.2) Message-ID: <3c6c07c20804291603q4fbe957eq3e3da39d4a2e29c0@mail.gmail.com> In-Reply-To: <7vabjc5l3r.fsf@gitster.siamese.dyndns.org> Oh, I didn't realize that. It doesn't seem to be mentioned on the man page, though I can't necessarily claim that I would have seen it if it had. Even so, this seems like a bug. If I do this: $ cd / $ git-diff there is no error message and no error status. A diagnostic would be very helpful. Mike On Tue, Apr 29, 2008 at 5:53 PM, Junio C Hamano wrote: > "Mike Coleman" writes: > > > At least in version 1.5.4.2, git-diff silently fails when not run > > inside a repository. It should give an error diagnostic, especially > > since "no output" would otherwise be a meaningful response. > > Unfortunately this does not have enough information to go by, as unlike > many other programs, "git diff" contains a hack to be usable as a better > (for certain definition of "better" I may not necessarily agree with) GNU > diff replacement when run outside a repository. > > i.e. > > mkdir -p /var/tmp/junk > cd /var/tmp/junk > rm -fr .git ;# make sure it is not a repository > echo >a hello > echo >b world > git diff --color a b > > is supposed to work. >