Skip to content

[cherry-picker] Misleading assumption about the main branch #250

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

Closed
webknjaz opened this issue May 23, 2018 · 4 comments
Closed

[cherry-picker] Misleading assumption about the main branch #250

webknjaz opened this issue May 23, 2018 · 4 comments

Comments

@webknjaz
Copy link
Contributor

Hi,

This is probably a follow-up for #225.

On some projects I work on, the repo's default branch is not master, but devel or smth else. It would be nice to have it configurable and maybe query this information from github repo metadata as a fallback.

@terryjreedy
Copy link
Member

AFAIK, the only hardcoded use of 'master' is in 'git checkout master' at cleanup. Since I want to run cherry_picker in the worktree for target branch, I edited 'master' to, then, '3.6'. Now that there are both 3.6 and 3.7 as backport targets, even this is problemmatical.

Several months ago, I requested that cherry_picker stop assuming that it is being run in the master repository, and instead cleanup by checking out the branch that was originally checked out in the worktree. This is each to determine with 'git branch'. The current branch is prefixed with '* '. This could be detected on startup. This would also solve the problem of a master branch nameed something else.

@serhiy-storchaka
Copy link
Member

git symbolic-ref --short HEAD gives you the name of the current branch.

@webknjaz
Copy link
Contributor Author

Fair enough. I'll try to update this in #254

webknjaz added a commit to webknjaz/core-workflow that referenced this issue May 28, 2018
Based on suggestions of @serhiy-storchaka @terryjreedy in python#250:
Co-authored-by: Terry Jan Reedy <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
@webknjaz
Copy link
Contributor Author

@terryjreedy @serhiy-storchaka can someone review the PRs, please?

webknjaz added a commit to webknjaz/core-workflow that referenced this issue Jun 9, 2018
Based on suggestions of @serhiy-storchaka @terryjreedy in python#250:
Co-authored-by: Terry Jan Reedy <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants