On Tue, 2019-10-15 at 09:59 +0800, Paul Wise wrote:

> Any further thoughts or should I close this bug?

Some further thoughts from me:

If you want to change how the run command works, you can do that in
your mrconfig, the default just runs the args directly:

   [DEFAULT]
   run = "$@"

You could just evaluate it as shell code instead, or run a subshell:

   [DEFAULT]
   run = eval "$*"

   [DEFAULT]
   run = sh -c "$*"

Then you would be able to run something like this:

   $ mr run mr config '$MR_REPO' foo=bar bar=baz

You could create a new configure command to mr config the current repo:

   [DEFAULT]
   configure = mr config "$MR_REPO" "$@"

Then you would be able to run something like this:

   $ mr configure foo=bar bar=baz

myrepos could also change how `mr config` works to make it so that
passing only one argument means that `mr config "$MR_REPO" "$1" gets
run instead of the current action of returning an error. This would
only allow setting one value at a time, make it more convenient to use
when already in a repository but could be a surprising footgun when
used in a directory tree containing many repositories.

   $ mr config foo=bar
   mr config: not enough parameters

Another option would be to create a -r / --recurse option that would
make normally non-recursive commands like config or register process
all repositories instead. The advantage of this would be that it also
allows you to configure repos with multiple key=value items instead of
just one and the footgun would be hidden behind an explicit option.

   $ mr -r config foo=bar bar=baz

I'm inclined to make these changes to myrepos:

 * Make the config section optional when the current dir is a
   registered repos and derive the section from the current dir.
 * Add a recursive option that would apply to the config and register
   commands and cause them to do their jobs recursively.

In the meantime you should define and use a `mr configure` command.

Further thoughts welcome!

-- 
bye,
pabs

https://wiki.debian.org/PaulWise

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to