{"thread":{"id":"13425","subject":"Using git from Python","startedAt":"2008-05-08T00:18:42Z","lastAt":"2008-05-14T06:10:05Z","messageCount":7,"participants":["Asheesh Laroia","Eric Hanchrow","David Aguilar","Dill","Steve Frécinaux"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"76337","messageId":"alpine.DEB.1.10.0805071612510.26718@sf.creativecommons.org","threadId":"13425","inReplyTo":null,"subject":"Using git from Python","fromName":"Asheesh Laroia","fromEmail":"asheesh@asheesh.org","sentAt":"2008-05-08T00:18:42Z","receivedAt":"2008-05-08T00:18:42Z","isPatch":false,"sender":{"key":"asheesh@asheesh.org","avatar":"https://avatars.githubusercontent.com/u/25457?v=4"},"body":">From a Python app, I want to read and write a git repository.  It seems \nfrom Luiz Fernando's post at http://blog.cpu.eti.br/?p=91 that the efforts \nto Pythonize libgit have stalled.\n\nOn #git, I was advised to simply call the git command suite.  That's fine, \nand I can do it using the subprocess module in Python - but since I \nfigured others may have done this also, does anyone know of a Python \nmodule that wraps some git commands?  I'm thinking if others have gone \ndown this path, they might have code that e.g. raises Exceptions when the \ngit commands fail for some reason.\n\nWhat have others on this list done lately for using git from Python?\n\n-- Asheesh.\n\n-- \nYou will reach the highest possible point in your business or profession.\n"},{"id":"76347","messageId":"87lk2l4fj5.fsf@offby1.atm01.sea.blarg.net","threadId":"13425","inReplyTo":"alpine.DEB.1.10.0805071612510.26718@sf.creativecommons.org","subject":"Re: Using git from Python","fromName":"Eric Hanchrow","fromEmail":"offby1@blarg.net","sentAt":"2008-05-08T03:54:06Z","receivedAt":"2008-05-08T03:54:06Z","isPatch":false,"sender":{"key":"eric.hanchrow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3145?v=4"},"body":">>>>> \"Asheesh\" == Asheesh Laroia <asheesh@asheesh.org> writes:\n\n    Asheesh> On #git, I was advised to simply call the git command\n    Asheesh> suite.  \n\nThat's what I'd do ...  (I wonder if it was me who so advised you :-)\n\n    Asheesh> That's fine ... but since I figured others may have done\n    Asheesh> this also\n\nAs far as I can tell, there is exactly no downside to simply forking a\nsubprocess.  Why are you trying to avoid that?\n                      \n    Asheesh> raises Exceptions when the git commands fail for some\n    Asheesh> reason.\n\nIf Popen doesn't already raise an exception when the child process\nfails, then it's surely a simple matter to check the exit code, and\nraise the exception yourself.\n\n-- \nI write [from 5 AM to 7 AM] to discover what I think.  After\nall, the bars aren't open that early.\n        -- Daniel Boorstin, former Librarian of Congress\n"},{"id":"76350","messageId":"402731c90805072123g764a3d56ia30035381c0950dd@mail.gmail.com","threadId":"13425","inReplyTo":"87lk2l4fj5.fsf@offby1.atm01.sea.blarg.net","subject":"Re: Using git from Python","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2008-05-08T04:23:49Z","receivedAt":"2008-05-08T04:23:49Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Wed, May 7, 2008 at 8:54 PM, Eric Hanchrow <offby1@blarg.net> wrote:\n>     Asheesh> That's fine ... but since I figured others may have done\n>     Asheesh> this also\n>\n>  As far as I can tell, there is exactly no downside to simply forking a\n>  subprocess.  Why are you trying to avoid that?\n>\n>     Asheesh> raises Exceptions when the git commands fail for some\n>     Asheesh> reason.\n>\n>  If Popen doesn't already raise an exception when the child process\n>  fails, then it's surely a simple matter to check the exit code, and\n>  raise the exception yourself.\n>\n\nThere have been many questions about this lately.\nFor the impatient, grab git.py from the python-git directory of the\nugit project:\n\nhttp://repo.or.cz/w/ugit.git?a=tree;f=python-git;h=1ef75cef116ce750b5bdf5dd38a4cf1ab2c1ce79;hb=b393c428cf156a7c5c75b18379676dbb534a76d8\n\nhttp://repo.or.cz/w/ugit.git\n\nI will work on making git.py a separate python-git project, upload it\nto pypi, and create a separate repo for it very soon.\n\nThe interface is blazingly simple.  It is a 1:1 correspondance to the\ngit command line interface.  e.g. git.commit(F='/some/path.txt',\ns=True)\n\nThere are many examples in the t/ directory and within the ugit\nproject itself.  Let me know offline if you have any questions.  The\ndocumentation could probably use some work.\n\n-- \n David\n"},{"id":"76497","messageId":"9b013f14-c193-41bc-923f-5f9a09d4fd60@56g2000hsm.googlegroups.com","threadId":"13425","inReplyTo":"alpine.DEB.1.10.0805071612510.26718@sf.creativecommons.org","subject":"Re: Using git from Python","fromName":"Dill","fromEmail":"sarpulhu@gmail.com","sentAt":"2008-05-10T06:52:47Z","receivedAt":"2008-05-10T06:52:47Z","isPatch":false,"sender":{"key":"sarpulhu@gmail.com","avatar":null},"body":"Also check out: http://gitorious.org/projects/git-python/\n\nAsheesh Laroia wrote:\n> From a Python app, I want to read and write a git repository.  It seems\n> from Luiz Fernando's post at http://blog.cpu.eti.br/?p=91 that the efforts\n> to Pythonize libgit have stalled.\n>\n> On #git, I was advised to simply call the git command suite.  That's fine,\n> and I can do it using the subprocess module in Python - but since I\n> figured others may have done this also, does anyone know of a Python\n> module that wraps some git commands?  I'm thinking if others have gone\n> down this path, they might have code that e.g. raises Exceptions when the\n> git commands fail for some reason.\n>\n> What have others on this list done lately for using git from Python?\n>\n> -- Asheesh.\n>\n> --\n> You will reach the highest possible point in your business or profession.\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"76737","messageId":"alpine.DEB.1.00.0805121116560.6810@swallowtail","threadId":"13425","inReplyTo":"9b013f14-c193-41bc-923f-5f9a09d4fd60@56g2000hsm.googlegroups.com","subject":"Re: Using git from Python","fromName":"Asheesh Laroia","fromEmail":"asheesh@asheesh.org","sentAt":"2008-05-12T18:17:34Z","receivedAt":"2008-05-12T18:17:34Z","isPatch":false,"sender":{"key":"asheesh@asheesh.org","avatar":"https://avatars.githubusercontent.com/u/25457?v=4"},"body":"On Fri, 9 May 2008, Dill wrote:\n\n> Also check out: http://gitorious.org/projects/git-python/\n\nThat looks very friendly and object-oriented.  It doesn't seem to have \nwrite support, based on a quick look - is that right?  Is write support a \nfeature you're considering adding?\n\n-- Asheesh.\n\n-- \nIs a person who blows up banks an econoclast?\n"},{"id":"76840","messageId":"f35478f50805130039s6dfe9411j63411f2f7a7db6c3@mail.gmail.com","threadId":"13425","inReplyTo":"alpine.DEB.1.00.0805121116560.6810@swallowtail","subject":"Re: Using git from Python","fromName":"Steve Frécinaux","fromEmail":"nudrema@gmail.com","sentAt":"2008-05-13T07:39:32Z","receivedAt":"2008-05-13T07:39:32Z","isPatch":false,"sender":{"key":"nudrema@gmail.com","avatar":null},"body":"Hi,\n\nIt is very fun, because I started my own project ten days ago with\nsimilar goals: making python bindings for git. Since I didn't have\nmuch imagination at that time, I called it \"pygit\", eventually\nrenaming it later with a better name.\n\nWhile being quite similar to git-python at first glance, its primary\ngoal is to feel as pythonic as possible, and to be suitable for\nporcelainish scripts (in such, it is quite low-level wrt the\noperations it allows, and has repository writing at the top of its\ntodo list)...\n\nDespite it seems a bit older than gitpython if you look at the commit\nhistory, it seems less mature, probably because it's written mostly\nfrom scratch and not a raw port of the ruby bindings. For instance,\ndocs are still missing, which is why I didn't announce it to this list\nyet. It seems it is roughly on par with git-python feature-wise,\nthough.\n\nI hope you'll like this one too ;-)\n\nAh, I forgot: here it is: http://code.istique.net/?p=pygit.git\n\n(If you get an error, try reloading the page, the server gets crappy sometimes)\n\nPS. Comments welcome.\n\nOn Mon, May 12, 2008 at 8:17 PM, Asheesh Laroia <asheesh@asheesh.org> wrote:\n> On Fri, 9 May 2008, Dill wrote:\n>\n>\n> > Also check out: http://gitorious.org/projects/git-python/\n> >\n>\n>  That looks very friendly and object-oriented.  It doesn't seem to have\n> write support, based on a quick look - is that right?  Is write support a\n> feature you're considering adding?\n"},{"id":"76920","messageId":"f35478f50805132310p2b94b128o3a6f391849ffb8ec@mail.gmail.com","threadId":"13425","inReplyTo":"20080513205021.GI2592@inocybe.teonanacatl.org","subject":"Re: Using git from Python","fromName":"Steve Frécinaux","fromEmail":"nudrema@gmail.com","sentAt":"2008-05-14T06:10:05Z","receivedAt":"2008-05-14T06:10:05Z","isPatch":false,"sender":{"key":"nudrema@gmail.com","avatar":null},"body":"On Tue, May 13, 2008 at 10:50 PM, Todd Zullinger <tmz@pobox.com> wrote:\n> Hi Steve,\n>\n> I saw that you started some python bindings for git and thought I'd\n> take a peak (even though I don't have a need for such a thing at the\n> moment :).  I notice that the COPYING file is GPLv2, but the comments\n> in all the files say License: LGPL 2.  Which one is incorrect?\n\nMmh. The LGPL one. I think I've copied the wrong file in and forgot to\ndouble-test ;-)\n"}]}