* Using git from Python
@ 2008-05-08 0:18 Asheesh Laroia
2008-05-08 3:54 ` Eric Hanchrow
2008-05-10 6:52 ` Dill
0 siblings, 2 replies; 7+ messages in thread
From: Asheesh Laroia @ 2008-05-08 0:18 UTC (permalink / raw)
To: git
>From a Python app, I want to read and write a git repository. It seems
from Luiz Fernando's post at http://blog.cpu.eti.br/?p=91 that the efforts
to Pythonize libgit have stalled.
On #git, I was advised to simply call the git command suite. That's fine,
and I can do it using the subprocess module in Python - but since I
figured others may have done this also, does anyone know of a Python
module that wraps some git commands? I'm thinking if others have gone
down this path, they might have code that e.g. raises Exceptions when the
git commands fail for some reason.
What have others on this list done lately for using git from Python?
-- Asheesh.
--
You will reach the highest possible point in your business or profession.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using git from Python 2008-05-08 0:18 Using git from Python Asheesh Laroia @ 2008-05-08 3:54 ` Eric Hanchrow 2008-05-08 4:23 ` David Aguilar 2008-05-10 6:52 ` Dill 1 sibling, 1 reply; 7+ messages in thread From: Eric Hanchrow @ 2008-05-08 3:54 UTC (permalink / raw) To: git >>>>> "Asheesh" == Asheesh Laroia <asheesh@asheesh.org> writes: Asheesh> On #git, I was advised to simply call the git command Asheesh> suite. That's what I'd do ... (I wonder if it was me who so advised you :-) Asheesh> That's fine ... but since I figured others may have done Asheesh> this also As far as I can tell, there is exactly no downside to simply forking a subprocess. Why are you trying to avoid that? Asheesh> raises Exceptions when the git commands fail for some Asheesh> reason. If Popen doesn't already raise an exception when the child process fails, then it's surely a simple matter to check the exit code, and raise the exception yourself. -- I write [from 5 AM to 7 AM] to discover what I think. After all, the bars aren't open that early. -- Daniel Boorstin, former Librarian of Congress ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using git from Python 2008-05-08 3:54 ` Eric Hanchrow @ 2008-05-08 4:23 ` David Aguilar 0 siblings, 0 replies; 7+ messages in thread From: David Aguilar @ 2008-05-08 4:23 UTC (permalink / raw) To: Eric Hanchrow; +Cc: git On Wed, May 7, 2008 at 8:54 PM, Eric Hanchrow <offby1@blarg.net> wrote: > Asheesh> That's fine ... but since I figured others may have done > Asheesh> this also > > As far as I can tell, there is exactly no downside to simply forking a > subprocess. Why are you trying to avoid that? > > Asheesh> raises Exceptions when the git commands fail for some > Asheesh> reason. > > If Popen doesn't already raise an exception when the child process > fails, then it's surely a simple matter to check the exit code, and > raise the exception yourself. > There have been many questions about this lately. For the impatient, grab git.py from the python-git directory of the ugit project: http://repo.or.cz/w/ugit.git?a=tree;f=python-git;h=1ef75cef116ce750b5bdf5dd38a4cf1ab2c1ce79;hb=b393c428cf156a7c5c75b18379676dbb534a76d8 http://repo.or.cz/w/ugit.git I will work on making git.py a separate python-git project, upload it to pypi, and create a separate repo for it very soon. The interface is blazingly simple. It is a 1:1 correspondance to the git command line interface. e.g. git.commit(F='/some/path.txt', s=True) There are many examples in the t/ directory and within the ugit project itself. Let me know offline if you have any questions. The documentation could probably use some work. -- David ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using git from Python 2008-05-08 0:18 Using git from Python Asheesh Laroia 2008-05-08 3:54 ` Eric Hanchrow @ 2008-05-10 6:52 ` Dill 2008-05-12 18:17 ` Asheesh Laroia 1 sibling, 1 reply; 7+ messages in thread From: Dill @ 2008-05-10 6:52 UTC (permalink / raw) To: git Also check out: http://gitorious.org/projects/git-python/ Asheesh Laroia wrote: > From a Python app, I want to read and write a git repository. It seems > from Luiz Fernando's post at http://blog.cpu.eti.br/?p=91 that the efforts > to Pythonize libgit have stalled. > > On #git, I was advised to simply call the git command suite. That's fine, > and I can do it using the subprocess module in Python - but since I > figured others may have done this also, does anyone know of a Python > module that wraps some git commands? I'm thinking if others have gone > down this path, they might have code that e.g. raises Exceptions when the > git commands fail for some reason. > > What have others on this list done lately for using git from Python? > > -- Asheesh. > > -- > You will reach the highest possible point in your business or profession. > -- > To unsubscribe from this list: send the line "unsubscribe git" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using git from Python 2008-05-10 6:52 ` Dill @ 2008-05-12 18:17 ` Asheesh Laroia 2008-05-13 7:39 ` Steve Frécinaux 0 siblings, 1 reply; 7+ messages in thread From: Asheesh Laroia @ 2008-05-12 18:17 UTC (permalink / raw) To: Dill; +Cc: git On Fri, 9 May 2008, Dill wrote: > Also check out: http://gitorious.org/projects/git-python/ That looks very friendly and object-oriented. It doesn't seem to have write support, based on a quick look - is that right? Is write support a feature you're considering adding? -- Asheesh. -- Is a person who blows up banks an econoclast? ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using git from Python 2008-05-12 18:17 ` Asheesh Laroia @ 2008-05-13 7:39 ` Steve Frécinaux [not found] ` <20080513205021.GI2592@inocybe.teonanacatl.org> 0 siblings, 1 reply; 7+ messages in thread From: Steve Frécinaux @ 2008-05-13 7:39 UTC (permalink / raw) To: Asheesh Laroia; +Cc: Dill, git Hi, It is very fun, because I started my own project ten days ago with similar goals: making python bindings for git. Since I didn't have much imagination at that time, I called it "pygit", eventually renaming it later with a better name. While being quite similar to git-python at first glance, its primary goal is to feel as pythonic as possible, and to be suitable for porcelainish scripts (in such, it is quite low-level wrt the operations it allows, and has repository writing at the top of its todo list)... Despite it seems a bit older than gitpython if you look at the commit history, it seems less mature, probably because it's written mostly from scratch and not a raw port of the ruby bindings. For instance, docs are still missing, which is why I didn't announce it to this list yet. It seems it is roughly on par with git-python feature-wise, though. I hope you'll like this one too ;-) Ah, I forgot: here it is: http://code.istique.net/?p=pygit.git (If you get an error, try reloading the page, the server gets crappy sometimes) PS. Comments welcome. On Mon, May 12, 2008 at 8:17 PM, Asheesh Laroia <asheesh@asheesh.org> wrote: > On Fri, 9 May 2008, Dill wrote: > > > > Also check out: http://gitorious.org/projects/git-python/ > > > > That looks very friendly and object-oriented. It doesn't seem to have > write support, based on a quick look - is that right? Is write support a > feature you're considering adding? ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20080513205021.GI2592@inocybe.teonanacatl.org>]
* Re: Using git from Python [not found] ` <20080513205021.GI2592@inocybe.teonanacatl.org> @ 2008-05-14 6:10 ` Steve Frécinaux 0 siblings, 0 replies; 7+ messages in thread From: Steve Frécinaux @ 2008-05-14 6:10 UTC (permalink / raw) To: Todd Zullinger; +Cc: git On Tue, May 13, 2008 at 10:50 PM, Todd Zullinger <tmz@pobox.com> wrote: > Hi Steve, > > I saw that you started some python bindings for git and thought I'd > take a peak (even though I don't have a need for such a thing at the > moment :). I notice that the COPYING file is GPLv2, but the comments > in all the files say License: LGPL 2. Which one is incorrect? Mmh. The LGPL one. I think I've copied the wrong file in and forgot to double-test ;-) ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-05-14 6:10 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-05-08 0:18 Using git from Python Asheesh Laroia 2008-05-08 3:54 ` Eric Hanchrow 2008-05-08 4:23 ` David Aguilar 2008-05-10 6:52 ` Dill 2008-05-12 18:17 ` Asheesh Laroia 2008-05-13 7:39 ` Steve Frécinaux [not found] ` <20080513205021.GI2592@inocybe.teonanacatl.org> 2008-05-14 6:10 ` Steve Frécinaux
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).