Git development
 help / color / mirror / Atom feed
From: Matthias Urlichs <smurf@smurf.noris.de>
To: git@vger.kernel.org
Subject: Libification update
Date: Mon, 14 Nov 2005 17:31:29 +0100	[thread overview]
Message-ID: <pan.2005.11.14.16.31.28.304206@smurf.noris.de> (raw)

I've merged my current library-ification effort with Junio's current HEAD.

URL: http://netz.smurf.noris.de/git/git.git#libize

There's a Python interface, written using Pyrex. You can now walk object
trees natively, with Python:

>>> import git
>>> e=git.env()
>>> db=e.objdb
>>> c=db.lookup("HEAD").parent[0] # "HEAD^" will work too
>>> t=c.tree
>>> t.entries[0].name
'.gitignore'
>>> t["debian"].entries[0].name
'changelog'
>>> t[".gitignore"].data[0:5]
'/git\n'
>>> t[".gitignore"].data.readline()
'/git\n'    # this will work tomorrow (I hope)

I have not implemented much beyond that; keeping the code in sync is
work, so doing more will have to wait until this gets merged.

I did play with SWIG a bit. It would have simplified interfacing
languages other than Python to git. Unfortunately, there were problems: 

- refering to objects SWIG did not allocate itself is a nontrivial
  exercise
- so is keeping the Python-visible namespace clean
  (unless you're using C++ ... probably not something we'd want to subject
  the git core to ...)
- SWIG's error reporting is *scary*.
  In comparison, Pyrex mostly does the right thing.

If somebody wants to start working on a SWIG/perl/tcl/... interface
for the library, be my guest. ;-)

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Ask the person next to you.

                 reply	other threads:[~2005-11-14 16:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pan.2005.11.14.16.31.28.304206@smurf.noris.de \
    --to=smurf@smurf.noris.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox