Re: [PATCH] allow commands to be executed in submodules

4 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] allow commands to be executed in submodules

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:11

Alex Riesen [off-list ref] writes:
Martin Waitz, Sun, May 20, 2007 17:39:08 +0200:
quoted
Add an extra "submodule" field to struct child_process to be able to
easily start commands which are to be executed in a submodule
repository.
How about making it more generic by allowing to specify the directory
to change to and environment for subprocess? You probably will be able
to convert even some of existing code to your new run_command then
(merge_recursive in builtin-revert.c, for example).
Sounds useful and more generic.

Re: [PATCH] allow commands to be executed in submodules

From: Martin Waitz <hidden>
Date: 2016-06-15 22:43:11

hoi :)

On Sun, May 20, 2007 at 11:25:24AM -0700, Junio C Hamano wrote:
Sounds useful and more generic.
I explicitly wanted to have a method to execute one command in
the environment of a submodule.  That way we can update it in
one place if we later add more environment variables which
influence the repository.

Do we really have so many places where we want to execute commands
in a different directory or with different environment?  Is it worth
keeping run-command generic and having to introduce knowledge about
how to run submodule commands in multiple places?

That said I don't have any strong feeling about it, as long as one
or the other patch is applied.

-- 
Martin Waitz

Re: [PATCH] allow commands to be executed in submodules

From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:11

Martin Waitz, Sun, May 20, 2007 22:48:02 +0200:
Do we really have so many places where we want to execute commands
in a different directory or with different environment?  Is it worth
keeping run-command generic and having to introduce knowledge about
how to run submodule commands in multiple places?
Is there multiple places? Is it hard to create a specific function out
of a generic one? (which can be used from other places and your
specific can't and we would need the generic one anyway).

"Generic" is not about "multiple places". Generic is about "general"
as opposite to "specific". Gives you flexibility and wider application
range.

Re: [PATCH] allow commands to be executed in submodules

From: Martin Waitz <hidden>
Date: 2016-06-15 22:43:11

hoi :)

On Sun, May 20, 2007 at 10:59:33PM +0200, Alex Riesen wrote:
Is there multiple places? Is it hard to create a specific function out
of a generic one? (which can be used from other places and your
specific can't and we would need the generic one anyway).
you can add a specific new function for submodules, dropping the
nice property of child_process that you only have to initialize a few
fields and then can run the command.
"Generic" is not about "multiple places". Generic is about "general"
as opposite to "specific". Gives you flexibility and wider application
range.
Generic code and abstractions only make sense when they are _useful_.
Lets not overengineer it.  If we later see that we need more, then
so be it.  KISS.

But now lets go on and don't discuss about such details.
I'm happy if I can run commands in submodules and don't care about the
actual code.

-- 
Martin Waitz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help