git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git Library?

From
David Aguilar <davvid@gmail.com>
Date
Apr 29, 2008, 06:58 UTC
Message-ID
<402731c90804282358i205334b8me56f4390456873b4@mail.gmail.com>
In-Reply-To
<5FCF765E-F3FF-438C-B4C1-FFB3262831A0@gmail.com>
On Mon, Apr 28, 2008 at 11:55 AM, Patrick Altman <paltman@gmail.com> wrote:
> I want to write a Mac OSX UI for git.
>

git gui works on OSX. Aside from that, someone's already written one* :-)

    http://repo.or.cz/ugit.git
    http://ugit.sf.net/
>  Is there a documented/undocumented API for interacting with git in process?
> Or would I be better off "shelling out" to the git command line?
Fork/exec.
If you grabbed the ugit modules you could say:
    from ugit import git
    revisions = git.rev_list(all=True).splitlines()
    file = open('msg', 'w')
    file.write("commit message." )
    file.close()
    git.commit(F='msg', s=True)
    etc, etc.

It's pretty much 90%+ of git wrapped in Python. If a libgit.so did appear one day it would be trivial to swap out the meta-functions in git.py and replace them with e.g. swig replacements. Until then, forking out works just fine.

stg also has Python wrapped around git so you could look there too.
-- 
 David


* - okay, I lied. It's PyQt4.  But it does run on OSX and looks just
like any other cocoa app.
Previous: David SymondsNext: David Aguilar
Message 7 of 8 in “Git Library?”
  1. Patrick AltmanApr 28, 2008
  2. Johannes SchindelinApr 28, 2008
  3. Jakub NarebskiApr 28, 2008
  4. Patrick AltmanApr 28, 2008
  5. Jakub NarebskiApr 28, 2008
  6. David SymondsApr 28, 2008
  7. David AguilarApr 29, 2008
  8. David AguilarApr 29, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.