Re: [PATCH v3 3/4] get rid of "git submodule summary --for-status"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jens Lehmann <Jens.Lehmann@xxxxxx> writes:

> Am 29.08.2013 15:05, schrieb Matthieu Moy:
>> The --for-status option was an undocumented option used only by
>> wt-status.c, which inserted a header and commented out the output. We can
>> achieve the same result within wt-status.c, without polluting the
>> submodule command-line options.
>> 
>> This will make it easier to disable the comments from wt-status.c later.
>
> Cool, thanks for implementing this!
>
> But unfortunately this change collides with bc/submodule-status-ignored
> (I added Brian to the CC) which is currently on its way to next.

Thanks for pointing that out. The patch looks buggy:

--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -1036,6 +1036,13 @@ cmd_summary() {
                do
                        # Always show modules deleted or type-changed (blob<->module)
                        test $status = D -o $status = T && echo "$sm_path" && continue
+                       # Respect the ignore setting for --for-status.
+                       if test -n $for_status
+                       then
+                               name=$(module_name "$sm_path")
+                               ignore_config=$(get_submodule_config "$name" ignore none)
+                               test $status != A -a $ignore_config = all && continue
+                       fi

Because of the missing quotes around $for_status, it seems the test is
unconditionnaly true:

$ test -n t ; echo $?
0
$ test -n   ; echo $?
0

This makes me wonder why the ignore configuration should be considered
only with --for-status. Why not turn that into

--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -1036,6 +1036,13 @@ cmd_summary() {
                do
                        # Always show modules deleted or type-changed (blob<->module)
                        test $status = D -o $status = T && echo "$sm_path" && continue
+			# Respect the ignore setting
+			name=$(module_name "$sm_path")
+			ignore_config=$(get_submodule_config "$name" ignore none)
+			test $status != A -a $ignore_config = all && continue

?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]