News for hackers. Stuff that matters.
Re:Please use git pull --rebase by tootie on Monday April 29, 2013 @09:53PM (#5630019)
"to keep the repository clean"

Seems like not a worthy objective. Has anyone here ever had a project saved by a tidy commit history?

Re:Please use git pull --rebase by grogers on Monday April 29, 2013 @11:50PM (#5630328)
No, of course not - how often do you actually look at extended windows of history... But it still pains me to no end when my coworkers constantly commit history like:

  Commit d
  Parent a b
  Merge branch origin/mainline into mainline

  Commit c
  Parent a
  Something they did

  Commit b
  Parent a
  Something I did

  Commit a
Re:Please use git pull --rebase by darrencauthon on Monday April 29, 2013 @10:25PM (#5630106)
Totally agree. At best this rebase talk is navel-gazing, and at worst it's a technique that turns Git into a complicated, scary place for those just want to get work done.

I have introduced git and hg to many people, but I've always tried to tie it into what people do already. Without source control, practically everybody did the same thing: They'd work a little bit, they'd save, they'd work a little bit, they'd save... etc. Using branching for organizing work and a nice cheat-sheet of a few git commands, most non-technical people will be off-and-running.

It all works until the programmers make it complicated with the rebasing. The price of the tidy commit history is the loss of confidence of the rest of the team. I'd rather have the people.

Case in point: https://vimeo.com/60788996

Re:Please use git pull --rebase by base698 on Monday April 29, 2013 @11:54PM (#5630340)
It's only complicated because people don't realize how it works. Half the people in this thread advocating to use rebase aren't saying when it's ok and when it's not ok and why.

When it's ok: You are working on your own line and the commits you've made are not in a central repo.

Why: Git commits are a hash tree and when you change one commit it changes all the SHAs that come after it. This makes git see your commits pushed remote as different then the ones that are local. The commits have the same changes so it puts duplicate conflict markers everywhere.

Most people love it once they realize how it works.

A lot of people use version control also as a backup in case their hard drive fails. Because of this they are scared of staying on a topic branch for very long, so they push then rebase often leading to conflicts which are scary.

https://en.wikipedia.org/wiki/Hash_tree

Re:Please use git pull --rebase by __david__ on Tuesday April 30, 2013 @01:18AM (#5630538)
Nor has any project been "saved" by not mixing tabs and spaces in the source code, but it's really a good idea to not do that.

Frankly if I "git log -p" and your diffs aren't clean and to the point, that's a code smell (maybe a developer smell?). If you are sloppy and inattentive in your commits, that probably carries over to your code as well. There's more to the code than just the latest version--history is important.

Re:Please use git pull --rebase by gurkendoktor on Tuesday April 30, 2013 @06:19AM (#5631276)
YES. Many times. It has allowed us not to mess up App Store builds.

I have worked on two UI-heavy iOS apps, and code reviews are very effective in comparison to the automated testing we have. github & bitbucket make it easy see a linear stream of commits and discuss individual lines.

This all falls apart when a programmer takes a day to implement a feature, and then pushes it along with a merge commit that can only be reviewed by manual diffing on the command line (and I have found regressions that way).

Re:Please use git pull --rebase by ricardobeat on Monday April 29, 2013 @11:42PM (#5630302)
Not saved, but it adds up when you have a torrent of "Merge branch master of http://myownrepo.com and merge conflicts every day.
Re:Please use git pull --rebase by khasinski on Tuesday April 30, 2013 @08:39AM (#5631755)
Yes, I did. If you're using continuous delivery or at least continuous integration system you can revert the build, bisect easily the history in a matter of minutes (for a use case missed by all the tests) and have a feature release saved. :)