cherry-picker icon indicating copy to clipboard operation
cherry-picker copied to clipboard

Loss of title and description when doing `cherry_picker --continue`

Open brettcannon opened this issue 8 years ago • 8 comments

Maybe I'm doing something wrong, but when I have used cherry_picker --continue I inevitably lose the title and description I would have ended up with had there not been any merge conflict. Not sure if there's any way to prevent that or to output what the message would have been so I can copy-and-paste it into the eventual PR?

brettcannon avatar Jun 03 '17 18:06 brettcannon

This happened to me when I did git commit manually after resolving conflicts.

serhiy-storchaka avatar Jun 03 '17 21:06 serhiy-storchaka

@brettcannon Did you use --continue after a merge conflict, or after using --no-push? And did you have additional commit?

In @serhiy-storchaka's situation, when there are more than one commits in a branch, GitHub will prepopulate the PR title with the branch name. Is this what you meant by losing the title and description?

One way to solve this is to have cherry_picker create the PR using GitHub API / gidgethub, where we can specify the PR title and description ourselves instead of relying on GitHub web UI.

Printing out the original commit message for copy-pasting is the easy way out for now 😛

Mariatta avatar Jun 04 '17 05:06 Mariatta

In PR #109 the commit message is printed out so you can copy-paste.

Mariatta avatar Jun 04 '17 05:06 Mariatta

@Mariatta it was with --continue after dealing with a merge conflict.

brettcannon avatar Jun 05 '17 18:06 brettcannon

This may also align with #107, which we're pretty sure will need a "persistent scratch-pad" where cherry-picker can leave notes for itself in order to remember the original command line options for use with --continue.

Probably the simplest option for that would be a JSON file with a config dictionary in it, but if we made it officially an opaque format (e.g. .cherry-pick.state), then it could potentially be switched to a full pickle with shelve at a later date (and either way it would be easy for other commands to detect that a previous cherry-pick was still in progress due to the state file being present).

ncoghlan avatar Jun 11 '17 02:06 ncoghlan

Now with the work done in #295/#277 it should possible to implements storing more state-related data in git config --local (i.e. .git/config) throughout the whole backport cycle.

webknjaz avatar Feb 26 '19 14:02 webknjaz

I also ran into the same issue recently when manually fixing some conflicts. I just want to point out that it is now apparently possible to supply the title and description (as Mariatta suggested originally) inside the query string of the Github PR url i.e. github.com/.../compare/...?title=PR title&body=PR description. This will prefill the values automatically when opening the page in the browser.

We could just add the title and description to this url: https://github.com/python/cherry-picker/blob/e4ece758fec984d94d7d8e0a9f2e9e63e170bffb/cherry_picker/cherry_picker.py#L206-L207

tomasr8 avatar Aug 20 '23 12:08 tomasr8