{"thread":{"id":"60291","subject":"batch-command wishlist [was: [TOPIC 02/12] Libification Goals and Progress]","startedAt":"2023-10-03T00:52:54Z","lastAt":"2023-10-03T20:32:54Z","messageCount":5,"participants":["Eric Wong","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"482552","messageId":"20231003005251.M353509@dcvr","threadId":"60291","inReplyTo":null,"subject":"batch-command wishlist [was: [TOPIC 02/12] Libification Goals and Progress]","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2023-10-03T00:52:51Z","receivedAt":"2023-10-03T00:52:54Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Taylor Blau <me@ttaylorr.com> wrote:\n> * (Jonathan Tan) back to process isolation: is the short lifetime of the process\n>   important?\n> * (Taylor Blau) seems like an impossible goal to be able to do multi-command\n>   executions in a single process, the code is just not designed for it.\n\n-- Split out from https://lore.kernel.org/git/ZRrfN2lbg14IOLiK@nand.local/\nThanks for posting in an accessible format for non-JS/video users.\n\n> * (Junio) is anybody using the `git cat-file --batch-command` mode that switches\n>   between batch and batch-check.\n\nI've started using --batch-command, but still have to test\nbackwards compatibility with git 2.35 to ensure users of older\ngit aren't left out.  I still try to support git 1.8.x, even...\n\nBut it would be nice if --batch-command grew more functionality:\n\n* ability to add/remove alternates\n* ability to specify a preferred alternate for a lookup[1]\n* detect unlinked packs/removed repos\n\nNot sure if cat-file is the place for it, but a persistent\nprocess to deal with:\n\n* `git config -f FILENAME ...' (especially --get-urlmatch --type=FOO)\n* approxidate parsing for other tools[2]\n\nWould also be nice...\n\nMaybe I'll find the time and patience to implement this... *shrug*\nBuilding C projects is pretty slow for me, even with -O0.\n\n[1] I'm potentially dealing with 50-100k alternates, after all;\n    and potentially config files in the 300-500k line range...\n\n> * (Patrick Steinhardt) they are longer lived, but only \"middle\" long-lived.\n>   GitLab limits the maximum runtime, on the order of ~minutes, at which point\n>   they are reaped.\n> * (Taylor Blau) lots of issues besides memory leaks that would become an issue\n> * (Jeff Hostetler) would be nice to keep memory-hungry components pinned across\n>   multiple command-equivalents.\n> * (Taylor Blau): same issue as reading configuration.\n\nsidenote: __attribute__((cleanup)) found in gcc + clang + tinycc\nhas greatly improved my life.  Perhaps only supporting Free software\ncompilers and cross-compiling for everything else is in order :P\n\nThe only gotcha I've noticed with ((cleanup)) is it doesn't fire\non longjmp, but that's not a problem for git.\n\nI've also been abusing more Perl5 over the years as a code\ngenerator and better CPP to make dealing with tedious tasks\nmore acceptable.\n\n\n[2] I did recently license the code of a standalone C++ executable\n    as GPL-2+ so I can copy approxidate parsing from git and\n    perhaps figure out enough C++ to use Xapian query parser\n    bindings instead of the hacky `git rev-parse --since=' thing\n    I do.\n"},{"id":"482569","messageId":"xmqq7co33cok.fsf@gitster.g","threadId":"60291","inReplyTo":"20231003005251.M353509@dcvr","subject":"Re: batch-command wishlist [was: [TOPIC 02/12] Libification Goals and Progress]","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-10-03T16:15:07Z","receivedAt":"2023-10-03T16:15:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <e@80x24.org> writes:\n\n> Taylor Blau <me@ttaylorr.com> wrote:\n>> * (Jonathan Tan) back to process isolation: is the short lifetime of the process\n>>   important?\n>> * (Taylor Blau) seems like an impossible goal to be able to do multi-command\n>>   executions in a single process, the code is just not designed for it.\n>\n> -- Split out from https://lore.kernel.org/git/ZRrfN2lbg14IOLiK@nand.local/\n> Thanks for posting in an accessible format for non-JS/video users.\n>\n>> * (Junio) is anybody using the `git cat-file --batch-command` mode that switches\n>>   between batch and batch-check.\n\nThis is not exactly what I asked about---I was asking about the use\nof the \"a long living process serves many requests\" pattern ;-)\n\n> But it would be nice if --batch-command grew more functionality:\n>\n> * ability to add/remove alternates\n> * ability to specify a preferred alternate for a lookup[1]\n> * detect unlinked packs/removed repos\n\nTo the third you would also want to notice an updated index, too.\n\n> Not sure if cat-file is the place for it, but a persistent\n> process to deal with:\n>\n> * `git config -f FILENAME ...' (especially --get-urlmatch --type=FOO)\n> * approxidate parsing for other tools[2]\n>\n> Would also be nice...\n\n\"git daemon\" ;-)?\n"},{"id":"482598","messageId":"20231003201048.GD1562@coredump.intra.peff.net","threadId":"60291","inReplyTo":"20231003005251.M353509@dcvr","subject":"Re: batch-command wishlist [was: [TOPIC 02/12] Libification Goals and Progress]","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-10-03T20:10:48Z","receivedAt":"2023-10-03T20:10:52Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 03, 2023 at 12:52:51AM +0000, Eric Wong wrote:\n\n> Not sure if cat-file is the place for it, but a persistent\n> process to deal with:\n> \n> * `git config -f FILENAME ...' (especially --get-urlmatch --type=FOO)\n> * approxidate parsing for other tools[2]\n>\n> [2] I did recently license the code of a standalone C++ executable\n>     as GPL-2+ so I can copy approxidate parsing from git and\n>     perhaps figure out enough C++ to use Xapian query parser\n>     bindings instead of the hacky `git rev-parse --since=' thing\n>     I do.\n\nI know that you asked for a persistent process, but just for reference,\nyou can hackily access approxidate with:\n\n  git config --type=expiry-date --default='15 days ago' does.not.exist\n\n-Peff\n"},{"id":"482613","messageId":"20231003203124.M560967@dcvr","threadId":"60291","inReplyTo":"20231003201048.GD1562@coredump.intra.peff.net","subject":"Re: batch-command wishlist [was: [TOPIC 02/12] Libification Goals and Progress]","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2023-10-03T20:31:24Z","receivedAt":"2023-10-03T20:31:27Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Jeff King <peff@peff.net> wrote:\n> I know that you asked for a persistent process, but just for reference,\n> you can hackily access approxidate with:\n> \n>   git config --type=expiry-date --default='15 days ago' does.not.exist\n\n--type is too new (trying to support 1.8.x :<).  But yeah, using\n`git rev-parse --since=15.days.ago` and extracting the integers\n"},{"id":"482615","messageId":"20231003203251.GA7933@coredump.intra.peff.net","threadId":"60291","inReplyTo":"20231003203124.M560967@dcvr","subject":"Re: batch-command wishlist [was: [TOPIC 02/12] Libification Goals and Progress]","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-10-03T20:32:51Z","receivedAt":"2023-10-03T20:32:54Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 03, 2023 at 08:31:24PM +0000, Eric Wong wrote:\n\n> Jeff King <peff@peff.net> wrote:\n> > I know that you asked for a persistent process, but just for reference,\n> > you can hackily access approxidate with:\n> > \n> >   git config --type=expiry-date --default='15 days ago' does.not.exist\n> \n> --type is too new (trying to support 1.8.x :<).  But yeah, using\n> `git rev-parse --since=15.days.ago` and extracting the integers\n\nAh, that is probably less hacky than my suggestion anyway.\n\n-Peff\n"}]}