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

Re: Get a git diff without taking index into account

From
Jeff King <peff@peff.net>
Date
Feb 18, 2015, 22:30 UTC
Message-ID
<20150218223013.GA16287@peff.net>
In-Reply-To
<CAAoZyYOT_OQZ+rrwFvnsVBV_sYRA4Oti3vRNnE6_RaV9w8qxdg@mail.gmail.com>
On Wed, Feb 18, 2015 at 04:38:55PM -0500, Eric Frederich wrote:
Show 5 quoted lines
> Also, how would I go about detecting untracked files the way status does?
> There is no way to specify a HEAD per git command using switches or
> environment variables.
> I can't change the HEAD of the Git repo because other processes may be
> using it at the same time.

Untracked files are a function of the index, not of the HEAD. So you would load whatever tree you like into your index (either "the" index, or a temporary one you specify with GIT_INDEX_FILE), and then "git ls-files -o".

-Peff
Previous: Junio C Hamano
Message 11 of 11 in “Get a git diff without taking index into account”
  1. Eric FrederichFeb 18, 2015
  2. Eric FrederichFeb 18, 2015
  3. Junio C HamanoFeb 18, 2015
  4. Eric FrederichFeb 18, 2015
  5. Junio C HamanoFeb 18, 2015
  6. Eric FrederichFeb 18, 2015
  7. Jeff KingFeb 18, 2015
  8. Eric FrederichFeb 18, 2015
  9. Eric FrederichFeb 18, 2015
  10. Junio C HamanoFeb 18, 2015
  11. Jeff KingFeb 18, 2015

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.