Re: git-diff new files (without using index)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 5, 2007, 04:20 UTC
- Message-ID
- <7vd4y2ipd0.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20070805040841.GG9527@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 9 quoted lines
>> The above sort of quirkiness does seem kind of a wart though; in my >> (admittedly limited, using git) experience this sort of thing really >> reduces the utility of the index, and I often end up feeling like it's >> just getting in the way as a result. Does adding something like a >> "git-diff -N" option seem a _bad_ idea? > > I'm not interested in such an option. Typically if I want a > diff on a new untracked file I actually want that file in my next > commit anyway.
I suspect that it's probably half superstition and half disease to wish for "diff /dev/null new-file". Even CVS got this one right by saying "is a new file, no diff available". The contents of that new file is available in "less new-file" near you anyway and it is quite pointless while you are working toward next commit. It just is not interesting, until you tell git you _care_ about that file. And the way you tell git about it is with "git add".
Learn to love the index, run "git-add" and view "git-diff HEAD".