Is it possible to bind commits to each other to make them atomic in terms of bisect, cherry-pick, revert, etc?

前端 未结 2 2010
时光取名叫无心
时光取名叫无心 2021-02-13 09:50

Consider the case of a bug fix which causes a small change in the expected output, forcing a minor change in the test suite. It is extremely convenient to have both changes in

2条回答
  •  再見小時候
    2021-02-13 10:32

    Definitively keep those changes (code and unit test) as one commit: SCM is also about being able to reproduce a given state, and that include both the program and its tests.

    If you need to review only code changes, do a git diff on src only, not on tst.
    Since those linked changes remain in one commit, you avoid the bisect issue entirely.

    In short, keep it simple ;)

提交回复
热议问题