git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Aguilar" <davvid@gmail.com>
To: "Eric Hanchrow" <offby1@blarg.net>
Cc: git@vger.kernel.org
Subject: Re: Using git from Python
Date: Wed, 7 May 2008 21:23:49 -0700	[thread overview]
Message-ID: <402731c90805072123g764a3d56ia30035381c0950dd@mail.gmail.com> (raw)
In-Reply-To: <87lk2l4fj5.fsf@offby1.atm01.sea.blarg.net>

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

  reply	other threads:[~2008-05-08  4:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=402731c90805072123g764a3d56ia30035381c0950dd@mail.gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=offby1@blarg.net \
    /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;
as well as URLs for NNTP newsgroup(s).