Bug 624258 - fedpkg overwrites the current branch when switch-branch fails
Summary: fedpkg overwrites the current branch when switch-branch fails
Alias: None
Product: Fedora
Classification: Fedora
Component: fedora-packager
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2010-08-15 09:40 UTC by Chuck Ebbert
Modified: 2013-01-10 06:09 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-01-21 21:15:46 UTC
Type: ---

Attachments (Terms of Use)

Description Chuck Ebbert 2010-08-15 09:40:51 UTC
$ rpm -q fedpkg

$ git branch -vv
  f12/master        592f96a [origin/f12/master] Linux
  f13/2.6.33/master b0632f0 [origin/f13/2.6.33/master] - from http://git.kernel.org/?p=linux/kernel/git/jkacur/jk-2.6.git stable/2.6.33.y
  f13/master        5161ff7 [origin/f13/master] Linux
* f14/master        e115159 [origin/f14/master] Linux
  master            996221c [origin/master] Require newer linux-firmware package

$ git status
# On branch f14/master
nothing to commit (working directory clean)

$ fedpkg switch-branch f13
Unable to switch to another branch: Could not create branch f13

$ fedpkg switch-branch f13/master
Unable to switch to another branch: /home/cebbert/fedora/git/kernel has uncommitted changes.

$ git status
# On branch f14/master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#	deleted:    TODO
#	new file:   add-appleir-usb-driver.patch
#	new file:   btrfs-prohibit-a-operation-of-changing-acls-mask-when-noacl-mount-option-is-used.patch
#	new file:   cifs-fix-dns-resolver.patch
#	modified:   config-arm
#	modified:   config-debug
#	modified:   config-generic

Comment 1 Jesse Keating 2010-08-17 17:26:54 UTC
Ugh, that's neat.  We're just calling out to git checkout for this, so git itself is eating your branch...

Comment 2 Chuck Ebbert 2010-08-18 12:44:05 UTC
If I use git directly I get:

$ git checkout f13
error: pathspec 'f13' did not match any file(s) known to git.

So fedpkg must be doing something different?

Comment 3 Jesse Keating 2010-08-18 17:28:07 UTC
ok, you've hit upon a scenario where convenience doesn't work for you.  For convenience, I allow fedpkg switch-branch to use short names such as "f13" and "f14", and they create local branches named "f13" or "f14" but they track the remote f13/master or f14/master.  Asking fedpkg to switch-branch to f14/master won't work as it doesn't know what to do with that.  And in your case, since you already have local f13/<something> branches, fedpkg cannot create a local branch named "f13".

I'm afraid that if local branches with naming of f??/<something> are going to be used, you'll have to use git directly.  I'll have to make fedpkg alert the user when this scenario is encountered.

Comment 4 Jesse Keating 2010-08-18 17:28:37 UTC
Still doesn't explain why git is screwing with stuff.  fedpkg was attempting to do:

git checkout -b f13 --track origin/f13/master

Comment 5 Bug Zapper 2010-11-03 10:58:49 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 

Note You need to log in before you can comment on or make changes to this bug.