In fedpkg, there is the clone command to "git clone" a package. As it seems fedpkg it intended to wrap all git specific stuff, maybe there should be a new command "fedpkg branch " that does "git checkout ", just to change the current branch.
(Used: fedora-packager-0.4.2.3-1.fc13.noarch)
Started working on this. Cloned repo to git://github.com/lkeijser/fedora-packager.git
I think it's a good idea to not only switch to branches, but also view/delete/etc. Comments?
Done:
{{{ $ ./fedpkg.py branch -h usage: fedpkg.py branch [-h] [-l] [-c BRANCH]
optional arguments: -h, --help show this help message and exit -l, --list List both remote-tracking branches and local branches -c BRANCH, --checkout BRANCH Switch to another branch
$ ./fedpkg.py branch -l Listing branches * master remotes/github/master remotes/origin/HEAD -> origin/master remotes/origin/fedpkg-vcs remotes/origin/master
$ ./fedpkg.py branch -c remotes/origin/fedpkg-vcs Note: checking out 'remotes/origin/fedpkg-vcs'. -snip output- }}}
I should have commented earlier. I'm not really a fan of the verb "branch" here, as it does conflict with git branch. I'd rather something like "fedpkg switch-branch" or similar. It's default operation "fedpkg " should do the checkout, anything else would have to be with options.
Now some general feedback on the code.
1) use of git commit --rebase is helpful, that way you can present a final patch set of logically separated differences, rather than a stream of commits and fixes, makes it easier to review.
2) You have some whitespace issues, a git diff or a git log -p using color should show you where extra white space has been added.
3) Please don't put command logic in fedpkg.py. I'm keeping fedpkg.py clean of all such logic, everything goes into the module. This is so that different frontends can be written without having to duplicate logic.
4) Need to add more try/except clauses so that we don't traceback on the user.
Rebased to one patch (which i've sent) to you directly, addressing these issues. Thanks for the mini rebase howto as well :)
See [http://github.com/lkeijser/fedora-packager/commit/06c57983ea9d0ee489c235659b9789347d74f9f8 this commit].
This was pushed [e11fb1cca1de4f09f30ed142fea06427f2293661]