[Git Merge 2013] [Mislav Marohnić] So, what I wanted to show you
is this command line tool called hub. It’s silly that I cannot see what
I’m typing, so just a second. So, this is a little tool
called hub. It’s a little script that wraps git, so it proxies
all the commands to Git, actually. I’m not going to use any of the
standard Git commands, but I’m just going to show you
that it’s right here, and I’ve got it aliased to Git as well. So when
I type “git” I actually go through Hub, and any commands
that are not recognized just being forwarded too.
So what it does is…Hub is started project by Funk, Chris
Wanstrath from GitHub, and at some point he just
handed off development to me. It first started as augmenting
several commands that are standard in Git, just to add
some support for GitHub. For instance, what I can do
is I can say “git clone,” but I can just say “git merge,”
and I can say “user-day.” I guess this is the name of the repo.
Wow, this even works. I didn’t have to type the whole URL.
It’s full of shortcuts like this, but some of the power,
for me at least, comes from the custom commands that I can do.
Also one of the things that I like to do very much is–
I’m doing a lot of open-source, so this is very useful for me–
if I want to add a remote for a GitHub project, I can do that,
and it just figures out the URL automatically, because it follows
the conventions of GitHub naming, which is very simple.
The fork is just named the same, but it’s under your username.
It does this, but it also does some very cool stuff, like here we have
some custom Git commands, so I can actually create a Git
repo on GitHub and I can fork somebody else’s repo without
ever leaving the terminal. What I don’t like is I don’t
like interrupting my flow. I like to be in a terminal;
I don’t like to go to the website. I also don’t like to open pull
requests from the website as well. So what you can– I’m not gonna demo it because
it might be a little bit boring for me to try to create the
pull request for a project, but what it does, it ejects or just
opens Vim or any other editor that you have on the command line
and asks you for a “git commit” message, so you’ll type that, but it’s
not a commit message; it actually just opens
a pull request on GitHub. You don’t have to open any
browser…or anything like that. Lately I have this command
as well, called– I don’t know, because
I traced it out on faraday — which is “ci-status,” which queries the
CI status API, which is very simple. It’s broken. I shipped this version
but it’s broken. I need to fix it. I plan to hack on this tomorrow
and I’ll open up an issue for it on Hack Day, so you can join me
and help me do some things. The problem here is that there are
multiple statuses updated from Travis’ CI, and one of them is pending,
the other one is success, and it reads the wrong one.
So I have to fix that. You’re welcome to
hack with me tomorrow; I have at least three ideas that
I want to work on it, Which are a
little bit non-trivial. It’s written in Ruby, but if you just
have any ideas how to wrap some other workflows related to
GitHub, come and approach me even if you don’t write Ruby,
and we’ll try to make that happen. Thanks. [Git Merge 2013]