Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loss of title and description when doing cherry_picker --continue #7

Open
brettcannon opened this issue Jun 3, 2017 · 7 comments
Open

Comments

@brettcannon
Copy link
Member

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?

@serhiy-storchaka
Copy link
Member

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

@Mariatta
Copy link
Member

Mariatta commented Jun 4, 2017

@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
Copy link
Member

Mariatta commented Jun 4, 2017

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

@brettcannon
Copy link
Member Author

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

@ncoghlan
Copy link
Contributor

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).

@webknjaz
Copy link
Contributor

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.

@tomasr8
Copy link
Member

tomasr8 commented Aug 20, 2023

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:

def get_pr_url(self, base_branch, head_branch):
return f"https://github.com/{self.config['team']}/{self.config['repo']}/compare/{base_branch}...{self.username}:{head_branch}?expand=1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants