Comment by dizzant

Comment by dizzant 20 hours ago

7 replies

Thank you for the many tool links! You seems to know this space well. I have come to pick your brain for more.

I have been searching for a while for good tools to split/regroup diffs in a patch series. hunk.nvim looks interesting. Do you know of similar/competing tools?

I frequently hit a problem where removing a spurious hunk from an old commit causes cascading conflicts in all subsequent commits. Are there tools to propagate hunk removal into the future without the manual conflict-resolution pain?

Thanks again!

muti 15 hours ago

Are you looking for solutions within git or jj?

In my experience with jj when resolving a conflict, as long as I do it in the earliest change, I will only have to do it once.

Git has the rerere setting [0] which reduces the need to resolve the same conflict over and over

0: https://git-scm.com/book/en/v2/Git-Tools-Rerere

wredcoll 12 hours ago

I can't help with your actual problem but I am incredibly curious about how/why you run into this so frequently you need a tool for it. I feel like in my 15 or whatever years of using git I have basically never wanted to remove a hunk from an old commit or anything similar.

  • __float 12 hours ago

    I try to leave a good commit trail in my PRs. These are often _not_ the reality of how the code was written and originally committed, but a rough approximation of the intended steps with the benefit of hindsight.

    A tool like https://github.com/tummychow/git-absorb has been on my to-try list for a while, but for now I do it by hand.

    • greenicon 3 hours ago

      git absorb works surprisingly well. I was quite skeptical in the beginning, but it really turned into something I used daily (until I switched to jj, where I haven't found a replacement yet). If you use stepwise commits I can really recommend it.

      small edit: It seems that jj supports `jj absorb` now as well. Wonderful!

stavros 19 hours ago

Not the GP, but I might recommend Jujutsu for that, try it and see. It does the right thing when you resolve commits, and it propagates them to git. However, I'm not sure if it'll work, try it and see.