Bug#835566: please clarify docs regarding mr run

2019-11-14 Thread Paul Wise
Control: clone -1 -2
Control: retitle -2 add --recurse option for `mr config` command
Control: tags -1 fixed-upstream
Control: forwarded -1 
http://source.myrepos.branchable.com/?p=source.git;a=commitdiff;h=975d8dd 

On Thu, 2019-11-14 at 13:09 +0100, Marc Haber wrote:

> Thanks for giving this so much thought. Those things are all valid, I
> would probably not come up with this kind of creativity myself. Please
> consider writing similary inspiring text in the docs.  No code changes
> needed then.

I've now added some info to the documentation:

http://source.myrepos.branchable.com/?p=source.git;a=commitdiff;h=975d8dd

> Wouldnt the subshell immediately invoke quoting hell?

It would make quoting more complicated yes, the eval would too though.

It would still be possible to do quoting properly if the needed quoting
is reasonably simple, complex quoting would make it much harder.

> > 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.
> 
> Thank you very much.

I've made the first change, for the second change there is already a
bug and todo item about detecting/registering unregistered repos and
I've elected to duplicate this bug as a reminder to add recursive config.

http://source.myrepos.branchable.com/?p=source.git;a=commitdiff;h=5f101a3
https://bugs.debian.org/482371
https://myrepos.branchable.com/todo/detect_unregistered_repos_in_tree/

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


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


Bug#835566: please clarify docs regarding mr run

2019-11-14 Thread Marc Haber
Thanks for giving this so much thought. Those things are all valid, I
would probably not come up with this kind of creativity myself. Please
consider writing similary inspiring text in the docs.  No code changes
needed then.

> 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

Wouldnt the subshell immediately invoke quoting hell?

> 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.

Thank you very much.

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



Bug#835566: please clarify docs regarding mr run

2019-10-14 Thread Paul Wise
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


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


Bug#835566: please clarify docs regarding mr run

2019-10-14 Thread Paul Wise
On Sat, 27 Aug 2016 09:35:01 +0200 Marc Haber wrote:

> I would like to do something like
> 
> mr run mr config $REPOS foo=bar
> 
> This would need a placeholder for the repository name currently acted
> on. I am not sure whether this is supported.

The manual page documents that the MR_REPO environment variable is set
to the path of the top of the repository when running commands.

This command does what you want it to:

mr run sh -c 'mr config "$MR_REPO" foo=bar'

Any further thoughts or should I close this bug?

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


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


Bug#835566: please clarify docs regarding mr run

2016-08-27 Thread Marc Haber
Package: myrepos
Version: 1.20160123-0+0~zgSID+1+rebuilt20160708190226
Severity: wishlist

Hi,

I would like to do something like

mr run mr config $REPOS foo=bar

This would need a placeholder for the repository name currently acted
on. I am not sure whether this is supported.

Greetings
Marc

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.7.2-zgws1 (SMP w/4 CPU cores)
Locale: LANG=en_DK.utf8, LC_CTYPE=en_DK.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

myrepos depends on no packages.

Versions of packages myrepos recommends:
ii  libhtml-parser-perl  3.72-2
pn  libio-pty-easy-perl  
ii  libwww-perl  6.15-1
ii  perl 5.22.2-3

Versions of packages myrepos suggests:
pn  ack-grep  
pn  bzr   
ii  curl  7.50.1-1
ii  cvs   2:1.12.13+real-15
pn  darcs 
pn  fossil
ii  git [git-core]1:2.9.3-1
pn  kdesdk-scripts
ii  liburi-perl   1.71-1
pn  mercurial 
ii  subversion1.9.4-2
ii  subversion-tools  1.9.4-2
ii  vcsh  1.20151229-1

-- no debconf information