feature: current branch shorthand in transcripts
Is your feature request related to a problem? Please describe.
When I'm writing transcripts, typing .> at the start of each line was NBD, but typing scratch/main> at the start of each line is tedious and error-prone.
Describe the solution you'd like
-
>defaults to the "current branch", which isscratch/maininitially, but can be altered by other commands. the actual branch is shown in the output.md -
/branchorproj/branch>implicitly creates-empty and switches to/branchorproj/branchrespectively; (this rule can be kept or we can get rid of it) -
>or/branchorproject/branch>alone on a line is valid; the current branch or specified branch is shown in the output.md as well; (this is also optional, we could require explicit use ofswitch, but not clear why we would want to)
e.g.
Input:
```ucm
> ls
> branch.create foo
>
/bar>
other/other>
```
Output:
```ucm
scratch/main> ls
nothing to show
scratch/main> branch.create foo
Done. I've created the foo branch based off of main.
Tip: To merge your work back into the main branch, first `switch /main` then `merge /foo`.
scratch/foo>
scratch/bar>
other/other>
```
- Currently we suppress the normal implicit branch creation output, but we could decide to include it in the output
Describe alternatives you've considered I considered typing it once and copy/pasting, but it's still annoying and also not really practical to dedicate the system clipboard to this purpose while editing transcripts.
Additional context
I can try and see if Copilot is good enough. Result: it does sort of work, but is also annoying.
There is some discussion (which I think probably should be linked to in Additional context) in #5173 in which @mitchellwrosen and I speculate that this short-hand wouldn't hold its weight.
@ceedubs I don't understand if you have an opposition to the feature request? However, I apologize for cluttering/distracting the other ticket with it.
@aryairani right I am slightly opposed. In addition to the reasons listed in the other ticket, I fear it could mask issues. Like imagine that there was a regression and branch.create stopped automatically switching you to the new branch. I think that it would be better for our transcripts to explicitly specify that a certain branch is expected than to use the current branch which might not be the one that we intend.
Maybe it would be fine and I could just avoid using the shorthand if I don't trust myself to use it responsibly. But to me the additional complexity and potential for mistakes doesn't seem worth the benefit.
Ah okay. Just to clarify, the there's never been a way to test that branch.create automatically switches you to the new branch, just like there has never been a way to test that cd would actually switch you to the specified namespace, because the next "prompt" in the input transcript overrides the current branch/namespace.
By leaving the prompt unspecified in the input, this proposed shorthand feature would give us the ability to test that for the first time.
@aryairani right I should clarify that I'm not comparing to the current state but to the proposal in #5173.
I see, I had missed that.