if you use something like Gerrit to manage your Git repositories (which I recommend
Fuck. That.
Gerrit is a pain to use. It takes the normal flow of Git and breaks it completely. It takes the feature Git made easy to use -- branches -- and completely ignores it. It turns branches with several commits into commits that keep absolutely no history ("Why would I describe something when there is only a single commit message.").
So far, no one managed to explain to me, in convincing terms, what Gerrit is trying to solve. The only thing I can see is "when I merge, it floods the target branch with commits", which isn't actually a problem if you do a "--squash". One "manager" here tried to explain that they switched to Gerrit to get rid of a project that had 1000s branches. Really? I don't think he realized they just changed the problem of dealing with 1000s branches to a problem of dealing with 1000s commits not merged. So it turned a tool that there is plenty documentation, there is a very well known flow into something that reduces Git into SVN.
You can't directly merge with Gerrit. You need to pick the base commit/branch (if it's "develop") and cherry pick your commit on top of it; you need a special hook around otherwise Gerrit won't work properly. Reverting changes creates a new "branch" (commit), even if you're still dealing with the same "subject".
Gerrit is even more harmful than GitFlow. You lose all the knowledge your team already has about the tool -- and general version control flow --, you lose all the history you had during development due having a single commit for everything in that "branch", and you have to train everybody to use a tool in a non-standard way in which all available documentation about it is invalid.
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.
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?"
You use rebase to retain the same number of commits but avoid having merge cruft when it isn't necessary which makes the history easier for a mere human to figure out.
You use rebase -i to get rid of "Oops fix comment" ''Oops fix indentation" "Oops fix small name" and put all these small fixups into the change that they are associated with, which keeps the history cleaner.
You use rebase -i to get rid of "Oops fix comment" ''Oops fix indentation" "Oops fix small name" and put all these small fixups into the change that they are associated with, which keeps the history cleaner.
I don't understand. What intrinsic value does a "clean history" have? And if somebody actually did "fix comment" or "fix indentation", isn't the record of that meaningful?
I know that when I'm audited (we're in medical software), I'd far prefer to have a complete history showing all of our changes. I want to see when feature branches were merged into dev, and when dev is merged to master. Having a linear history destroys that transparency, and I literally do not see a benefit.
You can consider your history to be another form of documentation. It's a way of looking back at the thought process past developers went through to solve a problem. That's why it's beneficial to keep your history organized and "clean."
Ah. Yeah, I have actual design documentation for that. We only use edit logs when audited.
Also, I don't believe that anybody looks at edit logs as documentation. They provide a history, true; but you'd have to read the whole thing from the beginning to the end to understand the current state of the system. So while somebody could read the logs and discover something about the "thought process [of] past developers", nobody ever will. It's clumsy at best.
If no one reads the git log, what's the harm in squashing small commits together? You don't lose the change history, just the separate commit messages that you don't think people will read.
67
u/juliob Jun 19 '15 edited Jun 19 '15
Fuck. That.
Gerrit is a pain to use. It takes the normal flow of Git and breaks it completely. It takes the feature Git made easy to use -- branches -- and completely ignores it. It turns branches with several commits into commits that keep absolutely no history ("Why would I describe something when there is only a single commit message.").
So far, no one managed to explain to me, in convincing terms, what Gerrit is trying to solve. The only thing I can see is "when I merge, it floods the target branch with commits", which isn't actually a problem if you do a "--squash". One "manager" here tried to explain that they switched to Gerrit to get rid of a project that had 1000s branches. Really? I don't think he realized they just changed the problem of dealing with 1000s branches to a problem of dealing with 1000s commits not merged. So it turned a tool that there is plenty documentation, there is a very well known flow into something that reduces Git into SVN.
You can't directly merge with Gerrit. You need to pick the base commit/branch (if it's "develop") and cherry pick your commit on top of it; you need a special hook around otherwise Gerrit won't work properly. Reverting changes creates a new "branch" (commit), even if you're still dealing with the same "subject".
Gerrit is even more harmful than GitFlow. You lose all the knowledge your team already has about the tool -- and general version control flow --, you lose all the history you had during development due having a single commit for everything in that "branch", and you have to train everybody to use a tool in a non-standard way in which all available documentation about it is invalid.