#93 allow branch override
Closed: Fixed Opened by sharkcz.

In some situations it's useful to allow overriding the branch name determined
from the git branch and make fedpkg behave like the old "make foo BRANCH=bar".
It works now in "local", "prep" and "srpm" targets.

My usage includes testing a rawhide package on a released fedora or working on private branches where fedpkg throws a traceback now.


Looks like this patch could workaround the issue where only master branch exists (and no fX/master branches) and fedpkg throw a traceback for actions like srpm, prep, import (see https://bugzilla.redhat.com/show_bug.cgi?id=619979)

''branch'' and --branch may be a little unspecific words.

Could --target or something else be better?

Target could be IMHO confused with build targets in koji, but I'm open to suggestions.

[ Just some more thoughts about this, not claiming to be the one and only absolute truth. ]

Right off the top of my head, I can think of the following uses of the word "target":

  • The fedpkg subcommands are called "targets" (e.g. in fedpkg build, "build" is a "target"). Probably stems from fedpkg's Makefile based origin and the make targets.
  • The koji targets like dist-f14 (not to be confused with the koji "tag" dist-f14).

As to the word "branch", we have

  • The pseudo "branch" concept from ancient dist-cvs ("F-14" or similar)
  • Local git branches like "f14"
  • Remote git branches like "f14/master"

So which "branch" type is this patch dealing with? I would say it is short-circuiting the fedpkg remote branch detection logic with a more typing friendly version of "--remote-branch=f14/master".

However, isn't the remote branch only detected to determine which koji target to build for? So... wouldn't --koji-target=dist-f13 or a shorter version for convenience make more sense?''''''

Apparently, [cda6081ad56a792fd116ec2350653b3e0ede3ea9] fixes this (and calls the parameter --dist).

And I like --dist.

Ah yes, I went on a bit of a hackfest and fixed a number of things. I forgot this ticket was here.

I'm inclined to reopen this ticket, because --dist is a bit too smart. One cannot set arbitrary values, because it mocks around with the argument value:

  • f15 -> fc15
  • fc15 -> fcc15
  • el6 -> el6
  • foo -> fc16 (!)

Of course I can guess what's the reason behind this, but shouldn't it be possible freely set the %dist value?

Ah, sorry, I spoiled it by wrongly pasting the rawhide example, it should read:

  • foo -> fcoo
  • bar -> fc16 (!)
Metadata