git-submodule.sh: break overly long command lines
For most of the subcommands of git-submodule(1), we end up passing a bunch of arguments to the submodule helper. This quickly leads to overly long lines, where it becomes hard to spot what has changed when one needs to modify them. Break up these lines into one argument per line, similarly to how it is done for the "clone" subcommand already. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Aug 8, 2024 at 09:35 UTC
d9ab8788e1dbc47968235b33a051e76c735961b0
1 file changed
+55
-9
git-submodule.sh
+55
-9
@@ -129,7 +129,17 @@ cmd_add()
129
usage
130
fi
131
132
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper add ${quiet:+--quiet} ${force:+--force} ${progress:+"--progress"} ${branch:+--branch "$branch"} ${reference_path:+--reference "$reference_path"} ${dissociate:+--dissociate} ${custom_name:+--name "$custom_name"} ${depth:+"$depth"} -- "$@"
132
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper add \
133
+ ${quiet:+--quiet} \
134
+ ${force:+--force} \
135
+ ${progress:+"--progress"} \
136
+ ${branch:+--branch "$branch"} \
137
+ ${reference_path:+--reference "$reference_path"} \
138
+ ${dissociate:+--dissociate} \
139
+ ${custom_name:+--name "$custom_name"} \
140
+ ${depth:+"$depth"} \
141
+ -- \
142
+ "$@"
143
}
144
145
#
@@ -160,7 +170,11 @@ cmd_foreach()
170
shift
171
done
172
163
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper foreach ${quiet:+--quiet} ${recursive:+--recursive} -- "$@"
173
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper foreach \
174
+ ${quiet:+--quiet} \
175
+ ${recursive:+--recursive} \
176
+ -- \
177
+ "$@"
178
}
179
180
#
@@ -191,7 +205,10 @@ cmd_init()
205
shift
206
done
207
194
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper init ${quiet:+--quiet} -- "$@"
208
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper init \
209
+ ${quiet:+--quiet} \
210
+ -- \
211
+ "$@"
212
}
213
214
#
@@ -227,7 +244,12 @@ cmd_deinit()
244
shift
245
done
246
230
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper deinit ${quiet:+--quiet} ${force:+--force} ${deinit_all:+--all} -- "$@"
247
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper deinit \
248
+ ${quiet:+--quiet} \
249
+ ${force:+--force} \
250
+ ${deinit_all:+--all} \
251
+ -- \
252
+ "$@"
253
}
254
255
#
@@ -399,7 +421,12 @@ cmd_set_branch() {
421
shift
422
done
423
402
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-branch ${quiet:+--quiet} ${branch:+--branch "$branch"} ${default:+--default} -- "$@"
424
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-branch \
425
+ ${quiet:+--quiet} \
426
+ ${branch:+--branch "$branch"} \
427
+ ${default:+--default} \
428
+ -- \
429
+ "$@"
430
}
431
432
#
@@ -428,7 +455,10 @@ cmd_set_url() {
455
shift
456
done
457
431
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-url ${quiet:+--quiet} -- "$@"
458
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-url \
459
+ ${quiet:+--quiet} \
460
+ -- \
461
+ "$@"
462
}
463
464
#
@@ -480,7 +510,13 @@ cmd_summary() {
510
shift
511
done
512
483
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper summary ${files:+--files} ${cached:+--cached} ${for_status:+--for-status} ${summary_limit:+-n $summary_limit} -- "$@"
513
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper summary \
514
+ ${files:+--files} \
515
+ ${cached:+--cached} \
516
+ ${for_status:+--for-status} \
517
+ ${summary_limit:+-n $summary_limit} \
518
+ -- \
519
+ "$@"
520
}
521
#
522
# List all submodules, prefixed with:
@@ -521,8 +557,14 @@ cmd_status()
557
shift
558
done
559
524
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper status ${quiet:+--quiet} ${cached:+--cached} ${recursive:+--recursive} -- "$@"
560
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper status \
561
+ ${quiet:+--quiet} \
562
+ ${cached:+--cached} \
563
+ ${recursive:+--recursive} \
564
+ -- \
565
+ "$@"
566
}
567
+
568
#
569
# Sync remote urls for submodules
570
# This makes the value for remote.$remote.url match the value
@@ -554,7 +596,11 @@ cmd_sync()
596
esac
597
done
598
557
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper sync ${quiet:+--quiet} ${recursive:+--recursive} -- "$@"
599
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper sync \
600
+ ${quiet:+--quiet} \
601
+ ${recursive:+--recursive} \
602
+ -- \
603
+ "$@"
604
}
605
606
cmd_absorbgitdirs()