

Gg – Git Shortcuts, Colored Outputs, and More - qw3rtman
https://github.com/qw3rtman/gg

======
s_kilk
Using node to wrap a few shell aliases seems preverse to me.

EDIT: I partially retract my previous judgement, the prettified and colorized
output does look nice.

~~~
keslag
Why exactly? How would this differ from using python?

~~~
s_kilk
It differs from python in that node is being used in this project, not python.

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.

~~~
brianshaler
> 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 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.

------
imiric
Such negativity here. I wonder why it still surprises me.

@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.

------
bcl
I don't see anything here that you can't do with git alias, what am I missing?

~~~
danvayn
well, if you've always wanted to lose the ability to work with branches you're
in luck

~~~
jakub_g
You can easily bash add autocompletion to bash aliases, if you meant that.

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#...](https://github.com/jakub-g/dotfiles/blob/master/git.profile#L262-263)

(_gitbranches() is defined at the beginning)

------
jobvandervoort
If anything, this looks very pretty.

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.

~~~
qw3rtman
Firstly, thanks for the feedback. That sounds like a great idea, although it
may be painful to implement.

I'll definitely add this to the TODO. :)

------
michaelmior
This looks nice although personally I'm a happy user of scm_breeze[0]. My
favourite is the shortcuts which allow you to interactively enter a commit
message in the shell without needing to open an editor.

[0]
[https://github.com/ndbroadbent/scm_breeze](https://github.com/ndbroadbent/scm_breeze)

------
toothbrush
I felt very jumpy looking at the output of `gg s` -- what's staged? What are
the changes? What am i going to commit? Maybe it's for people who routinely do
`git commit -am $MSG` but sometimes it's best to be a little more nuanced. But
i'm a complainy geezer who likes magit.

------
hurin
I think one of the problems with git command-line from an ease of use
perspective, is that it emulates the underlying structure.

Therefore until one acquires an understanding of that, even simple things
(that have easy plain english expressions) can be rather obscure.

------
zak_mc_kracken
It's important to know the basics of git from the command line but git's
output can be so rich that it's pretty futile to try and capture this from the
command line.

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.

------
leereeves
What does this do that can't be done with git aliases?

~~~
neikos
I suppose it takes the work of writing them away from you.

------
benwaffle
I use oh-my-zsh ([http://ohmyz.sh/](http://ohmyz.sh/)) and the git plugin
([https://github.com/robbyrussell/oh-my-
zsh/wiki/Plugin:git](https://github.com/robbyrussell/oh-my-
zsh/wiki/Plugin:git))

~~~
dbbolton
OMZ is a nice tool for new zsh users to get a sense of the shell's
capabilities, but it also comes with a lot of excess that doesn't really seem
fit for regular use. The idea of a plugin system is great for desktop
environments, browsers, and even editors, but it seems strange to me to use
one for your shell.

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](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/archlinux/comments/2qdjky/using_zsh_ohmyzsh/)

[http://www.reddit.com/r/programming/comments/pvbfp/zsh_a_bas...](http://www.reddit.com/r/programming/comments/pvbfp/zsh_a_bash_alternative_thats_easily_customizable/)

[http://www.reddit.com/r/linux/comments/2pxv1w/ive_always_use...](http://www.reddit.com/r/linux/comments/2pxv1w/ive_always_used_bash._is_there_a_good_reason_to_explore_other_shells/cn10h0y?context=3)

------
jph
Git alias favorites of ours:
[https://github.com/SixArm/sixarm_git_gitconfig/blob/master/g...](https://github.com/SixArm/sixarm_git_gitconfig/blob/master/gitconfig.d/alias.txt)

Suggestions and pull requests welcome!

------
AstroChimpHam
It would be nice to have something that makes the hard-to-remember stuff in
git more accessible. @qw3rtman, how often do you plan to work on this? I
wouldn't use it yet, but I might if it were more built out (and had support
for branches).

~~~
qw3rtman
I am currently working on support for branches, which I hope to release in the
near future.

Thanks for the feedback! :)

------
lloydde
Did you consider building on top of Hub ,
[https://github.com/github/hub/](https://github.com/github/hub/) ?

------
apurcell
I'm glad these make your life easier, but I'm not sure why anyone else who
already knows how to use git and can make their own aliases would bother
learning yours.

------
rawland

        ⇒ npm  ~@cluster-linux-xeon
        zsh: command not found: npm
    

Portability?

------
darthdeus
Why do node people feel like they have to re-invent everything UNIX?

------
Srujayisgod
It can be improved but not bad.

------
Brakenshire
Seems like an excellent idea, being able to type

gg c message

rather than:

git add -A

git commit -m "message"

when you're doing that 50 times a day, is particularly nice.

~~~
graywh
git add -A && git commit -m "message" is equivalent to git commit -a -m
"message"

~~~
aeosynth
which reduces to `git commit -am "message"`

with alias, i have `gc -am "message"`

------
beyondcompute
Yet another testimonial that something is wrong with Git UX :)

~~~
deathanatos
> Yet another testimonial that something is wrong with Git UX :)

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.

------
zer0zzz
Hey look: It's GPL3. Thanks dude.

------
isgood12
Good place to ask this -- Whose gitconfigs do you look at for stealing ideas?

~~~
qw3rtman
The only output I didn't fully design on my own was the log command (`gg l`).
I used information found on this Gist
([https://gist.github.com/textarcana/1306223](https://gist.github.com/textarcana/1306223))
to retrieve the log information in JSON. From there, I designed an output
style on my own.

Hope that answers your question. :)

