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
offer to fork the original repo when adding a private remote with your own name #4
Comments
I said "clone" instead of "fork" in the original commit message. I've force-pushed a new commit: 840dcd5 |
Love it. |
It might be best to add this as a |
I suck at testing command line tools, especially prompts. Any pointers would be helpful. |
@mislav I've used this MockIO class for testing interactive commands. It is a way to test at a high level and interact with it just like the user would. It's probably overkill for this but just thought I'd mention it. For simple cases, mocking the gets/puts methods with Mocha would probably be sufficient. |
Thanks, I still remember your community challenge :) I solved it as defunkt suggested; |
I look forward to seeing it. I hadn't considered |
I have pushed my feature branch "fork". Ryan, you were interested in the test helper (it is used in "hub_test.rb") |
Now to document what defunkt and I have been discussing: the fact that defunkt was proposing something in the lines of:
The "--fork" flag implies "-p" and launches the I, however, have a different idea; just writing this:
And hub will check if you have an appropriate remote (named "mislav") set up; if not, it will create it with
What are your opinions? Which feels like the most git-like and is the closest to how you imagine git fork workflow in your head? To me, it would be the last, for I already have a system-wide Thor command "thor github:fork" that makes the fork and creates the remote named "mislav". |
I prefer the simplicity of |
I've re-implemented this feature in "fork2" branch. Forking doesn't happen on
"Forks the original repo on GitHub and adds the new remote under your username. |
I've force pushed new commits to the fork2 brach, just a heads up if anyone pulled it already. Nothing new, just split it into a couple of commits and moved unrelated doc fixes elsewhere. |
Just tried out Is it defaulting to making a private fork right now? It should probably check the visibility of the parent and then match it. e.g. forking a private repo produces a private repo, forking a public repo produces a public repo |
Defaulting to making a private fork? It just uses the fork API without extra arguments. From my experience this creates public forks for opensource projects, but I haven't tried with a private project. But it does default to adding your private push URL as a new remote, yes. |
I tried to fork a public project and it created a private fork, is why I bring this up. |
Hrm that's confusing, just worked. I'll investigate further later. |
Hum! That's strange. My last 4 forks were created with this command and they were never private. Do you think this should be fixed in the |
Just force-pushed rebased commit to fork2 |
Pushed again, this time switching from FakeWeb to Webmock for stubbing out HTTP requests. Webmock is a little more featured, allowing me to check if correct Github username/token were passed while forking. It also integrates well with test/unit |
Merged and released in 1.1.0 - thanks! |
I've implemented it in 3c8c8df
Let me know if you like it so I can add tests
The text was updated successfully, but these errors were encountered: