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

[StGIT PATCH 0/9] Refactoring of command handling

From
Yann Dirson <ydirson@altern.org>
Date
Jun 16, 2007, 22:00 UTC
Message-ID
<20070616213615.14941.31187.stgit@gandelf.nowhere.earth>

While working on hydra support, I've hit a couple of issues which I have handled with a set of relatively large patches: nearly every line of code under stgit/commands/ gets reindented, because of functions being changed to instance methods.

I submit this patchset early, despite it being very young, because of the high risk of conflict with other work and the large amount work it would require to maintain in parallel - also, since the testsuite does not cover everything, it is likely that I left a couple of errors somewhere, and I'd be grateful to have other people shake the code as well. Now this set of patches would be a great candidate for a "pu" branch :)

The next refactoring pass (already in the works but with no stabilized design yet) will tackle git_id(), which should be available at generic level, not at the command level. I'm heading towards changing it to be a method of a new stgit.Repository class, pointed to by Commands and PatchSets.

Here is a quick summary:
      Refactor command definition with a Command class.
      Promote more common functions to Command methods.
      Replace crt_series uses with a method call.
	=> those are the heart of the refactoring: we suppress the
	   crt_series global and only create the Series object when
	   needed.  This is a step towards a PatchSet factory which
	   will be able to instantiate a Series or an Hydra from a
	   head name, without a need for the called to be aware of the
	   existence of PatchSet subclasses.
      Fixed thinko in error message.
      Add a constructor to PatchSet.
      Cleanup the use of the Series class.
      Changed sync not to use -b which has other semantics.
	=> cleanup needs discovered while refactoring
      Fix contrib/stg-whatchanged way of identifying a conflict.
	=> fixing the tools that help getting the patches done :)
      Revert part of the reverted commit that we want to keep.
	=> mostly here so we don't loose it, and limit the conflicts
	  when I pulled from you :)
Best regards,
-- 
Yann Dirson    <ydirson@altern.org> |
Debian-related: <dirson@debian.org> |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>
Next: Yann Dirson
Message 1 of 10 in “Refactoring of command handling”
  1. 0/9 Refactoring of command handlingYann Dirson, Jun 16, 2007
  2. 1/9 Fix contrib/stg-whatchanged way of identifying a conflict.Yann Dirson, Jun 16, 2007
  3. 2/9 Revert part of the reverted commit that we want to keep.Yann Dirson, Jun 16, 2007
  4. 4/9 Fixed thinko in error message.Yann Dirson, Jun 16, 2007
  5. 5/9 Promote more common functions to Command methods.Yann Dirson, Jun 16, 2007
  6. 6/9 Changed sync not to use -b which has other semantics.Yann Dirson, Jun 16, 2007
  7. 7/9 Replace crt_series uses with a method call.Yann Dirson, Jun 16, 2007
  8. 8/9 Add a constructor to PatchSet.Yann Dirson, Jun 16, 2007
  9. 9/9 Cleanup the use of the Series class.Yann Dirson, Jun 16, 2007
  10. Yann DirsonJun 19, 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.