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

Re: git log -z doesn't separate commits with NULs

From
NSNikolaj Shurkaev <snnicky@gmail.com>
Date
Feb 23, 2012, 12:11 UTC
Message-ID
<4F462CF2.5040502@gmail.com>
In-Reply-To
<4F46122F.2040409@kdbg.org>
Hello.

You were right. I added parameter --max-args=1 to xargs command and that started work as I wanted initially. Thank you very much.

-- Nikolaj

23.02.2012 13:17, Johannes Sixt пишет:
Show 22 quoted lines
> Am 23.02.2012 10:14, schrieb Nikolaj Shurkaev:
>> I wanted to generate several files with some statistics using "git log
>> -z" command.
>> I did something like this:
>> git log -z --patch HEAD~10..HEAD -- SomePathHere | xargs -0
>> --max-chars=1000000 ~/1.sh
>>
>> If I put
>> echo "started"
>> into the file  ~/1.sh I see that the file is called only once instead of
>> multiple times.
> That is because xargs calls the program with as many arguments as
> possible, unless directed otherwise. Put this in the script:
>
> 	echo "started $*"
>
> and repeat. Then try this:
>
>   ... | xargs -0 -n 1 ~/1.sh
>
> -- Hannes
>
Previous: Johannes SixtNext: Jeff King
Message 5 of 22 in “git log -z doesn't separate commits with NULs”
  1. Nikolaj ShurkaevFeb 23, 2012
  2. Luke DiamandFeb 23, 2012
  3. Jeff KingFeb 23, 2012
  4. Johannes SixtFeb 23, 2012
  5. Nikolaj ShurkaevFeb 23, 2012
  6. Jeff KingFeb 23, 2012
  7. Nikolaj ShurkaevFeb 23, 2012
  8. Jakub NarebskiFeb 23, 2012
  9. Nikolaj ShurkaevFeb 23, 2012
  10. Jeff KingFeb 23, 2012
  11. Junio C HamanoFeb 23, 2012
  12. Nikolaj ShurkaevFeb 24, 2012
  13. Jeff KingFeb 24, 2012
  14. Junio C HamanoFeb 24, 2012
  15. Jeff KingFeb 24, 2012
  16. Junio C HamanoFeb 24, 2012
  17. Jeff KingFeb 24, 2012
  18. Nikolaj ShurkaevMar 3, 2012
  19. Jakub NarebskiFeb 24, 2012
  20. Junio C HamanoFeb 24, 2012
  21. Andreas SchwabFeb 23, 2012
  22. Nikolaj ShurkaevFeb 23, 2012

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.