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

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

From
Jeff King <peff@peff.net>
Date
Jul 31, 2019, 17:19 UTC
Message-ID
<20190731171956.GA26746@sigill.intra.peff.net>
In-Reply-To
<a38bc928-7ccd-e2d9-b89b-23298e9fa95d@syntevo.com>
On Wed, Jul 31, 2019 at 05:45:12PM +0200, Alexandr Miloslavskiy wrote:
Show 15 quoted lines
> In our git UI, we sometimes run into OS commandline length limit when
> trying to specify a list of pathspecs. For example, this happens when
> user selects a large set of files and wants to commit them. As a
> workaround, we split files and issue multiple git commands.
> 
> This has multiple disadvantages:
> 1) Some commands are a lot slower this way. For example, commit-amend
>    can take 45 minutes instead of 30 seconds, because git will do a lot
>    of unnecessary work.
> 2) The operation is no longer completed in one "transaction".
> 3) This makes our code more complicated.
> 
> Our suggestion is to change commands such as 'commit', 'add', etc to
> also work with --stdin-paths. If a command already supports stdin for
> any purpose, then trying to use both options will return an error.

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.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 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.