spr icon indicating copy to clipboard operation
spr copied to clipboard

Needing to always pass `--cherry-pick` is unexpected

Open joneshf opened this issue 3 years ago • 3 comments

Ran into some confusing behavior just a bit ago. I opened a PR with spr diff --cherry-pick. I wanted to reword the commit message and update the PR with that new message, so I did git commit --amend followed by spr diff. Since I didn't use the --cherry-pick option the second time, it changed the base and pushed a synthetic branch like it normally does for a stacked PR. I understand why it did that, but it's just not what I expected. I'm not sure what the suggestion is from me.

Maybe the documentation should mention that once you use --cherry-pick for spr diff, you have to use --cherry-pick for every command on that commit? That's how spr land works, so it kind of makes sense.

I think it would be nice if you didn't have to remember to always pass the --cherry-pick option after the initial spr diff. If the motivation behind that is to be explicit with the commands, I can understand that. But I can imagine I wouldn't be the only person to either not know, or forget to pass the --cherry-pick option.

Any thoughts on this situation?

joneshf avatar Aug 06 '22 17:08 joneshf

I am collecting ideas for a version 2.0 or something, and I am really tempted to use Git trailers to store a bit more meta information. So spr could remember a previous use of --cherry-pick on a specific commit. And maybe we add a --no-cherry-pick option for when you want to override that.

sven-of-cord avatar Sep 14 '22 10:09 sven-of-cord

I would be a fan of a trailer for this!

rockwotj avatar Sep 14 '22 11:09 rockwotj

Another option outside of adding a trailer for this would be to add a note in git-notes for this: https://git-scm.com/docs/git-notes

rockwotj avatar Oct 05 '22 18:10 rockwotj