unisonweb / unison

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

allow branch.create to accept source hash #5363

Open ceedubs opened 2 months ago

ceedubs commented 2 months ago

Is your feature request related to a problem? Please describe.

I want to quickly create a branch from a point in history.

I tried @ceedubs/exists/main> branch #oou75lskn1 testing. It didn't work and the output doesn't really make any sense to me:

@ceedubs/exists/main> branch #oou75lskn1 testing                                                                                                                                                                                              

  ⚠️                                b

  Sorry, I wasn’t sure how to process your request:

    #oou75lskn1
    ^-- This is where I gave up.                                                                                                                                                                                                              

    I expected ''/''''@'''"releases/"''"releases/drafts/"' and I found "#oou75lskn1".                                  

  You can run `help branch` for more information on using `branch`.                  

I was able to work around it by first running branch testing and then reset #oou75lskn1.

Describe the solution you'd like

I would like to be able to run branch #oou75lskn1 testing or branch.create #oou75lskn1 testing to create a testing branch off of #oou75lskn1.

And then the logical next step would be to allow branch 3 testing to do the same if 3 is the numbered arg corresponding to #oou75lskn1 from a previous history command.

aryairani commented 2 months ago

Yeah this is good.

I was able to work around it by first running branch testing and then reset #oou75lskn1.

Just highlighting the workaround here in case anyone needs it.