threads / discuss / 18888

Re: list of files that have been added/removed

Subject: Re: list of files that have been added/removed

## tl;dr

4 messages between Apr 15, 2009 and Apr 15, 2009.

replies: 3people: 3as markdown or json

layer· Apr 15, 2009, 21:37 UTC · lore
  I see the changes in the index with "git status" as "deleted" or
  "added".  

I meant "new file" here. Of course I can process the output of "git status", but I was looking for a cleaner method, if there is one.

Thanks.
Kevin
Eric Raible· Apr 15, 2009, 21:42 UTC · re: layer · lore
layer <layer <at> known.net> writes:
Show 11 quoted lines
> 
>   I see the changes in the index with "git status" as "deleted" or
>   "added".  
> 
> I meant "new file" here.  Of course I can process the output of "git
> status", but I was looking for a cleaner method, if there is one.
> 
> Thanks.
> 
> Kevin
> 

Perhaps: git diff --name-only

Junio C Hamano· Apr 15, 2009, 21:43 UTC · re: layer · lore
layer <layer@known.net> writes:
Show 5 quoted lines
>   I see the changes in the index with "git status" as "deleted" or
>   "added".  
>
> I meant "new file" here.  Of course I can process the output of "git
> status", but I was looking for a cleaner method, if there is one.
"Process" as in "Read in a script and have it act on the information"?
git diff-index --name-status HEAD

would be one Kosher way for the scripts, and if your scripting language can handle NUL terminated string, giving -z option would make your script more robust against funny pathnames.

git diff-index --name-only --diff-filter=A HEAD
if you only care about "new file" and nothing else.
layer· Apr 15, 2009, 21:57 UTC · re: Junio C Hamano · lore
Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
>> layer <layer@known.net> writes:
>> 
>> >   I see the changes in the index with "git status" as "deleted" or
>> >   "added".  
>> >
>> > I meant "new file" here.  Of course I can process the output of "git
>> > status", but I was looking for a cleaner method, if there is one.
>> 
>> "Process" as in "Read in a script and have it act on the
>> information"?
Yes.  Junio, your answer was perfect.  Thanks.
Show 15 quoted lines
>> 
>> git diff-index --name-status HEAD
>> 
>> would be one Kosher way for the scripts, and if your scripting language
>> can handle NUL terminated string, giving -z option would make your script
>> more robust against funny pathnames.
>> 
>> git diff-index --name-only --diff-filter=A HEAD
>> 
>> if you only care about "new file" and nothing else.
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

← back to recent threads