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

Re: unexplained behavior/issue with git archive?

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 23, 2015, 17:21 UTC
Message-ID
<xmqqwpxqpz7b.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150723155936.GC14935@serenity.lan>
John Keeping <john@keeping.me.uk> writes:
Show 9 quoted lines
> With a small number of items, there should only be one output line, but
> if xargs invokes the command multiple times there will be multiple
> lines.  For example (using -L2 to force a maximum of two arguments per
> invocation):
>
> 	$ printf '%s\n' a b c | xargs -d'\n' echo | wc -l
> 	1
> 	$ printf '%s\n' a b c | xargs -d'\n' -L2 echo | wc -l
> 	2

Yup, I think this thread is mistitled; it looks like an "unexpected behaviour with xargs". Or "common pitfalls with xargs", perhaps.

Now, what would be a reasonable workaround. To work around command line length limits (not necessarily for xargs, but the exact same issue would arise if you are trying to specify too many pathspecs on the command line), many of our commands take paths from their standard input. Would it be reasonable to teach "git archive" to also do so?

Or would it make sense to teach "git archive -o" a new mode to append to an existing archive, so that repeated invocations of "git archive" via such a use of "xargs" would create in the first invocation and then keep appending to the same archive in the subsequent invocations?

Previous: John Keeping
Message 3 of 3 in “unexplained behavior/issue with git archive?”
  1. Jan ValesJul 23, 2015
  2. John KeepingJul 23, 2015
  3. Junio C HamanoJul 23, 2015

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.