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

Modify topic-base-branch-name #43

Closed
wants to merge 1 commit into from
Closed

Modify topic-base-branch-name #43

wants to merge 1 commit into from

Conversation

eralumin
Copy link

@eralumin eralumin commented Nov 6, 2018

Set default branch according to HEAD position.

Set default branch according to HEAD position.
@@ -860,7 +860,9 @@
##

topic-base-branch-name = "!f(){ \
printf \"master\n\"; \
head_path=$(git symbolic-ref refs/remotes/origin/HEAD); \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ git remotes 
gh	[email protected]:phdru/ppu.git (fetch)
gh	[email protected]:phdru/ppu.git (push)
origin	/home/phd/prog/Python/ppu (fetch)
origin	/home/phd/prog/Python/ppu (push)

$ git symbolic-ref refs/remotes/origin/HEAD
fatal: ref refs/remotes/origin/HEAD is not a symbolic ref

Ouch! Are you sure refs/remotes/origin/HEAD always exists?

@joelparkerhenderson
Copy link
Member

Thanks for the suggestion. Can you help me understand how your code ensures that it finds the right branch name that a user wants to use for creating a new topic branch?

The existing code always returns "master", which surely isn't right for everyone. For example, some teams use a branch named "develop", some teams use a branch named "trunk", etc.

@joelparkerhenderson joelparkerhenderson deleted the branch GitAlias:master April 14, 2021 18:12
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

Successfully merging this pull request may close these issues.

None yet

3 participants