Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How do you end up handling line numbers in patches? Counting has always been a sticking point for LLMs.


I wrote a custom `applyPatch` function that tries to use the line numbers, but falls back to searching for the context lines to line up the +/- patched lines.

It actually got line number not too wrong, and so they might have been helpful. (I included the line numbers for the original file in context).

Ultimately though, this approach was still error prone enough that we recently switched away.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: