omitting repo headers with 'mr run'

Adam Spiers vcs-home at
Sun Feb 19 18:09:10 CET 2012

On Sun, Feb 19, 2012 at 4:47 PM, Joey Hess <joey at> wrote:
> Adam Spiers wrote:
>> Right - not just commit; it's the same problem with any action.  But
>> you could add support for some kind of test e.g.
>>     git_wip_is_interactive    = false
>>     git_commit_is_interactive =
>>         for arg in "$*"; do
>>             [[ "$arg" == -m* ]] && exit 0
>>         done
>>         exit 1
> Needing to build this kind of knowledge about each vcs into mr seems
> like a) a layering violation

You lost me, I'm afraid.  Why is that a violation, and which layer
should the knowledge belong in?  Or are you suggesting mr could
*automatically* detect whether an arbitrary action is interactive or
not?  I can't imagine how this would be possible, short of some ugly
hack involving Expect.

> and b) an impediment to easily adding new vcs etc to mr.

No, because it's optional; it just provides these benefits
when present:

- mr will know it needs to complain when the user uses -q and/or -j with
  interactive actions.

- When mr knows it's running a non-interactive action, it can capture
  STDOUT/STDERR, and then if the user requests it, omit sections of the
  output corresponding to repo actions which produced no output.

To me it looks like a simple and non-intrusive way of solving two
problems in one go.  Having said that, if there's a better solution,
I'd be delighted to hear about it, and even implement it!

More information about the vcs-home mailing list