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

Re: [PATCH 12/19] 1/2: Add Python support library for CVS remote helper

From
Johan Herland <johan@herland.net>
Date
Oct 30, 2009, 08:33 UTC
Message-ID
<200910300933.35567.johan@herland.net>
In-Reply-To
<1256839287-19016-13-git-send-email-srabbelier@gmail.com>
On Thursday 29 October 2009, Sverre Rabbelier wrote:
Show 15 quoted lines
> From: Johan Herland <johan@herland.net>
> 
> This patch introduces parts of a Python package called "git_remote_cvs"
> containing the building blocks of the CVS remote helper.
> The CVS remote helper itself is NOT part of this patch.
> 
> This patch has been improved by the following contributions:
> - David Aguilar: Lots of Python coding style fixes
> 
> Cc: David Aguilar <davvid@gmail.com>
> Signed-off-by: Johan Herland <johan@herland.net>
> Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
> ---
> 
> 	This has my patch to util.py squashed in.

Why? Or: why that one, and not the others? Also, you might want to mention your contribution in the commit message itself.

Show 6 quoted lines
> diff --git a/git_remote_cvs/util.py b/git_remote_cvs/util.py
> new file mode 100644
> index 0000000..d3ca487
> --- /dev/null
> +++ b/git_remote_cvs/util.py
> @@ -0,0 +1,194 @@
[snip]
Show 24 quoted lines
> +
> +def notify(msg, *args):
> +	"""Print a message to stderr."""
> +	print >> sys.stderr, msg % args
> +
> +def debug (msg, *args):
> +    """Print a debug message to stderr when DEBUG is enabled."""
> +    if DEBUG:
> +        print >> sys.stderr, msg % args
> +
> +def error (msg, *args):
> +    """Print an error message to stderr."""
> +    print >> sys.stderr, "ERROR:", msg % args
> +
> +def warn(msg, *args):
> +	"""Print a warning message to stderr."""
> +	print >> sys.stderr, "warning:", msg % args
> +
> +def die (msg, *args):
> +    """Print as error message to stderr and exit the program."""
> +    error(msg, *args)
> +    sys.exit(1)
> +
> +

It seems the two functions you add (notify() and warn()) have a different indentation than the existing code (which uses 4 spaces). Please fix.

(When I first introduced these Python patches, there was a discussion on the differences in indentation/style between the Git C code, and Python code, and it was decided to follow the Python conventions, to make the code more inviting to the Python community.)

...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Sverre RabbelierNext: Sverre Rabbelier
Message 31 of 43 in “Reroll of the remote-vcs-helper series”
  1. 0/19 Reroll of the remote-vcs-helper seriesSverre Rabbelier, Oct 29, 2009
  2. 01/19 Use a function to determine whether a remote is validSverre Rabbelier, Oct 29, 2009
  3. 02/19 Allow fetch to modify refsSverre Rabbelier, Oct 29, 2009
  4. Daniel BarkalowOct 30, 2009
  5. Sverre RabbelierOct 30, 2009
  6. Daniel BarkalowOct 30, 2009
  7. Sverre RabbelierOct 30, 2009
  8. 03/19 Allow programs to not depend on remotes having urlsSverre Rabbelier, Oct 29, 2009
  9. Daniel BarkalowOct 30, 2009
  10. Sverre RabbelierOct 30, 2009
  11. 04/19 Add a config option for remotes to specify a foreign vcsSverre Rabbelier, Oct 29, 2009
  12. 05/19 Add support for "import" helper commandSverre Rabbelier, Oct 29, 2009
  13. 06/19 Factor ref updating out of fetch_with_importSverre Rabbelier, Oct 29, 2009
  14. Daniel BarkalowOct 30, 2009
  15. Sverre RabbelierOct 30, 2009
  16. Daniel BarkalowOct 30, 2009
  17. Sverre RabbelierNov 2, 2009
  18. Daniel BarkalowNov 2, 2009
  19. Sverre RabbelierNov 2, 2009
  20. Daniel BarkalowNov 2, 2009
  21. 07/19 Allow helpers to report in "list" command that the ref is unchangedSverre Rabbelier, Oct 29, 2009
  22. 08/19 Fix memory leak in helper method for disconnectSverre Rabbelier, Oct 29, 2009
  23. 09/19 Finally make remote helper support usefulSverre Rabbelier, Oct 29, 2009
  24. 10/19 Allow helpers to request marks for fast-importSverre Rabbelier, Oct 29, 2009
  25. Johan HerlandOct 30, 2009
  26. Sverre RabbelierOct 30, 2009
  27. Johan HerlandOct 31, 2009
  28. Sverre RabbelierOct 31, 2009
  29. 11/19 Basic build infrastructure for Python scriptsSverre Rabbelier, Oct 29, 2009
  30. 12/19 1/2: Add Python support library for CVS remote helperSverre Rabbelier, Oct 29, 2009
  31. Johan HerlandOct 30, 2009
  32. Sverre RabbelierOct 30, 2009
  33. 13/19 2/2: Add Python support library for CVS remote helperSverre Rabbelier, Oct 29, 2009
  34. 14/19 git-remote-cvs: Remote helper program for CVS repositoriesSverre Rabbelier, Oct 29, 2009
  35. 15/19 Add simple selftests of git-remote-cvs functionalitySverre Rabbelier, Oct 29, 2009
  36. 16/19 Fix the Makefile-generated path to the git_remote_cvs package in git-remote-cvsSverre Rabbelier, Oct 29, 2009
  37. 17/19 More fixes to the git-remote-cvs installation procedureSverre Rabbelier, Oct 29, 2009
  38. 18/19 Refactor git_remote_cvs to a more generic git_remote_helpersSverre Rabbelier, Oct 29, 2009
  39. Johan HerlandOct 30, 2009
  40. Sverre RabbelierOct 30, 2009
  41. 19/19 .gitignore: add git-remote-cvsSverre Rabbelier, Oct 29, 2009
  42. Shawn O. PearceOct 29, 2009
  43. Sverre RabbelierOct 29, 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.