Live data from Hacker News

Some bad Git situations and how I got myself out of them

ohshitgit.com

261–270 of 352 posts

Re: Some bad Git situations and how I got myself out of them

#261
post #236

Somebody proposed to use a GUI. That doesn't solve the usability issues of Git. There's this triangle of what the user tries to do, what the commands and options are called and what they actually do. None of them really align, though with some careful use you can actually make Git do what you want - eventually. I would like to understand what's the yearly damage of such an important tool being so difficult to use. Pe…

People complain, but what's the alternative? Non-distributed VCS clearly don't cut it for many use cases, and of the other DVCS I've tried, none were really better than Git in my opinion. Sure, it depends on your workflow. But if part of your workflow is authoring sequences of commits that make sense in hindsight, then I honestly haven't seen an alternative. The point of Git is that it gets the underlying data model…

I like Git generally, and my feelings on GUIs for it are kinda mixed. I like GUIs for visualizing the log with all branches, and they make it easier to selectively commit some of your changes, especially partial files. I haven't seen any that are much help over the command line for managing branching and merging, though. I like GitX for OS X because it does the things that I think GUIs are good at, and doesn't try to do much else.

Re: Some bad Git situations and how I got myself out of them

#262
post #236

Somebody proposed to use a GUI. That doesn't solve the usability issues of Git. There's this triangle of what the user tries to do, what the commands and options are called and what they actually do. None of them really align, though with some careful use you can actually make Git do what you want - eventually. I would like to understand what's the yearly damage of such an important tool being so difficult to use. Pe…

God, it's probably billions. I love git but its user interface is borderline criminal. The sad thing is mercurial has like 95% of git's power and is waaay easier to understand, but it never took off in a big way.

  $ hg clone https://bitbucket.org/eigen/eigen/
  $ cd eigen
  $ time hg grep CUDA > /dev/null
  real	0m16.661s
  user	0m16.097s
  sys	0m0.531s

  $ git clone https://github.com/RLovelett/eigen.git
  $ cd eigen
  $ time git grep CUDA > /dev/null
  real	0m0.019s
  user	0m0.035s
  sys	0m0.057s
Never looked back.

Re: Some bad Git situations and how I got myself out of them

#263
post #253

Earlier quoted context omitted.

God, it's probably billions. I love git but its user interface is borderline criminal. The sad thing is mercurial has like 95% of git's power and is waaay easier to understand, but it never took off in a big way.

> The sad thing is mercurial has like 95% of git's power and is waaay easier to understand Mercurial has a clean and simple UI, especially if you come from a SVN background. But Git's internals are simpler and the concept is much easier to understand, especially if you start looking at a handful of the most popular Mercurial extensions, some of which will be "must have" sooner or later. This is no excuse for an incon…

I think Mercurial is also great, and we also can provide some feedback as the platform that supports Mercurial as Source Code Management (RhodeCode).

There are A LOT of mercurial users which are big companies, they just aren't so vocal on the internal like people using GIT. Mercurial has an established community, great plugability system, an awesome feature like phases.

We see more and more people adopting Mercurial together with our product.

I wish to see more advocates of Mercurial, it's a shame it doesn't get more public attention nowadays.

Re: Some bad Git situations and how I got myself out of them

#264
post #65

Earlier quoted context omitted.

I'm struggling to see which VCS you deem superior, I'm assuming you are not referring to SVN, Mercurial maybe? The learning curve to git is not great but as far as I know nobody has publicly released an option that's improved enough over git to motivate the cost of switching technology. If it's not working for you the only advice I can give is either learn it until it is actually working for you rather than being in…

Yep, Mercurial's the one. It's a shame that it lost the war, they actually seemed to care about providing a good experience to their users. There are, of course, a few technical differences between it and git, but I personally never felt like they were troublesome enough to make up for the vast difference in usability.

I think Mercurial hasn't lost it yet. I speak as a creator of Mercurial Source Code management system (RhodeCode)

We see that a lot of companies(our clients/users) adopting Mercurial, you just don't hear about it. Often those are companies with employees that don't tweet or post to HN ;)

