A Dedicated Shell For Git Commands 96
Nw submitter CMULL writes "Stop typing Git over and over again. Ruby on Rails development and consulting firm thoughtbot created an interactive shell dedicated to Git commands, gitsh. One of the primary developers says there is a need for this shell because many early Unix utilities don't take sub-commands like Git."
Typo? (Score:2)
Re: (Score:2)
Maybe the submitter thought he'd made a joke. Y'know - take my wife, please *gitish*
Re: (Score:1)
Re: (Score:2)
I really think it "glitch".
Re: (Score:2)
why not just use shell aliases? (Score:5, Informative)
alias gstatus='git status'
alias gcommit='git commit'
Or whatever other commands you want? I don't see the need for a purpose built shell when aliases would work just fine?
Some people just want to overengineer things I guess...
Re:why not just use shell aliases? (Score:5, Insightful)
Re: (Score:2)
Re: (Score:1)
Re: (Score:1)
The systemd guys clearly don't understand unix and they're not even close to reimplementing it, though.
Give it time (Score:4, Interesting)
They have to build a custom shell so that later it can be hosted as a service.
Re: (Score:2)
Kids these days.
Re: (Score:2)
You are using doge shell [husk.org].
because... (Score:2)
... aliases are not new. you must come up with something newish to hit the headlines.
Re: (Score:2)
This is exactly what I was thinking. However, there is one reason: So you can make it a restricted login shell that can only issue git commands or git plus some small subset.
Other than that, beats me, I can't imagine any other scenarios where aliases wouldn't be good enough.
Re: (Score:3)
Some people just want an OSS contribution on their resume I suggest.
Re: (Score:2)
Don't forget the tab completion and sh prompt integration.
https://github.com/git/git/tre... [github.com]
I don't see the point (Score:4, Insightful)
I am using git all the time. But most of the time, I am doing less than 5 different commands. Why would you need a shell for that?
Re: (Score:3)
There is a pompus ass here, but I'm pretty sure it's not the O.P. And I don't think it's me either ...
Re: (Score:2)
They're a Ruby on Rails shop, what were you expecting?
Comprehension Failure (Score:5, Informative)
The developer in the article does not "say there is a need for this shell because many early Unix utilities don't take sub-commands", as the summary says. Rather, he motivates the idea of gitsh by comparing it to utilities which act in a shell-like manner (he picks dc as an example): if it works for them, why not for git too?
The first version (from the summary) makes no sense; the second version (from the article) seems like a reasonable argument to me.
Rather than fucking beta, how about we try to get the fucking summaries correct?
Or just use an IDE (Score:2)
Or you could just use an IDE like Vim, Eclipse, NetBeans, etc. that can handle git via plugins. If you are using git enough that you need an interactive shell, you might as well just integrate it with your development enviroment.
Re: (Score:3)
Re: (Score:2)
To me the git integrations in IDEs have never felt quite right, CVS and SVN were great but something doesn't quite fit for the git workflow so I still use cli/gitk/gui 4-years later.
Agree 100% in the case of Eclipse on Windows. Get all kinds of spurious commits involving line endings. So I just drop into a cygwin shell for commits.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
It's three letters (Score:5, Insightful)
Effort-wise, switching into and out of a git-specific shell just to save those three letters is a huge hassle and not worth it. (The tab completion thing is not an advantage; regular git already does that in bash.)
For any actual development work you'll keep using both git and non-git commands; opening text editors, diffing and patching outside git, running scripts and shell snippets or sed commands. How do you pass those out of the git shell? Using an exclamation mark, like in ed? That really just inverts the problem, adds the problem of remembering whether you're currently in gitsh or bash, and adds confusion between the two environment variable scopes.
Re: (Score:1)
I don't know why this has made it to every programming news site I visit.
Re: (Score:2)
Technically, 4.
Unless your shell will somehow interpret gitcommit as 'git commit' ;)
Anonymous Coward (Score:1)
Technically, it's 3 letters but 4 characters.
Unless yous shell will somehow interpret gitfcommit as 'git commit' ;)
Re: (Score:2)
Re: It's three letters (Score:1)
Since when? Doesn't for me, I'm running FBSD 10, and OSX, neither seem to magically know.
Mind you, I just started using git a few weeks ago to interact with a github hosted project, but I've been using subversion and cvs for 10 years at least. I may just be ignorant of something I have to do to get it to know about the branches?
Should do it automatically in bash (Score:2)
Seems to work out of the box in debian jessie and Ubuntu 12.04+ at the very least. It installs a script in /etc/bash_completion.d/git that reads the branch list straight from the .git/ subfolder in the current repository.
Re: (Score:1)
Re: (Score:2)
Re: (Score:2)
zsh does out of the box.
Re: (Score:2)
I see this as something you'd use if you tend to work in a GUI that's just full of terminals. You can keep a gitsh terminal open and easily switch over to it to run git commands without having to drop out of something else.
gitshell (Score:5, Funny)
> echo -n "GitShell:"
> read command
> git $command
> done
Well that was easy!
Re: (Score:2)
looks promising (Score:1)
Web developer here and used git for last 2 years on a daily basis.
Gitsh looks promising, but I will hold my verdict until I use it for an extended period, and see how it can improve my work life.
Currently I use a combination of SmartGit and Git Bash. SmartGit is mainly used in visualizing branch history, resolve conflicts, tagging and do some odd jobs here and there e.g. edit message of the last commit. Git Bash is used for checking out branches, merging, pulling, pushing sort of stuff i.e. any operation th
Re: (Score:2)
If you're using git bash, this really isn't for you anyways. You already have to run a "specialized" shell just to use it - why run another shell inside that one?
This is meant for people running operating systems that come with functional shells as-they-are.
Does it let you run non-git commands, as well? (Score:1)
If it doesn't, I don't see how it saves much typing.
$ vim -p file1.c file2.c file3.c ./a.out
$ make
$
$ gitsh
@ add file1.c file2.c file3.c
@ commit -m 'some crap'
@ ^D
$ vim -p file1.c file2.c file3.c ./a.out
$ make
$
$ git add file1.c file2.c file3.c
$ git commit -m 'some crap'
Net savings of what, one keypress? It's rare for me to issue more than one or two git commands without issuing a non-git command. Unless the intention is to have a seperate shell up that you switch to whenever you need to do get stuff, maybe?
I
Already done before though (Score:1)
Good idee, and it works too, but TFA is not the first attempt at doing so: https://github.com/rtomayko/git-sh
I have been this rtomayko's solution for a year now, and the shell combined with a decent set of shorthand aliases that come with the shell, do improve my workflow a lot. I can recommend it to anyone who uses git on a daily basis.
Giteye (Score:1)
I have been using Giteye ( http://www.collab.net/giteyeap... [collab.net] ) to manage my git repositories, it is very powerful and full featured. I particularly like its merge tool. I don't type git commands anymore except when I am making some kind of script that needs to get stuff into or out of git. It also integrates painlessly with github and many other Issue tracking tools.
There are a few disadvantages in using it though:
1) You have to learn how to do stuff you already know how to do in the CLI (mildly annoying).
2
Re: (Score:2)
You might want to give Atlassian SourceTree [sourcetreeapp.com] a try. Also free-as-in-beer, but a little lighter-weight. I find it's pretty nice.
Re: (Score:1)
Looks pretty good, but I already learned Giteye. How does it hold up against Giteye? any killer features?
Re: (Score:2)
Looks pretty good, but I already learned Giteye. How does it hold up against Giteye? any killer features?
Beats me. I've never used giteye. Just thought I'd pass along the tip.
Mark as duplicated (Score:5, Informative)
Re: (Score:1)
Re: (Score:2)
Not to mention, git-sh seems far more useful (succinct, and doesn't use any weird syntax) than this one.
What we need is not a shell, but sha picker. (Score:2)
I don't want to pay for the overhead of a full fledged GUI. I like the speed of command line thank you very much. But picking the check sum to do cherry picks is a pain. Especially for me stuck in a st
Re: (Score:2)
Double-click on SHA numbers seems to work fine for me, I use it all the time.
Re: (Score:2)
"gitk" came with MSysGit (when I last used it), and you can right-click commits and choose "cherry pick".
"git gui" also works.
Re: (Score:2)
You need to run sshd under cygwin and use Putty to easily double-click to select a sha sum (enable X11 mode for select=copy and middle-click=paste).
Shell? Give me a web based browser (Score:2)
What I wish was available was a way to view the source of a git with one minor enhancement - the ability to browse with a click to the declaration/definition of functions/variables a la the IDE of your choice. Would be neat to be able to build an index using some tool, check it into the root of your repo, and then have the site use the index to mark up the source code with the appropriate links.
I
Re: (Score:2)
Re: (Score:2)
Sound
Re: (Score:2)
Thanks for t
Too late? (Score:2)
What you need is a new command shell (Score:3)
Bash is very good, but much could be done to craft a better command shell that combines the best of Bash, Perl, Ruby and Python, with the only bit of Visual Basic that I really liked: the with construct.
In Visual Basic, one could write .this := that .and := other
with myObject
end with
The dots at the start are redundant given proper block structure, unless you also have a smalltalk like messaging facility that runs aside C++ style getters and setters. Then .this = that style constructs would do low level get and set, and
with git
init
add .
commit -m "initial commit"
end
which is fine provided 'git end' has no meaningful value to git.
I'm also thinking about the consequences of replacing the environment with stacks of dictionaries, and playing with simple prototypes in Python, sometimes just half writing them to help me see how the code would look.
Re: (Score:2)
The dots aren't redundant:
Dim x
With y
x = 1 ' Which x?
End with
But, as someone wrote up there ^^, you could use a while loop:
$ while true; do
> echo -n "GitShell:"
> read command
> git $command
> done
But built in shells are generally horrible. (Score:2)
The mistake with the thesis of the authors is to think that little tools with built in shells to handle subcommands (dc, ftp etc) are generally not horrible. They are horrible and reproducing their interface mistake for git is also a mistake of the same type.
Completions? (Score:2)
Does it support completion of git commands like bash does with some bash_completion functions?
gitg (Score:2)
The command line is great but sometimes a GUI comes along and makes things so much easier, especially to cherry pick.
gitg [gnome.org]