janestreet / janestreet/patdiff

Diff is not inlined for minor changes

Open
#17 2 comments 0 reactions 0 assignees View on GitHub
forwarded-to-js-devs
Dominant language
OCaml
Stars
252
Forks
21
PR merge metrics
No merged PRs in 30d

Description

If I have the following files:

`simplex`

x

`simplexp`

x'

I'll have the following output

```
❯ patdiff diff/simplex diff/simplexp
------ diff/simplex
++++++ diff/simplexp
@|-1,1 +1,1 ============================================================
-|x
+|x'
```

Whereas if my files are:

`simplex`

x

`simplexp`

(x)

I'll have the following output:

```
❯ patdiff diff/simplex diff/simplexp
------ diff/simplex
++++++ diff/simplexp
@|-1,1 +1,1 ============================================================
!|(x)
```

Is there a way to have the same output when adding a prime as it is when surrounding with parentheses?

Contributor guide

Open the contributing guide

Research direction

Reproduce the two examples with `patdiff diff/simplex diff/simplexp`, comparing the `x` to `x'` case with the `x` to `(x)` case. Trace the diff-rendering entry point responsible for deciding between `-`, `+`, and `!` output; done means minor changes such as adding a prime produce the same inline-style output as the parenthesized example.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.