Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unified diff format #118

Merged
merged 7 commits into from
Oct 7, 2023
Merged

Add unified diff format #118

merged 7 commits into from
Oct 7, 2023

Conversation

PCSwingle
Copy link
Member

@PCSwingle PCSwingle commented Sep 29, 2023

Adds a unified diff format similar to git diff

TODO:

  • BUG: Empty delimiters for deletions (and renames with no changes) Because of the nature of this format, it would be pretty difficult to fix this (especially renames); if we ever end up making this the primary format, we can work on fixing it, but until then it would overcomplicate things to bother
  • Fix tests (since format changed recently)
  • Test out adding a/ and b/ for filenames, adding git --diff a/ b/ line, and adding double set of @@ (maybe with end between them for the final one?) in order to more closely match the git diff format This will be a lot easier to test out once we have GPT automatically telling us why it's failing on benchmarks; postponing this until after we get that done.

Copy link
Member

@biobootloader biobootloader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you list the current ways this differs from git diffs?

How is it performing?

+++ <file_name>
This means that you will be editing old_file_name in the next section of the edit.
Just like a git diff, to rename a file, put a different name in the +++ section from the --- section; to create a file, put --- /dev/null; and to delete a file, put +++ /dev/null.
Unlike a git diff, when deleting a file, there is no need to print the removed lines.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it listen to this well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes actually!

@PCSwingle
Copy link
Member Author

Could you list the current ways this differs from git diffs?

How is it performing?

The things I want to try out that would make it more similar to an actual git diff are adding a/ and b/ before the filenames, adding a git --diff a/file_name b/file_name line, and using a @@ @@ symbol between changes (which normally indicates the line numbers in a weird format)

I haven't actually used it too much; I mainly want to get this merged to stop conflicts, since tweaking the prompt won't cause any conflicts. I'm planning on tweaking the prompt later, and once I get it to be good I'll use the benchmarks with GPT's evaluation to determine if I should add the more git diff-like things above

Copy link
Member

@biobootloader biobootloader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging but when we run benchmarks lets try variations on it

@biobootloader biobootloader merged commit c4728f3 into main Oct 7, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants