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

Re: determine if the tree is dirty

From
Adam Mercer <ramercer@gmail.com>
Date
Nov 3, 2009, 19:30 UTC
Message-ID
<799406d60911031130u3e37677fi1a8dfd6f7fdfdfe9@mail.gmail.com>
In-Reply-To
<7v3a4vs9g3.fsf@alter.siamese.dyndns.org>
On Tue, Nov 3, 2009 at 13:06, Jeff Epler <jepler@unpythonic.net> wrote:
> GIT-VERSION-GEN uses something like this (shell script):
>        git update-index -q --refresh
>        test -z "$(git diff-index --name-only HEAD --)" || VN="$VN-dirty" ;;
On Tue, Nov 3, 2009 at 13:19, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Use plumbing commands.
>
> "git diff-files" will show changes you have in the work tree compared to
> the index.
>
> "git diff-index HEAD" will show changes you have in the work tree compared
> to the HEAD.
>
> "git diff-index --cached HEAD" will show changes you have in the index
> compared to the HEAD.
Fantastic, this is exactly what I was after! Thanks!
Cheers
Adam
Previous: Junio C HamanoNext: Markus Hitter
Message 4 of 5 in “determine if the tree is dirty”
  1. Adam MercerNov 3, 2009
  2. Jeff EplerNov 3, 2009
  3. Junio C HamanoNov 3, 2009
  4. Adam MercerNov 3, 2009
  5. Markus HitterNov 3, 2009

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.