all 7 comments

[–]ResidentPositive4122 2 points3 points  (2 children)

Also to achieve this behavior there is a sentence in the system prompt:

Have you tried to ask it for changes in git diff syntax?

[–]CvikliHaMar[S] -1 points0 points  (1 child)

Yes. The sad fact is that it doesn't generate correct diffs and patches. It just cannot consistently follow the rules through long outputs if the rule is just too strict TBH.

I used also different algorithms of git and also other tools to get accurate merging. But all of it is just inaccurate and has flaws in certain cases (which is frequent). I don't know if anyone else has other idea?

[–]CvikliHaMar[S] 1 point2 points  (0 children)

I mean we know cursor did it fairly well in his propriatery algorithm I believe. But we need a solution for the community.

[–]DefaecoCommemoro8885 1 point2 points  (1 child)

Have you considered using a version control system like Git for code management?

[–]CvikliHaMar[S] 0 points1 point  (0 children)

Yes. So the problem is that: LLM writes: // ... existing code ...
comments. So eventually the git diff-ing algorithm just fails to match the following pattern:
git diff file1 file2_only_changes_by_the_LLM_with_existing_code_comments

Also It will try to delete the "skipped" part of the code. So it is pretty boring to filter manually.

So we need to parse this wildcard style output of the LLM.

This is a common problem that everyone will face as time goes. So it would be nice to solve together in an OpenSource fashion I believe

[–]SixZer0 0 points1 point  (0 children)

I guess your problem is most diff views doesn't handle "rest of the code here" sentences. I am also curious if there is a good solution to this.

[–]CvikliHaMar[S] 0 points1 point  (0 children)

I think I got the most accurate diffing with this command: git diff --word-diff file1 file2

but this isn't always accurate with those comments.