dzurikmiroslav / esp32-evse

ESP32 EVSE firmware
GNU General Public License v3.0
79 stars 30 forks source link

Another effort to reduce the complexity of evse.c #64

Closed taliesin closed 2 months ago

taliesin commented 2 months ago

I tried to reduce evse_process() to as small as possible in order to keep the actual change for the phase switching as consistent as possible. I've tried to make consistent change sets.

taliesin commented 2 months ago

I think it would be better not to squash the commits when merging the pull request. This will make bi-secting a lot harder if a bug shows up.

dzurikmiroslav commented 2 months ago

Ok i'll think about it. Squash commit was default github option...

taliesin commented 2 months ago

Thx for merging.

I just updated to your latest changes. Concerning your merge I'd like you to consider rebasing your own changes to an updated master after you integrate a pull request. Currently this creates a non-fast-forward merge which again will hinder bisecting efforts.

Screenshot from 2024-09-12 21-29-32

Don't want to be a smart-ass, but you just added a PULL_REQUEST_TEMPLATE.md which exactly states that :)

dzurikmiroslav commented 2 months ago

I don't even know exactly how I managed to merge :D In PULL_REQUEST_TEMPLATE.md I wanted to mention that the code must be formatted to pass CI.

taliesin commented 2 months ago

Ok, no problem. The main topic is how to create fast forward merges, i.e. merges that to do not create parallel lines in your history. The way to go is 'rebasing', there is a nice tutorial on git rebase here https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase

Long story short, the usual git way is:

Take care: rebasing changes the history of your commits, this may (and most probably will) create conflicts, if you change already changed files. This is a great way to kill your commits :-) I usually create a backup branch before I rebase, git checkout feature/my_cool_feature; git checkout -b rebase_backup. This way you have a backup if you completely mess up your rebasing.

VS code offers a nice GUI (Gitlens) that also allows a guided rebasing mechanism. I'm more the command line gui, though. I recommend you test your rebasing capabilities on a non-production-repo, by simply creating 2 separate test feature branches and trying to merge them (including conflicts) in a fast forward way.