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

Re: Problem with Git.pm bidi_pipe methods

From
CJChristian Jaeger <christian@jaeger.mine.nu>
Date
Oct 28, 2008, 09:12 UTC
Message-ID
<4906D78C.4030409@jaeger.mine.nu>
In-Reply-To
<20081024001446.GE17717@plop>
Philippe Bruhat (BooK) wrote:
Show 7 quoted lines
> Hi,
>
> To be able to call commit-tree from a Perl program, I had to use
> command_bidi_pipe() to pass the message on standard input, and get the
> new commit id on standard output. The only problem I have is that the
> method doesn't work (or at least, doesn't work like the other
> command_... methods).

Not really an answer on how to fix Git.pm, but: you may want to subclass Git.pm and add your own methods ad interim. See the thread "[PATCH] Git.pm: do not break inheritance" [1] about how to subclass (I see that this patch is actually in {next,pu} already, and anyway you can use the runtime patching approach I described there).

That approach of using subclasses has two benefits: (a) it will tend to make your code work with various versions of Git (i.e. one without a fixed command_bidi_pipe method), and (b) you will be much more free to extend the code. The drawback will be of course that your inventions won't necessarily make it back to Git.pm, but I'm tempted to think that some innovation taking place before settling on what should make it back to Git.pm (or, if incompatible, possibly a new Git.pm) would be worthwhile.

For an actual example in writing Git subclasses see "[ANNOUNCE] intergit repository-linking tool (early release)" [2].

Christian.

[1] http://article.gmane.org/gmane.comp.version-control.git/98568 [2] http://article.gmane.org/gmane.comp.version-control.git/99197

Previous: Philippe Bruhat (BooK)Next: nadim khemir
Message 2 of 3 in “Problem with Git.pm bidi_pipe methods”
  1. Philippe Bruhat (BooK)Oct 24, 2008
  2. Christian JaegerOct 28, 2008
  3. nadim khemirNov 23, 2008

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.