unison/unison-src/transcripts/diff.md

4.7 KiB

Things we want to test:

  • Diffing identical namespaces
  • Adds, removes, updates (with and without metadata updates)
    • Adds with multiple names
    • Adds with multiple names and different metadata on each
  • Moved and copied definitions
    • Moves that have more that 1 initial or final name
  • ... terms and types
  • New patches, modified patches, deleted patches, moved patches
  • With and without propagated updates
fromJust = 1
b = 2
bdependent = b
c = 3
helloWorld = '(printLine "Hello, world!")

type A a = A Nat
ability X a1 a2 where x : Nat
.ns1> add
.ns1> alias.term fromJust fromJust'
.ns1> alias.term helloWorld helloWorld2
.ns1> link fromJust b
.ns1> fork .ns1 .ns2
.ns1> cd .

Here's what we've done so far:

.> diff.namespace nothing ns1
.> diff.namespace ns1 ns2
fromJust = "asldkfjasldkfj"
.ns1b> add
.> merge ns1b ns1
fromJust = 99
b = "oog"
d = 4
e = 5
f = 6
unique type Y a b = Y a b
.ns2> update
.ns2> links fromJust
.> diff.namespace ns1 ns2
.> alias.term ns2.d ns2.d'
.> alias.type ns2.A ns2.A'
.> alias.type ns2.X ns2.X'
.> diff.namespace ns1 ns2
.> link ns2.f ns1.c
.> link ns2.c ns2.c
.> diff.namespace ns1 ns2
.> unlink ns2.fromJust ns2.b
.> diff.namespace ns1 ns2
.> alias.type ns1.X ns1.X2
.> alias.type ns2.A' ns2.A''
.> view.patch ns2.patch
.> fork ns2 ns3
.> alias.term ns2.fromJust' ns2.yoohoo
.> delete.term ns2.fromJust'
.> diff.namespace ns3 ns2

Updates: -- 1 to 1

New name conflicts: -- updates where RHS has multiple hashes (excluding when RHS=LHS)

  1. foo#jk19sm5bf8 : Nat - do we want to force a hashqualified? Arya thinks so ↓
  2. ┌ foo#0ja1qfpej6 : Nat
  3. └ foo#jk19sm5bf8 : Nat

Resolved name conflicts: -- updates where LHS had multiple hashes and RHS has one

  1. ┌ bar#0ja1qfpej6 : Nat
  2. └ bar#jk19sm5bf8 : Nat
  3. bar#jk19sm5bf8 : Nat

Display issues to fixup

  • check whether creating a name conflict + adding metadata puts the update in both categories; if it does, then filter out metadataUpdates from the other categories

  • just handle deletion of isPropagated in propagate function, leave HandleInput alone (assuming this does the trick)

  • if a name is updated to a not-yet-named reference, it's shown as both an update and an add

  • similarly, if a conflicted name is resolved by deleting the last name to a reference, I (arya) suspect it will show up as a Remove

  • might want unqualified names to be qualified sometimes:

    .a> merge .b

    Updates:
    
      1. foo : Nat  - here?
         ↓
      2. ┌ foo#0ja1qfpej6 : Nat
      3. └ foo#jk19sm5bf8 : Nat
    
    Adds:
    
      4. foo#0ja1qfpej6 : Nat
    

    maybe if all of the old (n,r) are still present, but some new (n,r') has been added, just show it under adds:

    Adds:
    
      1. foo#0ja1qfpej6 : Nat  -- and the hash indicates that it has become conflicted?
    
  • Do we want to surface new edit conflicts in patches?

  • incorrectly calculated bracket alignment on hashqualified "Name changes" (delete.output.md)

    Original Changes 4. example.resolve.a.foo ┐ 5. example.resolve.c.foo#jdqoenu794 (removed) 6. example.resolve.c.foo#jdqoenu794 ┘

  • two different auto-propagated changes creating a name conflict should show up somewhere besides the auto-propagate count

  • Things look screwy when the type signature doesn't fit and has to get broken up into multiple lines. Maybe just disallow that?

  • Delete blank line in between copies / renames entries if all entries are 1 to 1 see todo in the code

  • Maybe group and/or add headings to the types, constructors, terms

  • add tagging of propagated updates to test propagated updates output

  • missing old names in deletion ppe (delete.output.md) (superseded by #1143)

  • delete.term has some bonkers output

  • Make a decision about how we want to show constructors in the diff

  • When you delete a name with metadata, it also shows up in updates section with the deleted metadata.

  • An add with new metadata is getting characterized as an update

  • can there be a metadata-only update where it's not a singleton old and new reference

  • 12.patch patch needs a space

  • This looks like garbage

  • Extra 2 blank lines at the end of the add section

  • Fix alignment issues with buildTable, convert to column3M (to be written)

  • adding an alias is showing up as an Add and a Copy; should just show as Copy

  • removing one of multiple aliases appears in removes + moves + copies section

  • some overlapping cases between Moves and Copies^

  • Maybe don't list the type signature twice for aliases?