Posts

Mercurial (as of 2.1) Now Has Phases

In my last post I pondered (ranted?) on the reluctance of Mercurial people to edit repository history, especially as compared to git people. Today I noticed that Mercurial 2.1 has been released, and it has a new feature that makes editing your local repository much safer, phases (more detail here ). To me this looks like a really cool idea. Phases explicitly mark changesets as either public (have been pushed or pulled, and should not be edited) or draft (still local to your repository and can be freely edited). Changesets are given a phase automatically behind the scenes (though you can override this, of course), and history editing tools respect phases so that now it is even harder to shoot yourself in the foot when editing your repository history with tools like rebase or mq. There is also one more phase, secret, that can be enabled for use with patches in your Mercurial Queues. Secret changesets will not be pushed, pulled, or cloned (or even show up in the output of incomi...

What Is So Wrong With Mercurial's Named Branches?

I just installed the very latest version of mercurial, 2.0.2 . It added a new little feature that warns you when you create a branch. Huh? This is what it looks like: $ hg branch foo marked working directory as branch foo (branches are permanent and global, did you want a bookmark?) Really? Have we let the git advocates push us this far? Do we really need to start discouraging named branches? I googled around to see if I could find where the self-hate for mercurial's named branches is coming from and I found things like this , "it is almost never a good idea to use this facility for short-term branching, since branches created this way are inherently 'eternal'." (those quotes around eternal are good, actually, but you didn't explain why they should be there), and this , "you can never really delete branches (since that would mean altering older commits)." (editing history, oh noes!), and others like this. And these were all written by a...

Make Terminal.app Useful for Emacs

Running emacs -nw in Terminal.app on my Mac has been pretty frustrating, until today. To fix the experience, download and install KeyRemap4MacBook (I sure hope it's not malware). Click on "Change Key." Scroll down until you find "For Applications." Expand that to "Enable at only Terminal" and select "Change Command_L to Option_l." Expand "Change Slash(/) Key" and select "Control+Slash(/) to Control+Underscore(_)." You might also want to select "Switch next and prev tab in terminal with shift and arrows (like Gnome term)." All better.

The Dark Cockpit Theory

A co-worker who is annoyed with the verbosity of our verilog simulations just asked me if I subscribed to the Dark Cockpit Theory. I immediately replied, "no." I've had this argument a number of times with other engineers and I have already decided that more information is better than less. I had to google "dark cockpit theory" later because I'd never heard of it referred to that. For me it has always been the UNIX "Rule of Silence" . Same idea, I think. Just to be clear, I do like the Rule of Silence when it's software that I trust isn't going to do weird things or silently hang. There isn't a lot of code that I trust that much, though, and if it's software I don't trust, I want to know what it's doing, or at least that it's doing something . As I thought about this more, it's the same with people. When a person you trust is doing something for you, they can go do it without giving you any intermediat...

Incremental Merge with Mercurial

I just learned how to merge incrementally with Mercurial. I wasn't really even aware of what that means until I learned about it. Most people use a graphical diff/merge tool with Mercurial such as kdiff3 , and for a good reason. Resolving merge conflicts any other way is much more difficult. Normally when you run hg merge it merges all the files right then, and pops up your graphical merge tool right when conflicts occur. You can leave the gui window up and sort of ignore it for a while, but then you wonder what happens if your computer loses power or you need to reboot for some reason. Will your working copy be left in some weird state? What if you have already spent a lot of time resolving tricky conflicts on a previous file, you'd hate to lose that work. Or what if you know one particular file is going to be onerous and you'd like to resolve conflicts there first? Wouldn't it be nice if Mercurial could just present you a list of files with conflicts and let...

A UNIX/Linux Environment Manager

I have written A UNIX/Linux environment manager that allows on-the-fly configuration of your shell environment. It's called, albion . Using albion, environment variables, aliases, functions, and so forth can be changed without requiring you to do the tedious log-out-and-log-back-in-again routine. Simply type 'albion load ' and your shell environment will be reconfigured according to the specification in your environment file. It should work with any POSIXy shell (bash, ksh, zsh, etc.) Albion is similar to the Environment Modules Project , however, environment configuration files (configs) are written in standard shell language, not tcl. Another improvement over modules is that when unloaded, the effect of the configs is correctly undone, even if the configs have changed or been deleted after loading. The main albion tool is written in Python, with some supporting pieces written in POSIX shell code. albion is currently alpha quality. The core functionality seems to be ...

How to Disable Ubuntu command-not-found

Ubuntu, in all its helpfulness, has a feature that tries to guess what you mean when you type commands at the bash prompt. If you type a command that's found, it runs it, of course. If you type a command that it can't find, it takes a moment to search available packages for install and suggest what you might do to make that command available. It sometimes looks like this: $ foo No command 'foo' found, did you mean: Command 'xoo' from package 'xoo' (universe) Command 'fop' from package 'fop' (universe) Command 'fox' from package 'objcryst-fox' (universe) Command 'zoo' from package 'zoo' (universe) Command 'goo' from package 'goo' (universe) foo: command not found It's great when you have a new system and you haven't yet installed everything you need. Type emacs before emacs has been installed, and it will helpfully tell you the exact command to use to install it. After a...