Merge branch 'bc/submodule-status-ignored'
* bc/submodule-status-ignored: Improve documentation concerning the status.submodulesummary setting submodule: don't print status output with ignore=all submodule: fix confusing variable name
This commit is contained in:
commit
5636a20070
@ -2214,7 +2214,14 @@ status.submodulesummary::
|
|||||||
If this is set to a non zero number or true (identical to -1 or an
|
If this is set to a non zero number or true (identical to -1 or an
|
||||||
unlimited number), the submodule summary will be enabled and a
|
unlimited number), the submodule summary will be enabled and a
|
||||||
summary of commits for modified submodules will be shown (see
|
summary of commits for modified submodules will be shown (see
|
||||||
--summary-limit option of linkgit:git-submodule[1]).
|
--summary-limit option of linkgit:git-submodule[1]). Please note
|
||||||
|
that the summary output command will be suppressed for all
|
||||||
|
submodules when `diff.ignoreSubmodules` is set to 'all' or only
|
||||||
|
for those submodules where `submodule.<name>.ignore=all`. To
|
||||||
|
also view the summary for ignored submodules you can either use
|
||||||
|
the --ignore-submodules=dirty command line option or the 'git
|
||||||
|
submodule summary' command, which shows a similar output but does
|
||||||
|
not honor these settings.
|
||||||
|
|
||||||
submodule.<name>.path::
|
submodule.<name>.path::
|
||||||
submodule.<name>.url::
|
submodule.<name>.url::
|
||||||
@ -2249,7 +2256,8 @@ submodule.<name>.ignore::
|
|||||||
submodules that have untracked files in their work tree as changed.
|
submodules that have untracked files in their work tree as changed.
|
||||||
This setting overrides any setting made in .gitmodules for this submodule,
|
This setting overrides any setting made in .gitmodules for this submodule,
|
||||||
both settings can be overridden on the command line by using the
|
both settings can be overridden on the command line by using the
|
||||||
"--ignore-submodules" option.
|
"--ignore-submodules" option. The 'git submodule' commands are not
|
||||||
|
affected by this setting.
|
||||||
|
|
||||||
tar.umask::
|
tar.umask::
|
||||||
This variable can be used to restrict the permission bits of
|
This variable can be used to restrict the permission bits of
|
||||||
|
@ -73,7 +73,11 @@ diff.ignoreSubmodules::
|
|||||||
Sets the default value of --ignore-submodules. Note that this
|
Sets the default value of --ignore-submodules. Note that this
|
||||||
affects only 'git diff' Porcelain, and not lower level 'diff'
|
affects only 'git diff' Porcelain, and not lower level 'diff'
|
||||||
commands such as 'git diff-files'. 'git checkout' also honors
|
commands such as 'git diff-files'. 'git checkout' also honors
|
||||||
this setting when reporting uncommitted changes.
|
this setting when reporting uncommitted changes. Setting it to
|
||||||
|
'all' disables the submodule summary normally shown by 'git commit'
|
||||||
|
and 'git status' when 'status.submodulesummary' is set unless it is
|
||||||
|
overridden by using the --ignore-submodules command line option.
|
||||||
|
The 'git submodule' commands are not affected by this setting.
|
||||||
|
|
||||||
diff.mnemonicprefix::
|
diff.mnemonicprefix::
|
||||||
If set, 'git diff' uses a prefix pair that is different from the
|
If set, 'git diff' uses a prefix pair that is different from the
|
||||||
|
@ -210,7 +210,13 @@ directory.
|
|||||||
If `status.submodulesummary` is set to a non zero number or true (identical
|
If `status.submodulesummary` is set to a non zero number or true (identical
|
||||||
to -1 or an unlimited number), the submodule summary will be enabled for
|
to -1 or an unlimited number), the submodule summary will be enabled for
|
||||||
the long format and a summary of commits for modified submodules will be
|
the long format and a summary of commits for modified submodules will be
|
||||||
shown (see --summary-limit option of linkgit:git-submodule[1]).
|
shown (see --summary-limit option of linkgit:git-submodule[1]). Please note
|
||||||
|
that the summary output from the status command will be suppressed for all
|
||||||
|
submodules when `diff.ignoreSubmodules` is set to 'all' or only for those
|
||||||
|
submodules where `submodule.<name>.ignore=all`. To also view the summary for
|
||||||
|
ignored submodules you can either use the --ignore-submodules=dirty command
|
||||||
|
line option or the 'git submodule summary' command, which shows a similar
|
||||||
|
output but does not honor these settings.
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
--------
|
--------
|
||||||
|
@ -75,7 +75,8 @@ submodule.<name>.ignore::
|
|||||||
the superproject, the setting there will override the one found in
|
the superproject, the setting there will override the one found in
|
||||||
.gitmodules.
|
.gitmodules.
|
||||||
Both settings can be overridden on the command line by using the
|
Both settings can be overridden on the command line by using the
|
||||||
"--ignore-submodule" option.
|
"--ignore-submodule" option. The 'git submodule' commands are not
|
||||||
|
affected by this setting.
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
|
@ -1032,13 +1032,20 @@ cmd_summary() {
|
|||||||
# Get modified modules cared by user
|
# Get modified modules cared by user
|
||||||
modules=$(git $diff_cmd $cached --ignore-submodules=dirty --raw $head -- "$@" |
|
modules=$(git $diff_cmd $cached --ignore-submodules=dirty --raw $head -- "$@" |
|
||||||
sane_egrep '^:([0-7]* )?160000' |
|
sane_egrep '^:([0-7]* )?160000' |
|
||||||
while read mod_src mod_dst sha1_src sha1_dst status name
|
while read mod_src mod_dst sha1_src sha1_dst status sm_path
|
||||||
do
|
do
|
||||||
# Always show modules deleted or type-changed (blob<->module)
|
# Always show modules deleted or type-changed (blob<->module)
|
||||||
test $status = D -o $status = T && echo "$name" && continue
|
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
|
||||||
# Also show added or modified modules which are checked out
|
# Also show added or modified modules which are checked out
|
||||||
GIT_DIR="$name/.git" git-rev-parse --git-dir >/dev/null 2>&1 &&
|
GIT_DIR="$sm_path/.git" git-rev-parse --git-dir >/dev/null 2>&1 &&
|
||||||
echo "$name"
|
echo "$sm_path"
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -104,6 +104,24 @@ EOF
|
|||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
"
|
"
|
||||||
|
|
||||||
|
test_expect_success 'no ignore=all setting has any effect' "
|
||||||
|
git config -f .gitmodules submodule.sm1.path sm1 &&
|
||||||
|
git config -f .gitmodules submodule.sm1.ignore all &&
|
||||||
|
git config submodule.sm1.ignore all &&
|
||||||
|
git config diff.ignoreSubmodules all &&
|
||||||
|
git submodule summary >actual &&
|
||||||
|
cat >expected <<-EOF &&
|
||||||
|
* sm1 $head1...$head2 (1):
|
||||||
|
> Add foo3
|
||||||
|
|
||||||
|
EOF
|
||||||
|
test_cmp expected actual &&
|
||||||
|
git config --unset diff.ignoreSubmodules &&
|
||||||
|
git config --remove-section submodule.sm1 &&
|
||||||
|
git config -f .gitmodules --remove-section submodule.sm1
|
||||||
|
"
|
||||||
|
|
||||||
|
|
||||||
commit_file sm1 &&
|
commit_file sm1 &&
|
||||||
head3=$(
|
head3=$(
|
||||||
cd sm1 &&
|
cd sm1 &&
|
||||||
|
@ -1380,7 +1380,7 @@ EOF
|
|||||||
test_i18ncmp expect output
|
test_i18ncmp expect output
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '
|
test_expect_success '.gitmodules ignore=all suppresses submodule summary' '
|
||||||
git config --add -f .gitmodules submodule.subname.ignore all &&
|
git config --add -f .gitmodules submodule.subname.ignore all &&
|
||||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||||
git status > output &&
|
git status > output &&
|
||||||
@ -1388,7 +1388,7 @@ test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '
|
|||||||
git config -f .gitmodules --remove-section submodule.subname
|
git config -f .gitmodules --remove-section submodule.subname
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_failure '.git/config ignore=all suppresses submodule summary' '
|
test_expect_success '.git/config ignore=all suppresses submodule summary' '
|
||||||
git config --add -f .gitmodules submodule.subname.ignore none &&
|
git config --add -f .gitmodules submodule.subname.ignore none &&
|
||||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||||
git config --add submodule.subname.ignore all &&
|
git config --add submodule.subname.ignore all &&
|
||||||
|
Loading…
Reference in New Issue
Block a user