| CARVIEW |
Every repository with this icon (
Every repository with this icon (
| Description: | hub introduces git to GitHub edit |
-
10 comments Created 4 days ago by mislavoffer to fork the original repo when adding a private remote with your own namefeaturexI've implemented it in mislav@3c8c8df
Let me know if you like it so I can add tests
Comments
-
$ git push origin,staging bert_timeout > git push origin bert_timeout > git push staging bert_timeoutComments
-
I'm wondering if you think this will be useful, I tend to do this often with projects that have a gh-pages branch:
git checkout gh-pagesgit clean -dfxso maybe that could be wrapped up as
hub pagesComments
-
For those of us behind corporate proxies, git:// URLs may not work. I created a branch that supports a git config property called
github.use_http_for_public. Setting that property totruewill causehubto use HTTP URLs.Comments
-
4 comments Created about 24 hours ago by stephencelisHonor git global pagination options/behaviorbugx(I guess it's usually "paging", not "pagination"...)
Running
git(git help, andgit --help) without any more arguments displays the usage without a pager. Runninghub, however, doesn't honor this. Writinghub --no-pagerjust sends execution straight togit(as do--paginateand-p). This commit fixes the behavior:https://github.com/stephencelis/hub/commit/ed49567cd36a2880de9ba3a65892c45557d52594
Not sure if the execution is desirable (i.e., adding the @no_pager variable), but it's the least invasive without parsing through all the global options.
Comments
stephencelis
Sun Dec 13 14:09:24 -0800 2009
| link
I could remove line 153 and
hub helpwould still page by default, buthub --no-pager helpwould begin to work:https://github.com/stephencelis/hub/commit/ed49567cd36a2880de9ba3a65892c45557d52594#L0R153
Just wondering if the other pagination options are worth bringing in? E.g.,
git -pwill page its usage, even thoughgitwill not, so shouldhub --no-pagerwork?Another consideration is checking for settings like
git config --add pager.help no.Why should man pages never be paged?
git help cloneand friends are all paged for me.The paging code was added specifically for
hub help hub
stephencelis
Sun Dec 13 14:23:18 -0800 2009
| link
Ha, I think I'm just being confusing.
Man pages should always be paged (even
git --no-pager help clonepages), and this patch still forces this behavior. I was just talking about the help text.git: shows help text but never pages unless you explicitly callgit -porgit --paginate.hub: shows help text, but always pages it (andhub --no-pager, meanwhile, shows git's help text instead of hub's). -
5 comments Created about 22 hours ago by akahnhub assumes the name of the repository to be the name of the current directorybugxFor example:
$ cd /usr/local/Library/Formula $ hub remote add akahn $ cat ../../.git/config [remote "akahn"] url = git://github.com/akahn/Formula.git fetch = +refs/heads/*:refs/remotes/akahn/*That remote url is going to be problematic. To solve this, hub needs to figure out what the name of the repository is, and construct the remote url based on that.
I'll take a look and see if I can come up with a solution.
Comments
I wonder which is often more accurate: the name of the directory
.gitlives in or the repo specified in theoriginremote? I think the base directory might be safer - traverse up until we find something with a.git.Hey Chris,
I'm working on a solution that more closely follows the second scenario you describe (actually using
git rev-parse --show-prefixto get the current offset from the base directory). I'll file a pull request or ping you on IRC when I'm finished.Cheers,
AlexA much better solution is already in my fork. It's implemented as part of the
hub forkcommand.Of course, it works only if the repo is cloned from github already. If it doesn't have an "origin" remote pointing to github, then scanning the pwd (and other solutions you might come up with) take place.
Ah, I see defunkt already suggested this. Anyway, it's implemented, so check it out. Names of directories should only be used as a last resort. In case of homebrew, you would get "local" for the repo name, which is useless.
Here is my implementation: https://github.com/akahn/hub/commits/
True, this does not solve my homebrew example above. Perhaps mislav's suggestion of relying first on the remote origin url, and second, on the directory, is the best approach of all. This would account for the homebrew (and other weird exceptions) example, as well as new repositories and other repositories that weren't cloned originally from GitHub.
-
Even better respect git paging options.
0 comments Created about 4 hours ago by stephencelisA few small fixes:
Ruby 1.9 doesn't like it when you call "first" on a string:
https://github.com/stephencelis/hub/commit/32d4d38857d8456de33e8efb290f365bb8f47885
git sets pager to "cat" when the pager is an empty string:
https://github.com/stephencelis/hub/commit/36ee4529c48fba56d31cb85b478e76054a7b0d4d
And here's the fix for your comment here (https://github.com/stephencelis/hub/commit/ed49567cd36a2880de9ba3a65892c45557d52594#comments):
https://github.com/stephencelis/hub/commit/b523c4251274460e5539b4923d2fdfa83a7844d1
I like not depending on the Runner's implementation, but
[-p|--paginate|--no-pager]still, in the meantime, immediately bomb out togit.Comments












I said "clone" instead of "fork" in the original commit message. I've force-pushed a new commit: mislav@840dcd5
Love it.
It might be best to add this as a
git-forkcommand first. Then add the prompt togit-remote.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;
IO.pipe, the same way they're capturing stdout from a forked process. I'll push soon so you'll seeI look forward to seeing it. I hadn't considered
IO.pipefor this. I may need to update the challenge solutions to include this.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
hub remote add -p mislavprompts me to create a fork seems weird to defunkt because git is itself very explicit—there are not much prompts (if any). hub should feel like git, and I agree.defunkt was proposing something in the lines of:
The "--fork" flag implies "-p" and launches the
hub forkcommand without prompting.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
hub remote add -p mislav. To have a remote named differently, one could write: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
hub fork. However I don't know ifhubis intended to add additional commands or just extend the current ones (?).