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

Re: [StGit PATCH 4/9] Convert 'clone' to the use stgit.lib

From
Karl Hasselström <kha@treskal.com>
Date
Apr 29, 2009, 06:21 UTC
Message-ID
<20090429062101.GD18483@diana.vm.bytemark.co.uk>
In-Reply-To
<20090428150957.27261.83658.stgit@pc1117.cambridge.arm.com>
On 2009-04-28 16:09:57 +0100, Catalin Marinas wrote:
> The patch also adds the stgit.lib.git.clone() function.
Show 5 quoted lines
>      if os.path.exists(local_dir):
> -        raise CmdException, '"%s" exists. Remove it first' % local_dir
> -
> -    print 'Cloning "%s" into "%s"...' % (repository, local_dir)
> +        raise common.CmdException, '"%s" exists. Remove it first' % local_dir
As recommended by PEP 8, consider using the "raise Exc(args)" syntax:
    - When raising an exception, use "raise ValueError('message')" instead of
      the older form "raise ValueError, 'message'".
      The paren-using form is preferred because when the exception arguments
      are long or include string formatting, you don't need to use line
      continuation characters thanks to the containing parentheses.  The older
      form will be removed in Python 3000.
> +def clone(remote, local):
> +    """Clone a remote repository using 'git clone'."""
> +    run.Run('git', 'clone', remote, local).run()

You don't capture git's output here, but just let it through. Does that look good in combination with the enclosing out.start() ... .done() stuff?

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Catalin MarinasNext: Catalin Marinas
Message 9 of 27 in “Various StGit updates”
  1. 0/9 Various StGit updatesCatalin Marinas, Apr 28, 2009
  2. 1/9 Show "Pushing <patch>...done" when pushing a patchCatalin Marinas, Apr 28, 2009
  3. Karl HasselströmApr 29, 2009
  4. 2/9 Show some progress information when checking for upstream merges.Catalin Marinas, Apr 28, 2009
  5. Karl HasselströmApr 29, 2009
  6. 3/9 Do not sleep after the last patch sent by e-mailCatalin Marinas, Apr 28, 2009
  7. Karl HasselströmApr 29, 2009
  8. 4/9 Convert 'clone' to the use stgit.libCatalin Marinas, Apr 28, 2009
  9. Karl HasselströmApr 29, 2009
  10. Catalin MarinasMay 13, 2009
  11. 5/9 Convert 'hide' to the lib infrastructureCatalin Marinas, Apr 28, 2009
  12. Karl HasselströmApr 29, 2009
  13. Catalin MarinasMay 13, 2009
  14. 6/9 Convert 'unhide' to the lib infrastructureCatalin Marinas, Apr 28, 2009
  15. Karl HasselströmApr 29, 2009
  16. 7/9 Reinstate the --annotate option for refreshCatalin Marinas, Apr 28, 2009
  17. Karl HasselströmApr 29, 2009
  18. 8/9 Add the log --clear optionCatalin Marinas, Apr 28, 2009
  19. Karl HasselströmApr 29, 2009
  20. 9/9 Use the default git colouring scheme rather than specific scriptsCatalin Marinas, Apr 28, 2009
  21. Karl HasselströmApr 29, 2009
  22. Samuel TardieuApr 29, 2009
  23. Samuel TardieuApr 29, 2009
  24. Karl HasselströmApr 29, 2009
  25. Shinya KuribayashiMay 4, 2009
  26. Catalin MarinasMay 29, 2009
  27. Shinya KuribayashiMay 30, 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.