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

Re: [PATCH 1/2] add setup step to filter-branch

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 9, 2017, 13:11 UTC
Message-ID
<xmqqo9tx71bn.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170609054955.y52cro2c3bwhl2sh@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 24 quoted lines
> I have a feeling that if we were ever to rewrite filter-branch, it would
> probably be worth allowing people to write snippets in a better language
> (possibly even a domain-specific language). I'm sure that most of the
> program being written in shell doesn't help, but if we're spawning one
> or more shell instances per commit (plus the Git programs they spawn!),
> it's always going to be slow.
>
> But I suspect that would be an uphill battle, as our only stable API
> involves starting external processes anyway. You'd probably do better to
> pick a language you like and rewrite it in using libgit2's bindings to
> that language. It's not feature complete, but basic stuff like "put this
> entry in the tree" is certainly mature.
>
>>  *1* The issue is *not* that these individual filter commands expect
>>      <command> written as a shell scriptlet; it is that these
>>      scriptlets expect to be evaled inside a single shell process,
>>      making an update to a shell variable in one command visible to
>>      the next command that runs.
>
> I think you'd need a shell "helper" that's a single long-running process
> and just reads "eval the index snippet now" instructions from the C
> controller. At which point I don't think Andreas's "setup" feature is
> any harder to support. We just send an "eval the setup snippet"
> instruction first.

Yes. I do not think this particular one makes things any worse than it already is. As I said, I do not have a strong opinion against the topic; as long as people find the feature useful, I do not mind applying it.

Thanks.
Previous: Jeff KingNext: Andreas Heiduk
Message 8 of 10 in “add setup step to filter-branch”
  1. 1/2 add setup step to filter-branchAndreas Heiduk, Jun 3, 2017
  2. 2/2 add [--] to usage of filter-branchAndreas Heiduk, Jun 3, 2017
  3. Andreas HeidukJun 5, 2017
  4. Junio C HamanoJun 9, 2017
  5. Andreas HeidukJun 9, 2017
  6. Junio C HamanoJun 5, 2017
  7. Jeff KingJun 9, 2017
  8. Junio C HamanoJun 9, 2017
  9. 1/2 add setup step to filter-branchAndreas Heiduk, Jun 10, 2017
  10. 2/2 add [--] to usage of filter-branchAndreas Heiduk, Jun 10, 2017

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.