unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.81k stars 271 forks source link

consider making merge process more stateful? / better output? #5456

Open aryairani opened 6 days ago

aryairani commented 6 days ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.

Currently the mergetool process starts off like this:

@cloud/nimbus/dogfooding-12> merge /dogfooding-2                               

  I couldn't automatically merge @cloud/nimbus/dogfooding-2 into @cloud/nimbus/dogfooding-12, so
  I'm running your UCM_MERGETOOL environment variable as

    osascript -e 'tell app "Terminal" to do script "cd /Users/arya/work/unison/trunk;/Applications/IntelliJ\\ IDEA\\ CE.app/Contents/MacOS/idea merge \"/private/var/folders/rr/tdb_8nr96xl2v4t8n2f2x40w0000gn/T/unison-merge-879f756f9760c24b/dogfooding-12.u\" \"/private/var/folders/rr/tdb_8nr96xl2v4t8n2f2x40w0000gn/T/unison-merge-879f756f9760c24b/dogfooding-2.u\" \"/private/var/folders/rr/tdb_8nr96xl2v4t8n2f2x40w0000gn/T/unison-merge-879f756f9760c24b/dogfooding-12-dogfooding-2-base.u\" \"dogfooding-12-dogfooding-2-merged.u\""'

  When you're done, you can run

    merge.commit

  to merge your changes back into dogfooding-12 and delete the temporary branch. Or, if you decide
  to cancel the merge instead, you can run

    delete.branch /merge-dogfooding-2-into-dogfooding-12

  to delete the temporary branch and switch back to dogfooding-12.

  Loading changes detected in ~/work/unison/trunk/dogfooding-12-dogfooding-2-merged.u.

  I got confused here:

     86 | <<<<<<< dogfooding-12

  I was surprised to find a <<<<<<< here.
  I was expecting one of these instead:

  * bang
  * binding
  * do
  * false
  * force
  * handle
  * if
  * lambda
  * let
  * quote
  * termLink
  * true
  * tuple
  * typeLink

Describe the solution you'd like I think the best would be to detect the merge conflict markers in the parser, and output a message saying how many conflicts are left in the file, instead of trying to typecheck.

Next best might be to skip the initial load of merged.u which is just going to be a massive red error.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.