{"thread":{"id":"2497","subject":"Libification update","startedAt":"2005-11-14T16:31:29Z","lastAt":"2005-11-14T16:31:29Z","messageCount":1,"participants":["Matthias Urlichs"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"11803","messageId":"pan.2005.11.14.16.31.28.304206@smurf.noris.de","threadId":"2497","inReplyTo":null,"subject":"Libification update","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-11-14T16:31:29Z","receivedAt":"2005-11-14T16:31:29Z","isPatch":false,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"I've merged my current library-ification effort with Junio's current HEAD.\n\nURL: http://netz.smurf.noris.de/git/git.git#libize\n\nThere's a Python interface, written using Pyrex. You can now walk object\ntrees natively, with Python:\n\n>>> import git\n>>> e=git.env()\n>>> db=e.objdb\n>>> c=db.lookup(\"HEAD\").parent[0] # \"HEAD^\" will work too\n>>> t=c.tree\n>>> t.entries[0].name\n'.gitignore'\n>>> t[\"debian\"].entries[0].name\n'changelog'\n>>> t[\".gitignore\"].data[0:5]\n'/git\\n'\n>>> t[\".gitignore\"].data.readline()\n'/git\\n'    # this will work tomorrow (I hope)\n\nI have not implemented much beyond that; keeping the code in sync is\nwork, so doing more will have to wait until this gets merged.\n\nI did play with SWIG a bit. It would have simplified interfacing\nlanguages other than Python to git. Unfortunately, there were problems: \n\n- refering to objects SWIG did not allocate itself is a nontrivial\n  exercise\n- so is keeping the Python-visible namespace clean\n  (unless you're using C++ ... probably not something we'd want to subject\n  the git core to ...)\n- SWIG's error reporting is *scary*.\n  In comparison, Pyrex mostly does the right thing.\n\nIf somebody wants to start working on a SWIG/perl/tcl/... interface\nfor the library, be my guest. ;-)\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nAsk the person next to you.\n"}]}