Gerrit is the worst, and I'm surprised that someone who cares about Git history would bring it up.
Gerrit encourages you to make giant commits (since each commit becomes a separate code review), and if you have Gerrit tied to your CI and it fails for some reason, or your code reviewer asks you to make changes, new updates are supposed to be amended to the old commit, so the history of what you changed is lost.
I have never used the rebase command. Every time I ask about it, somebody explains it's used to clean up your edit history so you don't have long logs. And every time, "Isn't that record the whole fucking point of using git?"
Apparently, people use git because it's "cool"... but they really want it to act like SVN.
If you branch from master, make a bunch of commits, then see you're several commits behind master(others pushing their commits to master), when you go to merge back in, a merge commit is created. Instead if you rebase master, it is putting your commits aside, fast forwarding your branch to latest master, then re applying your commits one by one. Tucking your code, history, and commit messages all as they were, but neatly into the latest version of the history. You can then merge this into master which will "fast forward" the branch, rather than cause a merge commit, allowing others to see what you did, with out a merge commit to gunk up history.
You really should understand what rebase does before you criticize people for using it out of ignorance.
I've just never in my life said, "Man, the quality of this software would be so much higher if only there weren't so many merge commits all over the place."
I understand for some people that the aesthetics of rarely-used metadata is very important. I'm just providing a counterpoint: I don't care what my log looks like, so long as it 100% describes the history of the project. rebase appears to destroy history, so I don't like it.
rebase appears to destroy history, so I don't like it.
Pretty sure you don't understand what it does.
Also, this has nothing to do with quality of the software itself, or quality of the code base, but rather, quality of development efforts. When you want to get ahold of the guy responsible for changing a line of code, git blame is useful, until merge commits come into play, and your name is plastered over someone elses code because they were working at the same time as you on something unrelated to you.
I'd rather just have a clear and correct history, than have a bunch of nonsense that makes history more difficult to read and understand
Apparently not. Although I just re-read the documentation.
Is there an article on using rebase that isn't focused on aesthetics?
If I already have a code review process, a change request process, and requirements documents electronically signed by each dev as he completes the requirement (all of which is required of me by law)... what facilities does rebase provide me, other than give my guys another opportunity to fuck up the central repo?
If rebase doesn't provide features or utility, only fiddles the aesthetics, this is just another tabs-vs-spaces debate. You like it your way because you're used to it. I like it my way because it's what I'm used to.
Wow, i wonder who wrote this line of code, i'll just git blame it
Ohh, Netzapper wrote it, let me talk to him.
VS.
Ohh, I wonder who wrote this line of code, I'll just git blame it, then grep the log to verify it's not a merge commit, if it is, git show the commit, find the parent commits and see which one is to blame for this line of code, then contact Netzapper since he wrote it.
"Wow, I wonder who is responsible for this line of code?" I'll query the requirements database to see which engineer last signed off on this module. Oh, it's giveupitscrazy... well, regardless of whether or not he wrote the code, he owns that module and reviewed it, so he's who I'll call. If he signed off on somebody else's code, it's okay, because he must understand it, or he wouldn't have signed off on it.
When you want to get ahold of the guy responsible for changing a line of code, git blame is useful, until merge commits come into play, and your name is plastered over someone elses code because they were working at the same time as you on something unrelated to you.
This seems to suggest that rebasing is useful as a workaround for bad tools (e.g. blame fingering a merge as the issue instead of the actual original commit). Why not just fix blame and the other bad tools?
understand how to use the tool, and you'll see that both rebase and merge work together for two separate things. It's when people ignore a step or use merge for more than one thing does stuff break.
What job is rebase for, and what job is merge for, then?
The last company I worked at used mercurial with a purely merge-based workflow, and it worked out beautifully.
I've heard some people say that they do a lot of small, short-lived 'micro commits' that don't compile that they don't want to present to their team-mates and clutter up the log. This, too, seems like bad tooling/an incomplete model to me since you should be able to do this by just including some metadata on the commit describing what type of commit it is, and then filter your log by that.
39
u/1_800_UNICORN Jun 19 '15
Gerrit is the worst, and I'm surprised that someone who cares about Git history would bring it up.
Gerrit encourages you to make giant commits (since each commit becomes a separate code review), and if you have Gerrit tied to your CI and it fails for some reason, or your code reviewer asks you to make changes, new updates are supposed to be amended to the old commit, so the history of what you changed is lost.