janestreet / janestreet/patdiff

Miscalculated diff

Open
#19 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

forwarded-to-js-devs
Dominant language
OCaml
Stars
252
Forks
21
PR merge metrics
No merged PRs in 30d

Description

With the two following files:

`notmp`

x: int
y: int

`tmp`

x: int
y: int
tmp: int

patdiff is able to compute the proper diff:

![image](https://user-images.githubusercontent.com/5543639/166714466-112402fe-de31-463a-919d-bf1152175348.png)

But if I put punctuation in it:

`notmp`

x: int
y: int

`tmp`

x: int;
y: int;
tmp: int

The calculated diff doesn't seem to be the optimal one:

![image](https://user-images.githubusercontent.com/5543639/166714620-02ca49b1-deda-430a-bb93-4168f3d4ebe7.png)

Is this the expected behaviour?

Since this is my third issue, thanks for the package btw, sorry for the spam!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by running patdiff on the two file pairs shown in the report, with and without punctuation. Compare the generated diffs and inspect the diff algorithm's handling of punctuation to determine whether the behavior is expected. Done means the behavior is clarified and, if incorrect, covered by a regression case with the expected diff.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.