Re: Support for --stdin-paths in commit, add, etc
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 1, 2019, 20:26 UTC
- Message-ID
- <xmqqmugsmy2e.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <06daa8c1-d955-1e49-e5e6-85d53ffce6e6@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 9 quoted lines
> 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 <pathspec ...> | 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.