Re: Problem with Git.pm bidi_pipe methods

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Philippe Bruhat (BooK) wrote:
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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux