You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[cherry-picker] Misleading assumption about the main branch #250
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.
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.
Activity
terryjreedy commentedon May 23, 2018
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 commentedon May 23, 2018
git symbolic-ref --short HEADgives you the name of the current branch.webknjaz commentedon May 23, 2018
Fair enough. I'll try to update this in #254
Memorize initial branch and restore it upon finish
webknjaz commentedon May 28, 2018
@terryjreedy @serhiy-storchaka can someone review the PRs, please?
Memorize initial branch and restore it upon finish