Re: [ANNOUNCE]: PyGit and libgit-thin
From: David Kastrup <hidden>
Date: 2016-06-15 22:43:23
Yann Dirson [off-list ref] writes:
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:quoted
quoted
quoted
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:quoted
quoted
quoted
rv = repo.revlist(include=('8d9107e8c50e1c4ff43c91c8841805833f3ecfb9'),... count = 10, ... show_merges = true) ...quoted
quoted
quoted
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