Gg – Git Shortcuts, Colored Outputs, and More
github.com
github.com
EDIT: I partially retract my previous judgement, the prettified and colorized output does look nice.
I think Git users largely fall into two camps: hobbyists that use Git primarily because of Github and probably use less than 10 Git commands (I'm in this camp), and professionals who rely on Git heavily, and have been using it long enough that they've likely tailor-made their own shell aliases/functions/scripts to meet their exact needs.
The first group has little use for a host of aliases that they'll likely never need, and the second isn't inclined to trade in their own tools for colorful output that depends on node.
It's an interesting idea, but I just don't see it taking off.
If the project used python it would be equally perverse.
As for why? Much of the functionality of this project is aliasing git commands to shorter names, which could be done easily as a git alias, or even a plain old shell alias or function.
Instead, node is invoked, which then uses the child_process module to... shell out to git. It's a pretty convoluted way of doing either `alias ggs='git status` or `git config --global alias.s status` .
Using node, or any other scripting language to transform `foo s` into `git status` seems a bit heavy to me, but then I'm not the target audience for this tool, so there is that.
Having said all that, gg does actually provide a bit more than simple aliases, it seems to do a decent job of prettifying the output from git commands and improving the user experience. I don't wish to discourage the author of this tool. I personally wouldn't use it, but they should feel proud of what they've made and continue hacking and making things.
I wish you had included this in your initial comment, which otherwise seems like a knee-jerk reaction to a misinterpretation of the project's scope.
Personally, I would like to see it include significantly more robust functionality than aliases and prettified output in order to offset the cost of loading up the node runtime. There isn't much to be improved upon with the typical init/clone, pull, commit-all, push loop. Beyond those typical tasks, there's a lot of room for improvement, and that's where something like gg could excel. I would love to see something that helps with merge conflicts, rebasing, history modification, partial/interactive staging, etc.
@qw3rtman: This is a great idea for a project. Making Git's UI more accessible and attractive is a worthy goal. Keep at it, I'm sure many people will use this.
For instance, this is my git dotfile doing that to display branches for a cherry-pick alias:
https://github.com/jakub-g/dotfiles/blob/master/git.profile#...
(_gitbranches() is defined at the beginning)
If you would like to contribute to the addition of branches, that would be great. :)
For example, the gg s command presents you with an easy to look at a quick glance status of your repository. In addition, there are aesthetic changes that increase the intuitiveness of Git itself.
Here's a screenshot of the gg s command in action: http://i.imgur.com/qXSPuv4.jpg.
Yes, node/npm are required, but most of the servers I work with these days already have those for other tools.
EDIT: Scratch that. I just saw that git-config supports include directives. The infrastructure is already done for me. Now I just need to separate that bit of code out of the main dotfile repository.
I guess what I was getting at here is that I haven't come across a good analog to npm for shell scripts or dotfiles "modules". Using node/ruby/py/etc instead of shell scripts is often overkill (debatable for gitgoodies), but having the standardized infrastructure is valuable.
I'm concerned with the lack of feedback about _which_ changes are staged + commited. It should be considered best practice to review what you are committing.
I'll definitely add this to the TODO. :)
Therefore until one acquires an understanding of that, even simple things (that have easy plain english expressions) can be rather obscure.
Even if you ssh a lot, the odds of having these extra layers installed are pretty low so you might as well get as comfortable as you can with the basic commands.
But for local usage, do yourself a favor and install a graphical client. Color terminals will never give you as much information as a graphical tool will.
Personally, I prefer a more minimal shell setup, so I decided to develop my own customization from the ground up based on the ZSH User Guide (http://zsh.sourceforge.net/Guide/zshguide.html) rather than installing a large chunk of additional code and plugins that I'm unlikely to be able to carefully evaluate, in addition to memorizing others' mnemonics.
For those who prefer to evaluate something just from the end-user perspective and don't really care about how it works as long as it does work, I could understand the appeal of OMZ because it offers a lot and asks little in return.
Here are some other discussions from reddit about OMZ along this same general theme, which I would encourage prospective OMZ users to read as well:
http://www.reddit.com/r/archlinux/comments/2qdjky/using_zsh_...
http://www.reddit.com/r/programming/comments/pvbfp/zsh_a_bas...
http://www.reddit.com/r/linux/comments/2pxv1w/ive_always_use...
Suggestions and pull requests welcome!
Thanks for the feedback! :)
⇒ npm ~@cluster-linux-xeon
zsh: command not found: npm
Portability?gg c message
rather than:
git add -A
git commit -m "message"
when you're doing that 50 times a day, is particularly nice.
with alias, i have `gc -am "message"`
I'm not going to debate whether git's UX is good or bad, but I don't feel like this is much of a testimonial to that. Bearing in mind that git and bash's aliasing capabilities implement the short-aliasing side of this project, (as just about every other comment in this post mentions), such that "git" can be aliased to "g" and "status" to "s", most of his examples seem to either output needless output ("Fetched!"), or output less than the original command (gg status), or are otherwise quite similar. An alias for clone seems like an odd example — the original command is 4 keystrokes longer; what's gg add here?
It might be good to show in the README how each example is materially better than git's default output, because I'm just not seeing it.
Hope that answers your question. :)