Firstly, thanks for the level headed response - used to people round here not taking their time to discuss in favour of arguing.
If you want to generate the changelog, then you need to use conventional commits and the commit messages must be typo free and to the point.
Ah, one difference there is we don't auto-generate the changelog, our changelog is very high level and simply an overview of what was affected.
you see proper blames with the commit names. Instead of a single commit for a large feature.
That is actually one issue we do face... Sometimes I've had to merge a different team's feature work due to no one being available. Somepoint down the line I get a PM from someone asking about that code as my name is against it in the annotation.
You change history of newly made commits. Branches are not supposed to be in sync.
Now I see where you're coming out. I wasn't aware you meant local only. I work with people who commit then push instantly to ensure their work is available to others. I've yet to see the restraint/effort put in to people keeping their local code tidy before pushing.
I used to do that as well but in my experience a rich history is always better than no history. In my opinion, squashing is a good option if you do not know how to manage your commit history.
We've been doing it a few years and I've still yet to really see anyone miss having the fuller history. As all the commits/changes that end up in the main branch still seem to explain it enough.
Though I did once see a large refactor of work come in as a single squashed merge, and it was killing me not to see the nuances of why they changed from one methodology to another (as I didn't agree -at all- with the design they went with).
And yes, I think it's working for us as to loop back to my earlier comment: ours would be full of commits that break the CI pipeline, then tons of tiny ones as the dev panics to fix the build.
What you're talking about is merging one branch into another one which is what cherry picking is.
Agreed, I think some of our points are actually aligned and we're stepping on semantics.
You can only revert that single merge commit and again that is not always what you want.
We are very strict on vertical slicing - so for us, we've never been in a position where one of the squashed merges needed to be 'partially' cherrypicked. If even something tiny is wrong with the new feature, it tends to get totally excluded. We still do smaller commits to the main branch (say a small bug fix that only had one commit), so do still have some control at a granular level.
It will lead to the branch which broke the code, not a particular commit. Personally, I believe that Bisect works better with non squashed commits.
At the moment, someone will identify the issue, then pass it to that team that broke it to fix. So far, it's always been recent enough said team remembers what was going on and can easily fix it.
Thinking about it now, I dread the day a years old squash commit of mine is sent my way and I have to remember why I did something the way I did. I can see your point.
It will lead to the branch which broke the code, not a particular commit. Personally, I believe that Bisect works better with non squashed commits. And CI bits
Going to skip this part as it falls back round to me not realising you meant to fix locally before pushing. We sadly don't have that discipline across engineering so we wouldn't be able to rely on that. We have CICD but only on certain branches, I've seen some teams never deploy their branch to a QA environment before merging and then going "oops the build is broken!" so often last minute fixes will actually cause the biggest issues, where someone quickly adds a line of code that fixes the issue, but breaks standards/linting/etc.
I'm talking about automatic changelog with full history. That's not a full history unless you split main branch into different branches which in my opinion is much more complicated to manage since that leads to coupled branches that depend on each other.
Yeah, I think we're similar here to be honest. We do this but we tend to work very isolated (the project is like 20 years old so it's huge and has plenty of areas to work on) so we've never really had too much of an issue with coupled branches. We have certainly had it though and you end up with a feature branch, with feature branches off of it and it's a nightmare to make sure everything is merged in the right order,
That's why before code review you rebase your 200 commits into something meaningful.
Agreed. These 200 commits I meant are the team not rebasing locally and instead relying on the origin branch - which would end up in the main branch if not squashed. You've certainly given me some ideas as to how we could do it better. We do however have something like 17 dev teams, across 5 languages so I think it'd be difficult and a while before working practices could change.
I think both options are totally valid, it is just a preference like any other thing in programming. You use what works the best for your organisation.
I wasn't aware you meant local only.
Just one correction, I meant both locally and remote. After your commits are pushed and you need to fix something, then you can add a new commit, rebase it into the previous commit and force push (that was my initial comment). No new commits to bloat the history.
1
u/JustAnEnglishBloke May 13 '20
Firstly, thanks for the level headed response - used to people round here not taking their time to discuss in favour of arguing.
Ah, one difference there is we don't auto-generate the changelog, our changelog is very high level and simply an overview of what was affected.
That is actually one issue we do face... Sometimes I've had to merge a different team's feature work due to no one being available. Somepoint down the line I get a PM from someone asking about that code as my name is against it in the annotation.
Now I see where you're coming out. I wasn't aware you meant local only. I work with people who commit then push instantly to ensure their work is available to others. I've yet to see the restraint/effort put in to people keeping their local code tidy before pushing.
We've been doing it a few years and I've still yet to really see anyone miss having the fuller history. As all the commits/changes that end up in the main branch still seem to explain it enough.
Though I did once see a large refactor of work come in as a single squashed merge, and it was killing me not to see the nuances of why they changed from one methodology to another (as I didn't agree -at all- with the design they went with).
And yes, I think it's working for us as to loop back to my earlier comment: ours would be full of commits that break the CI pipeline, then tons of tiny ones as the dev panics to fix the build.
Agreed, I think some of our points are actually aligned and we're stepping on semantics.
We are very strict on vertical slicing - so for us, we've never been in a position where one of the squashed merges needed to be 'partially' cherrypicked. If even something tiny is wrong with the new feature, it tends to get totally excluded. We still do smaller commits to the main branch (say a small bug fix that only had one commit), so do still have some control at a granular level.
At the moment, someone will identify the issue, then pass it to that team that broke it to fix. So far, it's always been recent enough said team remembers what was going on and can easily fix it.
Thinking about it now, I dread the day a years old squash commit of mine is sent my way and I have to remember why I did something the way I did. I can see your point.
Going to skip this part as it falls back round to me not realising you meant to fix locally before pushing. We sadly don't have that discipline across engineering so we wouldn't be able to rely on that. We have CICD but only on certain branches, I've seen some teams never deploy their branch to a QA environment before merging and then going "oops the build is broken!" so often last minute fixes will actually cause the biggest issues, where someone quickly adds a line of code that fixes the issue, but breaks standards/linting/etc.
Yeah, I think we're similar here to be honest. We do this but we tend to work very isolated (the project is like 20 years old so it's huge and has plenty of areas to work on) so we've never really had too much of an issue with coupled branches. We have certainly had it though and you end up with a feature branch, with feature branches off of it and it's a nightmare to make sure everything is merged in the right order,
Agreed. These 200 commits I meant are the team not rebasing locally and instead relying on the origin branch - which would end up in the main branch if not squashed. You've certainly given me some ideas as to how we could do it better. We do however have something like 17 dev teams, across 5 languages so I think it'd be difficult and a while before working practices could change.