How to break git series commits patches for sending to another project

So, I fought off my favorite open source project for quite some time, and this is the time to send bug fixes. I have to more or less completely regroup my commits and hopefully extract some pieces of code that can function as separate patches to avoid code bombing . Currently, I usually do something like this:

  • rebase / squash all to one commit, since old ones often do not make sense as patches
  • undo that commit
  • start adding things that I think are suitable for a single commit using add / add -i
  • commit
  • the rest is the rest
  • verify that commit
  • repeat the application and start with 3 until all are taken into account

It works, but is there a better way?

+3
source share
1 answer

If the current (unsquashed) commits have nothing to do with the patches you want to receive, just keep doing as per your pattern.

Personally, I would create a "for-upstream" branch and cherry pick some commits there (and split or edit them if necessary), but this requires similar resources, for example, using your path.

+2
source

Source: https://habr.com/ru/post/1749085/


All Articles