git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Support for --stdin-paths in commit, add, etc

From
AMAlexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Date
Aug 1, 2019, 13:25 UTC
Message-ID
<ab333992-35c6-a5a9-0bcb-cef51f004679@syntevo.com>
In-Reply-To
<20190731171956.GA26746@sigill.intra.peff.net>
On 31.07.2019 19:19, Jeff King wrote:
Show 5 quoted lines
> I don't have any real objection to adding stdin support for more
> commands. Bu tin the specific case you're discussing, it seems like
> using "git update-index" might already solve your problem. It's the
> intended plumbing for scripted index updates, and it already supports
> receiving paths from stdin.

I have now studied which git commands already use commandline splitting in our application. For some of them, I didn't find comparable plumbing; for others, I feel that a lot of new edge cases will arise, and it will need a lot of testing to make sure things work as expected.

Therefore, for us it would be best if high-level commands also accepted --stdin-paths. If I develop good enough patches for that, will you accept them?

We're interested in these high-level commands:
1) git add
2) git rm
3) git checkout
4) git reset
5) git stash
6) git commit
Here's the list of detailed commands and plumbings I found:
01) git add
     'git update-index' doesn't seem to be able to skip ignored files.
02) git add --force
     Probably 'git update-index --add --stdin'.
03) git checkout
     Probably 'git checkout-index --stdin'
04) git checkout HEAD
     Didn't find a plumbing to only affect named paths.
05) git checkout --ours
     Probably 'git checkout-index --stage=2 --force --stdin'
06) git checkout --theirs
     Probably 'git checkout-index --stage=3 --force --stdin'
07) git rm [--force] [--cached]
     Probably 'git update-index --force-remove'
     Didn't find how to delete files from working tree.
08) git reset -q HEAD
     Didn't find a plumbing to only affect named paths.
09) git add --update
     Probably 'git update-index --again --add --stdin'
     Not sure that --again is good replacement.
10) git stash push [--keep-index] [--include-untracked] [--message]
     Didn't find plumbing for stashes.
11) git commit [--allow-empty] [--amend] [--signoff] [--no-verify]
       --file=CommitMessage.txt -o
     Didn't find a plumbing to only affect named staged paths.
Previous: Junio C HamanoNext: Phillip Wood
Message 5 of 23 in “Support for --stdin-paths in commit, add, etc”
  1. Alexandr MiloslavskiyJul 31, 2019
  2. Junio C HamanoJul 31, 2019
  3. Jeff KingJul 31, 2019
  4. Junio C HamanoJul 31, 2019
  5. Alexandr MiloslavskiyAug 1, 2019
  6. Phillip WoodAug 1, 2019
  7. Junio C HamanoAug 1, 2019
  8. Alexandr MiloslavskiyAug 1, 2019
  9. Johannes SchindelinAug 2, 2019
  10. Alexandr MiloslavskiyAug 2, 2019
  11. Johannes SchindelinAug 2, 2019
  12. Alexandr MiloslavskiyAug 2, 2019
  13. Alexandr MiloslavskiyAug 2, 2019
  14. Johannes SchindelinAug 2, 2019
  15. Alexandr MiloslavskiyAug 2, 2019
  16. René ScharfeAug 1, 2019
  17. Alexandr MiloslavskiyAug 1, 2019
  18. Junio C HamanoAug 1, 2019
  19. Alexandr MiloslavskiyAug 1, 2019
  20. Junio C HamanoAug 1, 2019
  21. Alexandr MiloslavskiyAug 1, 2019
  22. Johannes SchindelinAug 2, 2019
  23. Alexandr MiloslavskiyAug 2, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.