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

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

From
Miles Bader <miles@gnu.org>
Date
Aug 5, 2007, 04:00 UTC
Message-ID
<87r6miljfr.fsf@catnip.gol.com>
In-Reply-To
<20070805035245.GE9527@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 5 quoted lines
>> If I add things to the index, I can use "git-diff --cached" to do it;
>> however I'd actually like to be able to do this _without_ updating the
>> index
>
> Use a temporary index:
...
> Another option is to just add everything, then reset the index:
...
> Granted if you had other files staged they just became unstaged
> and will need to be restaged...  the temporary index trick above
> avoids that.

Thanks for the tip (I guess I can roll my own "git-diff-uncached" script)!

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?

Thanks,
-Miles
-- 
"Suppose He doesn't give a shit?  Suppose there is a God but He
just doesn't give a shit?"  [George Carlin]
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 3 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.