Re: [PATCH 1/4] git submodule: Teach add to accept --group

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

Re: [PATCH 1/4] git submodule: Teach add to accept --group

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:07:50

Stefan Beller [off-list ref] writes:
quoted
quoted
@@ -165,6 +166,10 @@ cmd_add()
              --depth=*)
                      depth=$1
                      ;;
+             -g|--group)
+                     submodule_groups=${submodule_groups:+${submodule_groups};}"$2"
+                     shift
+                     ;;
You would want to accept "--group=<name>" as well, just like
existing --reference and --depth do.  It won't be much more code,
and when you move to C (hence parse_options) you'd get it for free
anyway.
I am not sure, if I will to move `add` to C any time soon. Sure I desire
less shell and more C[1], but I'd think my time could be spent better than
just converting scripts to C. Sometimes I have to though, such as in the
case of `init` as the the call out from C to shell is too ugly and the effort to
do that is not that much less.
You can do so in less time than you spent making the above 5-line
excuse.  It won't be much more code, and it is not ugly at all.

	--group=*)
        	group=$group ${1#--group=} ;;

or something, right?

Re: [PATCH 1/4] git submodule: Teach add to accept --group

From: Stefan Beller <hidden>
Date: 2016-06-15 23:07:50

On Wed, Jan 20, 2016 at 4:08 PM, Junio C Hamano [off-list ref] wrote:
Stefan Beller [off-list ref] writes:
quoted
quoted
quoted
@@ -165,6 +166,10 @@ cmd_add()
              --depth=*)
                      depth=$1
                      ;;
+             -g|--group)
+                     submodule_groups=${submodule_groups:+${submodule_groups};}"$2"
+                     shift
+                     ;;
You would want to accept "--group=<name>" as well, just like
existing --reference and --depth do.  It won't be much more code,
and when you move to C (hence parse_options) you'd get it for free
anyway.
I am not sure, if I will to move `add` to C any time soon. Sure I desire
less shell and more C[1], but I'd think my time could be spent better than
just converting scripts to C. Sometimes I have to though, such as in the
case of `init` as the the call out from C to shell is too ugly and the effort to
do that is not that much less.
You can do so in less time than you spent making the above 5-line
excuse.  It won't be much more code, and it is not ugly at all.

        --group=*)
                group=$group ${1#--group=} ;;

or something, right?
Right, that's what I have here now. I should have said that.

I was not trying to excuse anything, but more explaining the situation
when reading the second sentence. (You seem to assume I'd want to rewrite
all the shell scripts. Which I am not)

Re: [PATCH 1/4] git submodule: Teach add to accept --group

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:07:50

Stefan Beller [off-list ref] writes:
Right, that's what I have here now. I should have said that.

I was not trying to excuse anything, but more explaining the situation
when reading the second sentence. (You seem to assume I'd want to rewrite
all the shell scripts. Which I am not)
I think it is a reasonable way to spend your time by not rewriting
everything in C but the parts the matter the most.  But it makes it
even more important to do the part that will be left in shell for a
longer time in such a way that will be helpful to the end users (by
accepting both "--group name" and "--group=name", in the codepath
under discussion).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help