?

Log in

No account? Create an account
patrickwonders
patrickwonders

VCS Whoas

I've got tons of my world under version control. I've got version control on LaTeX macros, SQL dumps, source code, my resume, my website, other peoples' websites, my .profile, yada, yada, yada. The older stuff is in CVS (some migrated from RCS). More recent stuff is in monotone. Still more recent stuff is in subversion so that I didn't have to keep rebuilding Boost on my ancient Linux distro every time I upgraded monotone.

But, I've hit a roadblock. CVS didn't have any way to reference an external repository (though, I've been known to pretend like it did with unmaintainable symlinks in the repository directories). Monotone didn't handle them very well. And, subversion has some really big caveats with them. Without external repositories, code re-use is questionable at best. I want to re-use the PHP utilities I made for that website on this website.... well, copy them on over or put an ignored symlink in this working copy over to that working copy or keep everything in one repository where you manually maintain foo/bar/utils/ as a branched copy of qux/quux/utils/. Yuck.

After reading this article about git, I thought I should give it a shot. So, I was following along with the submodules section of the git manual.

transcript of making subprojectsCollapse )

So far, so good. I have three projects that I'm going to include in my super project. Now, I'll make my super project.

transcript of making the super projectCollapse )

Now, I'll clone it, make some changes to the foo subproject, and commit all of my changes.

transcript of cloning the super, changing the sub, and committingCollapse )

So far, so good. I'm gonna go back into the super project master and see how things look from there.

transcript of updating the superCollapse )

Okay, so I'm cooking with Crisco now. I've made a bunch of little projects. I've made a super project to in the darkness bind them. I cloned that super project. I made changes to the sub in that clone. I pushed them back to the super. But, now I'm stuck.

The directory ~/tmp/git/foo is both a working copy and a repository for the project foo. I've updated the repository for it, but I cannot figure out how to update the working copy that's there. In fact, even worse, the working copy that's there thinks (and rightly so) that it represents a change which will undo everything that I've done. I don't want that. I want to incorporate the changes that have been committed from the cloned super. And, I cannot figure out how to do it.

transcript of lame attempts to sync working copy with repositoryCollapse )

Further, git revert wants to revert the last commit, not revert my current "changes". And, git checkout HEAD gives me README.txt but now thinks I still want to add foo.txt. Its recommendation here of using git reset HEAD seems like a good idea, but it no-ops with a message I don't know how to respond to:

transcript of git resetCollapse )

I feel like I'm missing something fundamental.

Tags: , ,