Skip to contentSkip to conversation

list of files that have been added/removed

DISCUSSION layer 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore

layer

author
#0 lore raw

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

#1 lore raw
Quoted 5 lines · layer

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.

author
#2 lore raw
Quoted 10 lines · Junio C Hamano
Quoted 10 lines
Quoted 5 lines · layer

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.

Quoted 15 lines
Quoted 15 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to layer
Quoted 11 lines · layer <layer <at> 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.

Thanks.

Kevin

Perhaps:
git diff --name-only