#88 fedpkg names local branches inconsistently
Closed: Fixed Opened by akurtakov.

If you use:

  • fedpkg clone --branch local branch will be named f*/master

  • fedpkg switch-branch local branch will be named just f*

Can we make fedpkg name branches in the same way?


I have create a patch which should solve this issue. The main idea is, that you are create the repository on the subdirectories with git clone -l -n after then a call to pyfedpkg.switch_branch should create the proper ceckout for the each branch.

Replying to [comment:2 s4504kr]:

I have create a patch which should solve this issue. The main idea is, that you are create the repository on the subdirectories with git clone -l -n after then a call to pyfedpkg.switch_branch should create the proper ceckout for the each branch.

I'm afraid there is a misunderstanding here. I think OP wasn't concerned about old-style (CVS-like branches). The problem is related to how fedpkg names true Git branches (i.e. branches shown by git branch -a).

Example (using fedpkg clone --branch option; NOT --branches):
{{{
$ fedpkg clone --branch f14 ed; cd ed; git status;

On branch f14/master <--- Note: branch name is "f14/master"

nothing to commit (working directory clean)
}}}

Example (using fedpkg clone, no options then fedpkg switch-branch):
{{{
$ fedpkg clone ed; cd ed; fedpkg switch-branch f14; git status;

On branch f14 <--- Note: branch name is "f14"

nothing to commit (working directory clean)
}}}

In other words, fedpkg switch-branch creates branch names exactly as specified in the argument, whereas fedpkg clone --branch seems to append "/master" to the local branch name. This seems like inconsistent behaviour.

Thanks!

I have added an additional patch which should solve the issue on the fedpkg --branch case. So we should have uniform branch names in all cases.

Sorry I've missed this ticket, it was assigned to the wrong component.

Not having read most of this ticket, I've been pretty well convinced that I just need to always make the local branch match the remote branch, or else git looses its mind too much. Sad, but true. I'll review the rest of this ticket soon.

Personally speaking matching local head names and remote head names makes most sense.

fedpkg no longer does this. The local branch now matches the remote branch name.

Metadata