RhodeCode is used also in around 60 universities, and we learned that in a lot of them they teach Mercurial as well as Git.

For a large company it's actually much cheaper to adapt Mercurial as they new DVCS because of learning curve.

I hope companies like Facebook and Mozilla will make soon Mercurial very very fast. There's constant work on it coming from those companies to improve it.

Re: Some bad Git situations and how I got myself out of them

#265
post #207

Earlier quoted context omitted.

Or use git branch -m to rename master to something else, then checkout master anew.

That's clever, I'll remember that. But don't you lose all tracking information if you do that?

What tracking information are you referring to?

Re: Some bad Git situations and how I got myself out of them

#266

I absolutely love git now. I'm still at uni (at a highly ranked but actually crap university where we don't learn git properly) and this year was my 'year in industry' as we call it in the UK, and my first proper experience with git, aside from `git init` at the end of my project and pushing it to a repo. I've become so much more confident with git. Seriously, with one caveat (i.e., you haven't pushed your changes to…

I would not expect a university to teach git. Maybe the theory of version control systems, their history, or a comparison of different version control systems. But not how to use the tool.

I agree because of the large variety of version control tools. Git is great IMHO, but not every company uses it or can easily switch to it. Teach some theory or the basics of a few different systems and their pros and cons, but I don't think diving too deeply into only one is a good idea in a university environment.

Re: Some bad Git situations and how I got myself out of them

#267
post #161

One of the nice workflows that's already built in to the git command line tools is this one. When you're working on a branch and realise that a commit you made a few commits back has a mistake in it: # Make correcting change git commit --all --fixup= # Continue working on branch, then at some point git rebase --interactive --autosquash The --fixup option creates commits with subjects formatted like 'fixup! previous c…

Yep. I find that most of the time, the commit I want to fixup is my last one, so I don't even need the interaction. I use this script almost every day:

    last_commit=$(git log --oneline | head -1 | cut -d' ' -f1)
    git commit -a --fixup ${last_commit}
    GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash ${last_commit}~1

Re: Some bad Git situations and how I got myself out of them

#268

I absolutely love git now. I'm still at uni (at a highly ranked but actually crap university where we don't learn git properly) and this year was my 'year in industry' as we call it in the UK, and my first proper experience with git, aside from `git init` at the end of my project and pushing it to a repo. I've become so much more confident with git. Seriously, with one caveat (i.e., you haven't pushed your changes to…

I would not expect a university to teach git. Maybe the theory of version control systems, their history, or a comparison of different version control systems. But not how to use the tool.

Perhaps not specifically git, but ANY version control would have been good.

We were told to version control a group project, but all we were given was an SVN repo and told "if anything goes wrong, email this address".

Personally I would expect tuition through the use of a tool, that tool doesn't have to be git, it just so happens to be the tool I've had the most exposure to.

Re: Some bad Git situations and how I got myself out of them

#269
I've been debating starting a section of my personal site for stuff like this. Unfortunately it's a bit embarrassing, but i figure anything i have to google to learn, it would be beneficial to help others learn it as well. Everything from programming languages (lots of Rust errors are foreign to me, for example), to git issues.

I've often had the thought that if everyone did this it could have potential to be quite the open-sourced collection of material - a distributed self-answered Stack Overflow perhaps.

Is there any sanity in this? Or would posting everything as self-answers to Stackoverflow be more welcome to the average Googler? (higher ranking, better meta, more likely for the user to see it and community features such as commenting/voting/editing)

Re: Some bad Git situations and how I got myself out of them

#270
post #262

Earlier quoted context omitted.

God, it's probably billions. I love git but its user interface is borderline criminal. The sad thing is mercurial has like 95% of git's power and is waaay easier to understand, but it never took off in a big way.

$ hg clone https://bitbucket.org/eigen/eigen/ $ cd eigen $ time hg grep CUDA > /dev/null real 0m16.661s user 0m16.097s sys 0m0.531s $ git clone https://github.com/RLovelett/eigen.git $ cd eigen $ time git grep CUDA > /dev/null real 0m0.019s user 0m0.035s sys 0m0.057s Never looked back.

Did you run hg grep once before to keep it in the disk cache?
Post reply on HN