# create easy to parse list of added / ,odified files

3 messages from 2010-09-03 to 2010-09-05. Participants: Gelonida, Jonathan Nieder.
Thread: https://gitlist.dev/t/24956

## Gelonida, 2010-09-03 06:36

Subject: create easy to parse list of added / ,odified files
Message-ID: <i5q524$9fc$1@dough.gmane.org>
URL: https://gitlist.dev/e/i5q524%249fc%241%40dough.gmane.org

```
Hi,


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.

TIA

```

## Jonathan Nieder, 2010-09-03 06:39

Subject: Re: create easy to parse list of added / ,odified files
Message-ID: <20100903063917.GA13519@burratino>
URL: https://gitlist.dev/e/20100903063917.GA13519%40burratino
In-Reply-To: <i5q524$9fc$1@dough.gmane.org>

```
Hi,

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

Hope that helps.

```

## Gelonida, 2010-09-05 21:50

Subject: Re: create easy to parse list of added / ,odified files
Message-ID: <i613am$uet$2@dough.gmane.org>
URL: https://gitlist.dev/e/i613am%24uet%242%40dough.gmane.org
In-Reply-To: <20100903063917.GA13519@burratino>

```
Hi Jonathan,

On 09/03/2010 08:39 AM, Jonathan Nieder wrote:
> 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)

```
