Pierre-Yves David

Core contributor to Mercurial, initiator and maintainer of ChangesetEvolution and Octobus a Mercurial consultancy company.

IRC: marmoute

twitter: marmoute

work: Octobus

Notes and Opinions about User Experience Design

Combining feature by adding `hg command --flags`

It is often tempting to combine command that are often used together through a flag. For example hg pull and hg update are often used in combination, so the hg pull --update flag was added, same applied to hg pull --rebase.

I think that this pattern should be added with care. The main risk is that the new flag will end up pulling a lot of unrelated complexity and associated flags within the original commands.

In the hg pull --update/--rebase examples this meands that --update special action (like merging files) to be dealt with by hg pull which previous did not need the context. Merging changeset comes with new config (like the one to select the merge tools, continue and abort, etc.). You can end up multiplying the complexity of the two commands instead of simply summing up that complexity.

Does this means we should never do so? No, this is definitely useful in various case, we should just do it with care and stay aware of the potential complexity pulled into the command. Adding many more flag losely related to the command and only relevant in some case can make the help harder to follow and the overall user Experience harder.

In previous discussion, RyanMcElroy pointed out that this recurrent needs to combine multiple operation is a hint for the needs of a more powerful alias system. He says that having and easy way to make a "multi commands" alias, possibly while ensuring "atomic" operation could fit many of the use-case that trigger the needs for adding a flags to glue a command to another one.


CategoryHomepage