Re: bug: git-diff silently fails when run outside of a repository (v1.5.4.2)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 29, 2008, 22:53 UTC
- Message-ID
- <7vabjc5l3r.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <3c6c07c20804291304n36976417wf3c2a13303aa3133@mail.gmail.com>
"Mike Coleman" <tutufan@gmail.com> 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 bis supposed to work.