Bug 771261

Summary: fedpkg switch-branch should work with modified cloning
Product: [Fedora] Fedora Reporter: Philip Prindeville <philipp>
Component: fedpkgAssignee: David Cantrell <dcantrell>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 16CC: dcantrell, philipp
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-03 18:05:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Philip Prindeville 2012-01-03 02:19:05 UTC
Description of problem:

If I start out working (say) in f16 and make some changes, then decide to look at whether those changes are applicable in rawhide or el6, I need to manually do a "git stash" when switching branches... then remember to pop (apply?) them when I return to the previous branch.

Version-Release number of selected component (if applicable):

1.6-1

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jesse Keating 2012-01-03 18:05:39 UTC
This is a limitation of git itself, it won't let you switch branches when you have modified content.

Comment 2 Philip Prindeville 2012-01-03 18:43:53 UTC
(In reply to comment #1)
> This is a limitation of git itself, it won't let you switch branches when you
> have modified content.

Right, but since fedpkg is a script, you can make it do what you want, including stash any changes when switching to an alternate branch, and then restore them when switching back.

If you do the stash before the branch, then it works.

Comment 3 Jesse Keating 2012-01-03 18:53:45 UTC
Dealing with stashes requires a bit more advanced knowledge of how git works, not something I'd want to impose upon people in a default setting.  An option to switch-branch that would cause a stash and re-apply might be useful, but not something I'm going to spend time on at this point.

Comment 4 Philip Prindeville 2012-01-03 19:08:15 UTC
(In reply to comment #3)
> Dealing with stashes requires a bit more advanced knowledge of how git works,
> not something I'd want to impose upon people in a default setting.  An option
> to switch-branch that would cause a stash and re-apply might be useful, but not
> something I'm going to spend time on at this point.

If you did that would be awesome: before filing the bug I took an informal poll on #fedora-devel and there was interest in it.

Comment 5 Jesse Keating 2012-01-03 19:36:59 UTC
Not to send you on a goose chase, but if you file it as an enhancement request at https://fedorahosted.org/rpkg  then maybe somebody else will pick it up before I look at it and submit patches.  Something like this belongs in the core rpkg library.

Comment 6 Philip Prindeville 2012-01-06 18:10:59 UTC
(In reply to comment #5)
> Not to send you on a goose chase, but if you file it as an enhancement request
> at https://fedorahosted.org/rpkg  then maybe somebody else will pick it up
> before I look at it and submit patches.  Something like this belongs in the
> core rpkg library.

Well, I would if I had a trac account on fedorahosted.org but I don't...

Comment 7 Jesse Keating 2012-01-06 22:41:13 UTC
https://fedorahosted.org/rpkg/ticket/8

Comment 8 Philip Prindeville 2012-01-10 18:05:50 UTC
(In reply to comment #7)
> https://fedorahosted.org/rpkg/ticket/8

Awesome, thanks.