Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor git commands into separate files #188

Closed
calebhearth opened this issue May 30, 2012 · 1 comment
Closed

Refactor git commands into separate files #188

calebhearth opened this issue May 30, 2012 · 1 comment

Comments

@calebhearth
Copy link
Contributor

I believe I remember seeing in one of the issues here (no citation, sorry) that there is some interest in splitting lib/hub/commands.rb into separate files for each of the commands.

I thought I might take a whack at that, but I don't want to put a bunch of effort into it if there is no longer any interest.

If I were to do the legwork to pull everything out - making sure that the tests still pass of course, would that potentially be an accepted pull-request?

Additionally, are there any particular difficulties that have prevented this from happening up to now?

@mislav
Copy link
Owner

mislav commented May 30, 2012

It's a bigger effort than you think. It was suggested in #39. However, to be clear, we aren't talking about simply splitting one big Ruby file into multiple smaller ones. We wanted to split one executable out to multiple hub-* executables, a la git.

Yes, I would like commands to be split, especially the hub-specific commands such as fork and pull-request.

  1. The Runner would have to be refactored slightly to support this new scheme. This isn't a big effort.
  2. Each separate script would have to require helper methods again (context.rb, github_api.rb, ...) because it would run as a separate process than hub executable, just as git clone command spawns a separate process for git-clone.
  3. Such split would make it impossible to generate a single standalone executable as we do now. We would have to abandon the standalone install process, which is currently the most conventient install strategy (after Homebrew).
  4. We wouldn't gain much with this split, except easier maintenance of the codebase. The performance of hub would actually degrade slightly.

Closing this because it's a dup of #39.

@mislav mislav closed this as completed May 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants