tech-repository archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: The essential problems of moving from CVS

On 2010-01-16 01:25 +0000 (Sat), David Holland wrote:

> For me at least it's not so much checkouts that's a problem as not
> being able to selectively update or revert subtrees, particularly in
> pkgsrc.

Well, from a git point of view, this simply doesn't make sense. What
you're saying when you do this is that you want only part of a commit,
and parts of other commits. That means you want a modified working
tree. You can generate a patch from a commit and then tweak it to
add or remove only the bits you want, and then you're left with an
appropriately modified working tree, I guess.

> Another related problem is that you can't really use one tree
> to hack independently on, say, sh and sail(6), because if you commit
> the changes they get mixed together...

Not at all, in git, if you use its features designed just for this sort
of thing. Add only what you want to commit (e.g., only the sh changes)
to the index, commit, and the sail(6) changes won't be committed. The
stash command can help with this sort of thing, too.

> And another somewhat more tangentially related problem (that topgit
> might also fix) is that you can't really keep local patches, like the
> gross hack I need for the tulip ethernet in my test machine, in the
> same tree that you use for development and commit.

Git actually excels at this sort of thing. Say 'master' is the main
branch, and 'local' is the branch that contains your local patches.
Here's the workflow.

    1. Switch to master branch and pull. Do any testing (compile or
    whatever) you care to here.

    2. Switch to 'local' branch and rebase to master. This brings in all
    of the new changes, and lets you merge your local patches if they
    need merging.

    3. Hack away on whatever, and test until you're happy.

    4. When ready to commit, switch back to master branch, and do
    any testing/changes you need to do here to eliminate dependencies
    on your patches.

    5. Commit, and restart with step 1 or 2.

Curt Sampson         <>         +81 90 7737 2974
The power of accurate observation is commonly called cynicism
by those who have not got it.    --George Bernard Shaw

Home | Main Index | Thread Index | Old Index