Re: diff-index --cached on bare repository

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

 



On Fri, Jan 30, 2009 at 04:13:53PM +0000, Johannes Gilger wrote:

> today I stumbled over the output of "git diff-index --cached HEAD" in a 
> bare repository. While diff-index HEAD just reminds me that I got to 
> have a work-tree, --cached outputs all the files in HEAD as deleted. The 
> question is if this is intended behaviour? Or is it irrelevant because 
> diff-index is only plumbing? I found a mail of the gitk-team working 
> around this, which is funny because I discovered this while working on 
> GitX.

Generally commands which don't make sense in a bare repository are
forbidden. But diff-index _can_ work in a bare repository, since there
is no reason you can't do index-only operations. However, a bare repo
has no index by default, in which case diff-index shows the results you
saw.

So no, it's not a bug, but it is potentially confusing. I think nobody
ever worried about it because diff-index is plumbing, so users are
unlikely to stumble into it.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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