Skip to content

Remove ambiguity for branches with matching local fork names#132

Open
bfonta wants to merge 1 commit intocms-sw:masterfrom
bfonta:bugfix/branch_ambiguity
Open

Remove ambiguity for branches with matching local fork names#132
bfonta wants to merge 1 commit intocms-sw:masterfrom
bfonta:bugfix/branch_ambiguity

Conversation

@bfonta
Copy link
Copy Markdown
Contributor

@bfonta bfonta commented Apr 24, 2026

Using the command git-cms-rebase-topic (an alias to git-cms-merge-topic), I get the following error whenever the fork I'm taking the branch from and my personal fork (pointed at by my-cmssw) have a branch with the same name ("mybranch" in the example below).

$ git-cms-rebase-topic fork:mybranch
From https://github.com/fork/cmssw
 * [new branch]              mybranch -> fork/mybranch
Switched to branch 'rebase-attempt'
warning: refname 'fork/mybranch' is ambiguous.
fatal: ambiguous object name: 'fork/mybranch'

Repeating the rebase with the proposed fix removes the ambiguity.

@bfonta
Copy link
Copy Markdown
Contributor Author

bfonta commented Apr 24, 2026

type ngt

@cmsbuild
Copy link
Copy Markdown

A new Pull Request was created by @bfonta for branch master.

@akritkbehera, @cmsbuild, @iarspider, @raoatifshad, @smuzaffar can you please review it and eventually sign? Thanks.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.
cms-bot commands are listed here

@cmsbuild
Copy link
Copy Markdown

cms-bot internal usage

@bfonta
Copy link
Copy Markdown
Contributor Author

bfonta commented Apr 27, 2026

Upon further inspection, I noticed that I can only reproduce the error if, before rebasing, I run:

git remote add fork git@github.com:fork:mybranch.git
git fetch fork

It thus seems that the cause for the error is not connected to the branch names of other forks.

If we run

git remote rm fork

and then try the rebase again, it works.

At the same time, the current fix does remove the ambiguity, but after some more investigation I noticed that the resulting branch is not rebased on top of the current release, only checked out. The reason for this is not yet clear to me.

I would thus ignore the proposed changes, but keep this PR open in case the same error message appears in a different context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants