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

Re: git rev-list | git cherry-pick --stdin is leaky

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2013, 18:31 UTC
Message-ID
<7vsj27dg5d.fsf@alter.siamese.dyndns.org>
In-Reply-To
<517F0C18.8060703@codeaurora.org>
Stephen Boyd <sboyd@codeaurora.org> writes:
Show 8 quoted lines
> (resending since the attachment seems to make vger sad)
>
> Hi,
>
> I'm running git rev-list | git cherry-pick --stdin on a range of about
> 300 commits. Eventually the chery-pick dies with:
>
>     error: cannot fork() for commit: Cannot allocate memory
Unfortunately, I am not very surprised.

The merge-recursive machinery was designed in the "run once and let exit() clean up after ourselves" manner, which lets it not even having to worry about keeping track of what needs to be cleaned up. Reusing it inside cherry-pick and revert without updating it was OK, but extending cherry-pick and revert to take more than one change without addressing its resource management was a large mistake.

I vaguely recall suggesting to fork and perform a three-way merge in a separate process when operating on more than one commit when this feature was first discussed. We may have to do something like that.

Previous: Stephen BoydNext: René Scharfe
Message 2 of 7 in “git rev-list | git cherry-pick --stdin is leaky”
  1. Stephen BoydApr 30, 2013
  2. Junio C HamanoApr 30, 2013
  3. René ScharfeApr 30, 2013
  4. Stephen BoydMay 1, 2013
  5. Stephen BoydMay 6, 2013
  6. René ScharfeMay 9, 2013
  7. Stephen BoydMay 9, 2013

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.