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

Re: [ANNOUNCE]: PyGit and libgit-thin

From
David Kastrup <dak@gnu.org>
Date
Jul 25, 2007, 19:57 UTC
Message-ID
<85odi08ddk.fsf@lola.goethe.zz>
In-Reply-To
<20070725195010.GA30277@nan92-1-81-57-214-146.fbx.proxad.net>
Yann Dirson <ydirson@altern.org> writes:
Show 28 quoted lines
> I had a quick look at the current pygit API (as described in the
> README), and I find the current revlist one somewhat confusing.  Why
> using post-contructor methods, and not using named args in the
> constructor itself ?
>
> That is, the example reading:
>
>>>> rv = repo.revlist()
>>>> rv.include('8d9107e8c50e1c4ff43c91c8841805833f3ecfb9')
>>>> rv.count = 10
>>>> rv.show_merges()
>>>> for commit in rv:
> ...  print commit.id()
> ... 
>
>
> would be IMHO much nicer to use as:
>
>>>> rv = repo.revlist(include=('8d9107e8c50e1c4ff43c91c8841805833f3ecfb9'),
> ...                   count = 10,
> ...                   show_merges = true)
> ...
>>>> for commit in rv:
> ...  print commit.id()
> ... 
>
>
> What do you think ?

Nicer to use if the commands and their options originate from withing Python. But if Python parses arguments from somewhere else and passes them on, the former interface leads to much cleaner code AFAICS. Pasting together a named argument call piecemeal is not going to be pretty, I should think.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Previous: Yann DirsonNext: Jan Hudec
Message 3 of 5 in “[ANNOUNCE]: PyGit and libgit-thin”
  1. Luiz Fernando N. CapitulinoJul 23, 2007
  2. Yann DirsonJul 25, 2007
  3. David KastrupJul 25, 2007
  4. Jan HudecJul 25, 2007
  5. Luiz Fernando N. CapitulinoJul 25, 2007

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.