git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-diff new files (without using index)

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 5, 2007, 04:08 UTC
Message-ID
<20070805040841.GG9527@spearce.org>
In-Reply-To
<87r6miljfr.fsf@catnip.gol.com>
Miles Bader <miles@gnu.org> wrote:
> Thanks for the tip (I guess I can roll my own "git-diff-uncached"
> script)!
Indeed, Git is quite scriptable.  ;-)
 
Show 5 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. So I'm usually staging it into the index along with everything else that I have modified. In which case this quirkiness isn't really a quirk at all. Its just not an issue to me.

If you want to try adding it, go right ahead. The source for git is stored in git and available from many places. :-)

-- 
Shawn.
Previous: Miles BaderNext: Junio C Hamano
Message 4 of 6 in “git-diff new files (without using index)”
  1. Miles BaderAug 5, 2007
  2. Shawn O. PearceAug 5, 2007
  3. Miles BaderAug 5, 2007
  4. Shawn O. PearceAug 5, 2007
  5. Junio C HamanoAug 5, 2007
  6. Miles BaderAug 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.