r/programming • • Jun 19 '14

Reinventing GIT interface

http://tonsky.me/blog/reinventing-git-interface/
221 Upvotes

325 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jun 19 '14

run ... git .... status.

Honestly if your commits are missing files you need to go back to git basics...

I don't get what a "complex" merge ... Do you mean one with conflicts? Because conflicts happen in all SCMs. Merging in git is dead simple

 git merge [--no-ff] source_branch

I don't understand how that could be simpler. Heck if you do --no-ff merges you can undo the merge with git reset HEAD1 --hard and you're back to the state before the merge. Or you could do your merges into a new branch of your target and just throw away the new branch if it goes wrong.

You find it hard to use because you're not thinking like you're using git. You can always create a scratch branch to practice merges/rebase/etc into. None of those commands delete commit objects.

Heck I can do

 git checkout -b new
 git rm -f *
 git commit -am "fuck the world!"

And from there either do

 git reset HEAD~ --hard

or

 git checkout master
 git branch -D new

and I'm back to where I started

2

u/Guvante Jun 19 '14

Heck if you do --no-ff merges you can undo the merge with git reset HEAD^1 --hard and you're back to the state before the merge.

And why it can't it be just as easy when you don't do --no-ff?

If I am working somewhere where we do --no-ff exclusively and I was new so forgot to alias it require a bit of work and looking at several man pages to undo?

2

u/[deleted] Jun 19 '14

If you merge a branch that has > 1 commit on them you can't revert the merge without going back n-many commits.

--no-ff should be the default for all non-trivial merges (e.g. >1 commit) because it allows you to revert the merge easily.

4

u/Guvante Jun 19 '14

--no-ff should be the default for all non-trivial merges (e.g. >1 commit) because it allows you to revert the merge easily.

And this is an example of a fix that git could use to be more usable.

It is my understanding that most people want a GUI with changes like the OP is mentioning and a CLI with a few subtle ease of use changes like --no-ff being default and more sane force options. For instance git push -f being --force-with-lease instead of --force.

0

u/[deleted] Jun 19 '14

I never said the git command line tool couldn't be improved. I just disagree with using third party addons.

2

u/Guvante Jun 19 '14

Ah, your comments seemed to imply you thought that any changes to git's command line would be superficial and unnecessary.

1

u/[deleted] Jun 19 '14

No I disagreed that it's UI issues make it unusable or otherwise overly difficult to use.

5

u/julesjacobs Jun 20 '14

This whole thread is a series of somebody pointing out a problem in Gits interface or how to make Git more usable, and then you responding with "git is not completely unusable!!!", including your very first comment.

It's reminiscent of the threads about PHP a couple of years ago. Somebody would point out an obvious flaw in PHP, like inconsistent naming, and then another person would respond "this is just a small problem!!!" over and over for zillions of flaws.

At some point you just have to accept that yes, Gits interface is pretty damn ugly. It doesn't mean Git is useless, but it could be a whole lot better than it is now.