Re: [bug?] git diff --cached in a non-git directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<rsbecker@xxxxxxxxxxxxx> writes:

>>error: unknown option `cached'
>>usage: git diff --no-index [<options>] <path> <path> [...]
> ...
> Because you are not in a git repository clone, the --cached option has no
> meaning.

Yes.  "git diff" unfortunately has a mode where a limited subset of
its features is available and that is called the "--no-index" mode.

Because the command is capable of working outside a repository, "You
are not in a repository" is a not a good error message in this
situation, either.  It is not that you stepped outside a repository
that is your error.  It is not that you used "--cached" that is your
error, either.  You used "--cached" outside a repository, that is
where your error is.

A patch to improve the error messages in such a situation is
certainly welcome.

Thanks.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux