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

Re: create easy to parse list of added / ,odified files

From
GGelonida <gelonida@gmail.com>
Date
Sep 5, 2010, 21:50 UTC
Message-ID
<i613am$uet$2@dough.gmane.org>
In-Reply-To
<20100903063917.GA13519@burratino>
Hi Jonathan,
On 09/03/2010 08:39 AM, Jonathan Nieder wrote:
Show 19 quoted lines
> Gelonida wrote:
> 
>> for a pre-commit trigger I would like to retrieve the list of modified
>> files, such, that I could analyze the contents prior to commit.
>>
>> what would be the best command for this
>>
>>
>> I thought about using "git status", but wondered, which other command
>> might return a nicer to parse list.
> 
> If you look at the git(1) man page, you will find a number of such
> "low-level (plumbing) interrogation commands" listed.  For example:
> 
>  . git diff-index
>  . git diff-files
>  . git update-index
>  . git status --porcelain
> 
Thanks for your answer.

I'm currently using git diff-index HEAD --cached

This seems to do what I was looking for.

git status --porcelain doesn't exist on my old cygwin git (I assume it's proably a little too old)

Previous: Jonathan Nieder
Message 3 of 3 in “create easy to parse list of added / ,odified files”
  1. GelonidaSep 3, 2010
  2. Jonathan NiederSep 3, 2010
  3. GelonidaSep 5, 2010

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.