demos: clarify command for finding operation to undo

The command grepped for 'o ' and picked the third line. That was meant
to match the graph nodes only, but it also matched the 'jj co master'
line. Let's match only 'o' at the beginning of the line, and throw in
another space for good measure (since that's what we get from the new
default graph style from Sapling).
This commit is contained in:
Martin von Zweigbergk 2023-03-12 22:31:40 -07:00 committed by Martin von Zweigbergk
parent 74ffe7f688
commit cb86efac61

View file

@ -30,7 +30,7 @@ is:"
run_command "jj op log --color=always | head" run_command "jj op log --color=always | head"
comment "Let's undo that rebase operation:" comment "Let's undo that rebase operation:"
rebase_op=$(jj --color=never op log | grep 'o ' | sed '3q;d' | cut -b4-15) rebase_op=$(jj --color=never op log | grep '^o ' | sed '2q;d' | cut -b4-15)
run_command "jj undo $rebase_op" run_command "jj undo $rebase_op"
comment "Note that only the rebase was undone, and the comment "Note that only the rebase was undone, and the