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

Re: pathspec: problems with too long command line

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 21, 2018, 13:37 UTC
Message-ID
<xmqq7eh67dqq.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20181121132152.GA8246@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
> On Wed, Nov 21, 2018 at 10:23:34AM +0100, Marc Strapetz wrote:
>
>> From our GUI client we are invoking git operations on a possibly large set
>> of files. ...
>> command line length, especially on Windows [1] and OSX [2]. To workaround
>> this problem we are currently splitting up such operations by invoking
>> multiple git commands. This works well for some commands (like add), but
>> doesn't work well for others (like commit).
> Quite a few commands take --stdin, which can be used to send pathspecs
> (and often other stuff) without size limits. I don't think either
> "commit" or "add" does, but that might be another route.

A GUI client, like your server, should not be using end-user facing Porcelain commands like "add" and "commit" anyway. In the standard "update-index" followed by "write-tree" followed-by "commit-tree" followed by "update-ref" sequence, the only thing that needs to take pathspec is the update-index step, and it already does take --stdin.

In any case, I share your gut feeling that this should not be a magic pathspec, but should instead be "--stdin[-paths]", for command line parsing's sanity. Catchng random strings that begin with double dash as fishy is much simpler and more robust than having to tell if a string that is a risky or a benign magic pathspec.

Previous: Jeff KingNext: Marc Strapetz
Message 3 of 4 in “pathspec: problems with too long command line”
  1. Marc StrapetzNov 21, 2018
  2. Jeff KingNov 21, 2018
  3. Junio C HamanoNov 21, 2018
  4. Marc StrapetzNov 21, 2018

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.