[nama] Re: Playing with git

  • From: Joel Roth <joelz@xxxxxxxxx>
  • To: nama@xxxxxxxxxxxxx
  • Date: Fri, 9 Mar 2012 09:13:17 -1000

On Thu, Mar 08, 2012 at 12:27:29PM -0500, S. Massy wrote:
> Hello,
> 
> Very glad to hear the git idea is interesting enough to get you to
> bisbehave. :)
> 
> On Wed, Mar 07, 2012 at 11:02:44PM -1000, Joel Roth wrote:
> > Hi,
> > 
> > I finally chose a git library for my initial tests.
> > Git::Repository appears reasonably easy to use and has few
> > dependencies.
> How does that work? Is this all implemented in perl, or does it use some
> C libraries or the binaries? I guess my question (out of curiosity) is,
> is using a library a matter of speed or just convenience?

All Perl.

When you call the git binary, there is STDIN STDOUT and
STDERR to deal with, there are concerns with passing
parameters, parsing results, handling error conditions,
and returning error messages.

So people provide an API, one is provided by the authors
of Git. 

Git::Repository seems okay, and learning that API looks
easier than trying to communicate with the git executable
myself.

G::R uses System::Command, of which the man page says:

        "System::Command" is a class that launches external system
        commands and return an object representing them, allowing to
        interact with them through their "STDIN", "STDOUT" and
        "STDERR" handles.

But I don't have to do it, since G::R does. :-)

http://search.cpan.org/dist/Git-Repository/lib/Git/Repository.pm
http://search.cpan.org/dist/Git-Repository/lib/Git/Repository/Tutorial.pod

> I really don't see the RCS as being much use while recording, except
> potentially for effects, which would be snapshot on post-rec monitoring
> anyway. 

> This also brings up other modes like preview and doodle: do we
> want commits of those? It doesn't seem very useful, but, on the other
> hand, some effect tweaking worth preserving might take place in such
> modes. 

The latest code does store changes made under doodle/preview settings, although
not the preview mode itself. 
 
> My instinctive solution, which has already been proposed, is to
> implement automatic commits only for monitor mode and allow manual
> commits (possibly with a suitable tag) in other modes. Alternatively, if
> that data is valuable to someone, we could create a branch for each mode
> (rec,doodle,etc.) and deep the data there out of harm's way.
> 
> Cheers,
> S.M.
> 

-- 
Joel Roth

Other related posts: