== Today's Mercurial command alias: a short form _hg incoming_ Like other modern VCSes, [[Mercurial http://mercurial.selenic.com/]] allows you to define command aliases. This is a feature that I don't use as much as I could, but every so often I work out one that's really handy. Today's alias is something I've called '_hg pending_', a short form summary version of '_hg incoming_'. From my .hgrc: > _[alias]_ \\ > _pending = incoming --template '* {desc|firstline}\n'_ This shows something that looks like: > _* exp/html: detect "integration points" in SVG and MathML content_ \\ > _* runtime: faster GC mark phase_ \\ > _* cmd/cc: fix uint right shift in constant evaluation_ \\ > _* cmd/6g: peephole fixes/additions_ When I'm checking up on what's coming from an upstream repository that I'm tracking, this is basically just what I want; I don't care about who authored the change or its long description or the other full information, I'd just like to get a quick overview of what I'll get with a pull. (This assumes that you are tracking Mercurial repositories that use the decent and correct format for commit messages.) Possibly I should make a version of this for _hg log_ too, but I haven't felt the urge yet. (I have no strong reason for calling it 'pending' instead of anything else and there is probably a better term for it since I am bad with names.) === Bonus: _sdiff_, a sysadmin-friendly diff alias Another Mercurial 'alias' (sort of) that we've become very accustomed to is something we call _hg sdiff_: > _[extensions]_ \\ > _hgext.extdiff =_ > > _[extdiff]_ \\ > _cmd.sdiff = diff_ \\ > _opts.sdiff = -Nr_ This gives us an old-style diff of changes. This is not something you would use as a programmer, but for sysadmins it turns out that the context from unified diffs is basically pointless for many changes to configuration files. In fact, zero-context diffs can be easier to read because there is less clutter obscuring the actual changes. (The one drawback of this is that Mercurial doesn't report the file that has changed if there's only one. '_hg status_' is your friend here.) This especially matters to us because we often record configuration file changes (in some diff form) in [[worklog entries ../sysadmin/ChecklistEvolution]] (which also helps [[other sysadmins to stay on top of the changes ../sysadmin/WhyWorklogsWorkForUs]]). When we initially [[switched to Mercurial ../sysadmin/MercurialVsGit]] from RCS, the increased verbosity of the default _hg diff_ unified diff output became vaguely annoying. Creating _hg sdiff_ helped significantly. (Having written this, I guess we could experiment with forcing zero lines of context for unified diffs. However we're well accustomed to old-style diff output as it is, so I suspect we wouldn't really find it much of an improvement.)