unison/unison-src/transcripts/reset.output.md
2024-07-11 09:49:55 -07:00

3.0 KiB

def = "first value"

  Loading changes detected in scratch.u.

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:
  
    ⍟ These new definitions are ok to `add`:
    
      def : Text

def = "second value"

Can reset to a value from history by number.

scratch/main> update

  Okay, I'm searching the branch for code that needs to be
  updated...

  Done.

scratch/main> history

  Note: The most recent namespace hash is immediately below this
        message.
  
  ⊙ 1. #5vq851j3hg
  
    + Adds / updates:
    
      def
  
  ⊙ 2. #ujvq6e87kp
  
    + Adds / updates:
    
      def
  
  □ 3. #4bigcpnl7t (start of history)

scratch/main> reset 2

  Done.

scratch/main> view def

  def : Text
  def = "first value"

scratch/main> history

  Note: The most recent namespace hash is immediately below this
        message.
  
  ⊙ 1. #ujvq6e87kp
  
    + Adds / updates:
    
      def
  
  □ 2. #4bigcpnl7t (start of history)

Can reset to a value from reflog by number.

scratch/main> reflog

  Below is a record of recent changes, you can use
  `reset #abcdef` to reset the current branch to a previous
  state.
  
  Tip: Use `diff.namespace 1 7` to compare between points in
       history.
  
       Branch         Hash          Description
  1.   scratch/main   #ujvq6e87kp   reset ujvq6e87kp4288eq3al9v5luctic0ocd7ug1fu0go5bicrr2vfnrb0...
  2.   scratch/main   #5vq851j3hg   update
  3.   scratch/main   #ujvq6e87kp   update
  4.   scratch/main   #4bigcpnl7t   builtins.merge
  5.   scratch/main   #sg60bvjo91   Project Created

-- Reset the current branch to the first history element
scratch/main> reset 2

  Done.

scratch/main> view def

  def : Text
  def = "second value"

scratch/main> history

  Note: The most recent namespace hash is immediately below this
        message.
  
  ⊙ 1. #5vq851j3hg
  
    + Adds / updates:
    
      def
  
  ⊙ 2. #ujvq6e87kp
  
    + Adds / updates:
    
      def
  
  □ 3. #4bigcpnl7t (start of history)

reset branch

foo/main> history

  Note: The most recent namespace hash is immediately below this
        message.
  
  
  
  □ 1. #sg60bvjo91 (start of history)

a = 5
foo/main> update

  Okay, I'm searching the branch for code that needs to be
  updated...

  Done.

foo/empty> reset /main:

  Done.

foo/empty> view a

  a : ##Nat
  a = 5

foo/empty> history

  Note: The most recent namespace hash is immediately below this
        message.
  
  
  
  □ 1. #5l94rduvel (start of history)

second argument is always interpreted as a branch

main.a = 3
foo/main> update

  Okay, I'm searching the branch for code that needs to be
  updated...

  Done.

foo/main> history

  Note: The most recent namespace hash is immediately below this
        message.
  
  ⊙ 1. #0i64kpfccl
  
    + Adds / updates:
    
      main.a
  
  □ 2. #5l94rduvel (start of history)

foo/main> reset 2 main

  Done.