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

[StGIT PATCH 0/4] Clean up subprocess calling

From
Karl Hasselström <kha@treskal.com>
Date
Aug 26, 2007, 20:33 UTC
Message-ID
<20070826202724.16265.85821.stgit@yoghurt>

We had nearly ten separate functions implementing about five different ways of calling a subprocess. This series cleans it up. The aggregate diffstat looks scary, but that's mostly because these functions were called in a bajillion different places.

If you choose to pull from my repository (which I highly recommend!), note that this series is built on top of the misc fixes, so you get those as well.

The following changes since commit 216a1524c4acbd9952ffaeec054e30cf14dde5fc:
  Karl Hasselström (1):
        Compile regexp just once
are available in the git repository at:
  git://repo.or.cz/stgit/kha.git run
Karl Hasselström (4):
      Refactor output handling to break circular dependency
      Refactor subprocess creation
      Assert that the argument to Run is a sequence of strings
      Add optional logging of subprocess execution
 stgit/basedir.py             |   13 +-
 stgit/commands/applied.py    |    1 +
 stgit/commands/assimilate.py |    1 +
 stgit/commands/branch.py     |    1 +
 stgit/commands/clean.py      |    1 +
 stgit/commands/commit.py     |    1 +
 stgit/commands/common.py     |    1 +
 stgit/commands/delete.py     |    1 +
 stgit/commands/diff.py       |    1 +
 stgit/commands/export.py     |   10 +-
 stgit/commands/files.py      |    1 +
 stgit/commands/fold.py       |    1 +
 stgit/commands/hide.py       |    1 +
 stgit/commands/id.py         |    1 +
 stgit/commands/imprt.py      |    1 +
 stgit/commands/log.py        |    1 +
 stgit/commands/mail.py       |    1 +
 stgit/commands/patches.py    |    1 +
 stgit/commands/pick.py       |    1 +
 stgit/commands/pull.py       |    1 +
 stgit/commands/push.py       |    1 +
 stgit/commands/refresh.py    |    1 +
 stgit/commands/rename.py     |    1 +
 stgit/commands/series.py     |    1 +
 stgit/commands/sync.py       |    1 +
 stgit/commands/top.py        |    1 +
 stgit/commands/unapplied.py  |    1 +
 stgit/commands/uncommit.py   |    1 +
 stgit/commands/unhide.py     |    1 +
 stgit/config.py              |   56 ++-----
 stgit/git.py                 |  331 +++++++++++++++++-------------------------
 stgit/gitmergeonefile.py     |   21 +--
 stgit/main.py                |    2 +-
 stgit/out.py                 |  100 +++++++++++++
 stgit/run.py                 |  141 ++++++++++++++++++
 stgit/stack.py               |    1 +
 stgit/utils.py               |   81 +----------
 37 files changed, 436 insertions(+), 347 deletions(-)
 create mode 100644 stgit/out.py
 create mode 100644 stgit/run.py
-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Next: Karl Hasselström
Message 1 of 14 in “Clean up subprocess calling”
  1. 0/4 Clean up subprocess callingKarl Hasselström, Aug 26, 2007
  2. 1/4 Refactor output handling to break circular dependencyKarl Hasselström, Aug 26, 2007
  3. 2/4 Refactor subprocess creationKarl Hasselström, Aug 26, 2007
  4. 3/4 Assert that the argument to Run is a sequence of stringsKarl Hasselström, Aug 26, 2007
  5. 4/4 Add optional logging of subprocess executionKarl Hasselström, Aug 26, 2007
  6. Catalin MarinasAug 29, 2007
  7. Karl HasselströmAug 29, 2007
  8. Karl HasselströmAug 29, 2007
  9. Catalin MarinasSep 3, 2007
  10. Catalin MarinasSep 3, 2007
  11. Karl HasselströmSep 3, 2007
  12. 0/2 Break Python 2.3 compatibilityKarl Hasselström, Sep 3, 2007
  13. 1/2 Use subprocess.Popen to call git executablesKarl Hasselström, Sep 3, 2007
  14. 2/2 Use the builtin set() instead of sets.Set()Karl Hasselström, Sep 3, 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.