> you have remove all your harness, TODOs and others just to commit and then add it back again
No, you don't. You can split. You can untrack. You can change your auto-track configuration. There are many ways to deal with this other than having to remove them. You can be equally deliberate about what goes into your final commit.
`git add -e` your files as you are satisfied (of course after remove your debug harness). this way you debug harness stays put in your sandbox/worktree and no harness leaks into your project which remains pristine. this is something that .gitignore cannot do. jj cannot. you have remove all your harness, TODOs and others just to commit and then add it back again. that just means your version control failed.
and no, i am not advocating you should no add .gitignore.