Re: Destructive side-effect of "cg-status"
- From
- Wolfgang Denk <wd@denx.de>
- Date
- Oct 1, 2005, 19:42 UTC
- Message-ID
- <20051001194216.EE3E5353D8E@atlas.denx.de>
- In-Reply-To
- <Pine.LNX.4.64.0510010934290.3378@g5.osdl.org>
In message <Pine.LNX.4.64.0510010934290.3378@g5.osdl.org> Linus Torvalds wrote:
Show 6 quoted lines
> > Also, arguably we should try to avoid writing the index file when not > necessary, although the fact is, that cg-status (and "git status") _do_ > need to actually keep it up-to-date in order to do the right thing. Also > true of some other programs that might otherwise appear to be read-only > (ie I've considered doing the same thing for "git diff").
But shouldn't it be possible to run such commands as "status" and "diff" in a repository for which I have only read permissions? Or how can I find out about the status of another user's repository without actually modifying it?
Also, error reporting is IMHO not sufficient and misleading. For example:
$ git status 2>&1 | less error: open failed # # Updated but not checked in: # (will commit) # # deleted: CHANGELOG # deleted: COPYING # deleted: CREDITS # deleted: MAINTAINERS # deleted: MAKEALL # deleted: Makefile # deleted: README ... [all files in the repository flagged as "deleted" !] # error: open failed read_cache: Permission denied
The "error: open failed" should at leats include the file name and the errno/strerror message. Same for the "read_cache: Permission denied" - of course, if you knot the git internals you will know what this means, but the average user has no idea that he should check the permissions of .git/index.
Finally, a thick fat warning should be added to the documentation that these commands actually (may) modify the repository. This was totally unexpected for me.
Thanks.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
In an infinite universe all things are possible, including the possi-
bility that the universe does not exist.
- Terry Pratchett, _The Dark Side of the Sun_