From: Junio C Hamano Date: Thu, 01 Aug 2019 20:26:49 GMT Subject: Re: Support for --stdin-paths in commit, add, etc Message-ID: In-Reply-To: <06daa8c1-d955-1e49-e5e6-85d53ffce6e6@gmail.com> Phillip Wood writes: > No but it only takes paths not pathspecs, can you filter out the > ignored paths first? From a UI point of view it would be better not to > allow users to select ignored files if you don't want to be able to > add them. If you want to use a pathspec then you can do 'git ls-files > --exclude-standard -o -z | git update-index --add -z > --stdin' > ... > You can use a temporary index, add the files you want to commit with > update-index --stdin and then run 'git commit' All true. Perhaps we need a separate tutorial for scripters to teach them how to properly combine the plumbing commands? > When I've been scripting I've sometimes wished that diff-index and > diff-files had a --stdin option. Sounds fair.