Skip to content
Commit bb930461 authored by Mike Frysinger's avatar Mike Frysinger Committed by David Pursehouse
Browse files

subcmds: stop instantiating at import time



The current subcmds design has singletons in all_commands.  This isn't
exactly unusual, but the fact that our main & help subcommand will then
attach members to the classes before invoking them is.  This makes it
hard to keep track of what members a command has access to, and the two
code paths (main & help) attach different members depending on what APIs
they then invoke.

Lets pull this back a step by storing classes in all_commands and leave
the instantiation step to when they're used.  This doesn't fully clean
up the confusion, but gets us closer.

Change-Id: I6a768ff97fe541e6f3228358dba04ed66c4b070a
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259154
Tested-by: default avatarMike Frysinger <vapier@google.com>
Reviewed-by: default avatarDavid Pursehouse <dpursehouse@collab.net>
parent d3639c53
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment