He's not dead, he's resting
Changes to the Paludis Git Syncer
I’ve just committed two changes to the Paludis Git syncer.
The first allows you to do
sync_options = --branch=foo to specify a particular branch. I don’t expect this to be widely used, since branching for repositories usually means you’re not taking advantage of the better facilities available for that kind of thing. Still, it has its uses.
The second is
sync_options = --reset. Unlike with, say,
rsync, syncing via Git will merge any changes you’ve made to the repository with new upstream changes (it uses
git pull). With
--reset, it will instead discard any local changes and just become equal to whatever you’re syncing against (using instead
git fetch and
git reset --hard).
It’s a matter of considerable debate as to whether the reset behaviour is the right thing to do.
On the one hand, some people like working directly on a checkout to which Paludis is pointed, but still want
cave sync to bring in updates.
On the other hand, doing that is horrible and evil, and a much better workflow is this:
- Have a local checkout for development work. Commit your changes to it.
- Have a separate checkout that is synced against your local checkout for Paludis use. After making changes, commit them to your local checkout and sync.
- When happy with your changes, rebase and squash them in your local checkout, and then push them upstream.
Doing that requires
--reset, since otherwise the checkout Paludis sees will end up as some horrible auto-merged mess that includes changes you thought you’d discarded ages ago.
I’m strongly considering making
--reset by default sometime in the future. However, this will make syncing a destructive operation for anyone who hates puppies enough to be doing work on a Paludis-synced checkout (in the same way that it’s already destructive for rsync).