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

Re: [RFCv3 2/4] Add Python support library for CVS remote helper

From
Johan Herland <johan@herland.net>
Date
Aug 13, 2009, 01:27 UTC
Message-ID
<200908130327.28571.johan@herland.net>
In-Reply-To
<7vzla4r0qc.fsf@alter.siamese.dyndns.org>
On Thursday 13 August 2009, Junio C Hamano wrote:
Show 29 quoted lines
> David Aguilar <davvid@gmail.com> writes:
> > This also had me wondering about the following:
> > 	git uses tabs for indentation
>
> Not relevant.  That is a rule for our "C" source code.  We also use it in
> our Perl scripts and shell scripts because there is no single "one right
> way" that is strongly defined and everybody adheres to, like the 4-space
> rule Python folks have.
>
> > BUT, the python convention is to use 4-space indents ala PEP-8
> > http://www.python.org/dev/peps/pep-0008/
> >
> > It might be appealing to when-in-Rome (Rome being Python) here
> > and do things the python way when we code in Python.
>
> Yes, this is more important.
>
> >> +		if len(msg) > 25: msg = msg[:22] + "..." # Max 25 chars long
> >> +		return "<Changeset @(%s) by %s (%s) updating %i files>" % (
> >> +			self.date, self.author, msg, len(self.revs))
> >
> > Similar to the git coding style, this might be better written:
>
> So is this one.  If experienced Python folks also frown on single-line
> conditionals, then by all means please update this.  But if this
> suggestion is solely because we don't do a single-line conditional in our
> C source code, then please do not insist on it too strongly.  The code
> should look familiar to Pythonistas with good tastes (if such a class of
> people exist, that is ;-)).

Ok. Thanks. I will follow PEP8 as closely as possible, including the 4-space indent.

...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 22 in “[RFCv3 0/4] CVS remote helper”
  1. Johan HerlandAug 12, 2009
  2. 1/4 Basic build infrastructure for Python scriptsJohan Herland, Aug 12, 2009
  3. 2/4 Add Python support library for CVS remote helperJohan Herland, Aug 12, 2009
  4. David AguilarAug 12, 2009
  5. Johan HerlandAug 12, 2009
  6. Sverre RabbelierAug 12, 2009
  7. Michael HaggertyAug 13, 2009
  8. Johan HerlandAug 13, 2009
  9. Junio C HamanoAug 13, 2009
  10. Johan HerlandAug 13, 2009
  11. Junio C HamanoAug 16, 2009
  12. 1/2 git_remote_cvs: Honor DESTDIR in the MakefileDavid Aguilar, Aug 16, 2009
  13. 2/2 git_remote_cvs: Use $(shell) in the MakefileDavid Aguilar, Aug 16, 2009
  14. David AguilarAug 16, 2009
  15. Johannes SchindelinAug 16, 2009
  16. David AguilarAug 16, 2009
  17. Johannes SchindelinAug 16, 2009
  18. Johan HerlandAug 17, 2009
  19. 1/2 git_remote_cvs: Honor DESTDIR in the MakefileDavid Aguilar, Aug 16, 2009
  20. 2/2 git_remote_cvs: Use $(shell) in the MakefileDavid Aguilar, Aug 16, 2009
  21. 3/4 Third draft of CVS remote helper programJohan Herland, Aug 12, 2009
  22. 4/4 Add simple selftests of git-remote-cvs functionalityJohan Herland, Aug 12, 2009

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.