Skip to content

Commit ee84190

Browse files
committed
Documentation: add --include_ignored_submodules + ignore=all config
- git-add.adoc: Add new documentation for --include_ignored_submodules option to supress ignore=all and new submodule functionality of not adding a ignore=all submodule by default. - gitmodules.adoc and config/submodule.adoc: The submodule config ignore=all now need --include_ignored_submodules in order to update the index. Signed-off-by: Claus Schneider(Eficode) <claus.schneider@eficode.com>
1 parent 93c9595 commit ee84190

File tree

6 files changed

+187
-7
lines changed

6 files changed

+187
-7
lines changed

.devcontainer/Dockerfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
FROM ubuntu:latest
2+
3+
ARG USER_ID
4+
ARG GROUP_ID
5+
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
ENV TZ=Europe/Copenhagen
8+
9+
RUN apt-get update \
10+
&& \
11+
apt-get install -y \
12+
sudo \
13+
build-essential \
14+
libcurl4-gnutls-dev \
15+
libexpat1-dev \
16+
gettext \
17+
libz-dev \
18+
libssl-dev \
19+
asciidoc \
20+
xmlto \
21+
docbook-xsl \
22+
\
23+
tzdata \
24+
git \
25+
coccinelle \
26+
&& \
27+
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime \
28+
&& \
29+
dpkg-reconfigure --frontend noninteractive tzdata
30+
31+
RUN apt-get update && apt-get install -y autoconf
32+
33+
RUN addgroup -gid 1001 gituser
34+
RUN adduser --disabled-password -u 1001 -gid 1001 gituser
35+
RUN usermod -aG sudo gituser
36+
RUN echo 'gituser ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/010-gituser
37+
RUN chmod 0440 /etc/sudoers.d/010-gituser
38+
39+
USER 1001
40+
41+
#WORKDIR /home/gituser/git-src/
42+
43+
#RUN make configure
44+
#RUN ./configure --prefix=${HOME}/.local/
45+
46+
#RUN make -j$(nproc) gitweb || make gitweb
47+
#RUN make install-gitweb
48+
49+
#RUN make -j$(nproc) || make
50+
#RUN make -j$(nproc) gitweb || make gitweb
51+
#RUN make install-gitweb
52+
#RUN make -j$(nproc) NO_PERL=YesPlease install || make NO_PERL=YesPlease install
53+
#RUN make install
54+
55+
56+
RUN mkdir -p ${HOME}/.local/
57+
#RUN ls -la ${HOME}/.local/bin
58+
#ENV PATH="/home/gituser/.local/bin:${PATH}"
59+
#RUN ls -l $HOME/.local/bin
60+
#RUN echo $PATH $HOME
61+
62+
#RUN git --version
63+
#RUN which git
64+
65+
RUN git config --global user.email "gituser@example.com"
66+
RUN git config --global user.name "Git User"
67+
68+
#WORKDIR /home/gituser/git-test/
69+
70+
#CMD [ "git" ]
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
FROM ubuntu:latest
2+
3+
ARG USER_ID
4+
ARG GROUP_ID
5+
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
ENV TZ=Europe/Copenhagen
8+
9+
RUN apt-get update \
10+
&& \
11+
apt-get install -y \
12+
build-essential \
13+
libcurl4-gnutls-dev \
14+
libexpat1-dev \
15+
gettext \
16+
libz-dev \
17+
libssl-dev \
18+
asciidoc \
19+
xmlto \
20+
docbook-xsl \
21+
\
22+
tzdata \
23+
\
24+
nano \
25+
vim \
26+
&& \
27+
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime \
28+
&& \
29+
dpkg-reconfigure --frontend noninteractive tzdata
30+
31+
RUN apt-get update && apt-get install -y autoconf
32+
33+
RUN addgroup -gid ${GROUP_ID} gituser
34+
RUN adduser --disabled-password -u ${USER_ID} -gid ${GROUP_ID} gituser
35+
36+
37+
COPY --chown=${USER_ID}:${GROUP_ID} ./git /home/gituser/git-src/
38+
39+
USER ${USER_ID}
40+
41+
WORKDIR /home/gituser/git-src/
42+
43+
RUN make configure
44+
RUN ./configure --prefix=${HOME}/.local/
45+
46+
#RUN make -j$(nproc) gitweb || make gitweb
47+
#RUN make install-gitweb
48+
49+
#RUN make -j$(nproc) || make
50+
#RUN make -j$(nproc) gitweb || make gitweb
51+
#RUN make install-gitweb
52+
RUN make -j$(nproc) NO_PERL=YesPlease install || make NO_PERL=YesPlease install
53+
RUN make install
54+
55+
WORKDIR /home/gituser/git-src/t
56+
RUN ./t2206-add-submodule-ignored.sh -v
57+
58+
RUN ls -la ${HOME}/.local/
59+
RUN ls -la ${HOME}/.local/bin
60+
ENV PATH="/home/gituser/.local/bin:${PATH}"
61+
RUN ls -l $HOME/.local/bin
62+
RUN echo $PATH $HOME
63+
64+
RUN git --version
65+
RUN which git
66+
67+
RUN git config --global user.email "gituser@example.com"
68+
RUN git config --global user.name "Git User"
69+
70+
WORKDIR /home/gituser/git-src/t
71+
RUN pwd && ls -la
72+
RUN ./t2206-add-submodule-ignored.sh -v
73+
74+
WORKDIR /home/gituser/git-test/
75+
76+
CMD [ "git" ]

.devcontainer/devcontainer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "Git Dev Container",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "",
6+
"args": {
7+
"user_id": "1001",
8+
"group_id": "1001"
9+
}
10+
},
11+
"customizations": {
12+
"vscode": {
13+
"settings": {
14+
"terminal.integrated.shell.linux": "/bin/bash"
15+
}
16+
}
17+
},
18+
"remoteUser": "gituser",
19+
"features": {},
20+
"mounts": [
21+
"source=${localWorkspaceFolder}/,target=/home/gitusers/git-src,type=bind,consistency=cached",
22+
"source=${localWorkspaceFolder}/,target=/home/gitusers/git-test,type=bind,consistency=cached"
23+
],
24+
"postCreateCommand": "echo"
25+
}

Documentation/config/submodule.adoc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@ submodule.<name>.fetchRecurseSubmodules::
3232

3333
submodule.<name>.ignore::
3434
Defines under what circumstances "git status" and the diff family show
35-
a submodule as modified. When set to "all", it will never be considered
36-
modified (but it will nonetheless show up in the output of status and
37-
commit when it has been staged), "dirty" will ignore all changes
38-
to the submodule's work tree and
35+
a submodule as modified.
36+
Set to "all" will never considered the submodule modified. It can
37+
nevertheless be staged using the option --include_ignored_submodules and
38+
it will then show up in the output of status.
39+
Set to "dirty" will ignore all changes to the submodule's work tree and
3940
takes only differences between the HEAD of the submodule and the commit
4041
recorded in the superproject into account. "untracked" will additionally
4142
let submodules with modified tracked files in their work tree show up.
42-
Using "none" (the default when this option is not set) also shows
43-
submodules that have untracked files in their work tree as changed.
43+
Set to "none"(default) It is also shows submodules that have untracked
44+
files in their work tree as changed.
4445
This setting overrides any setting made in .gitmodules for this submodule,
4546
both settings can be overridden on the command line by using the
4647
"--ignore-submodules" option. The 'git submodule' commands are not

Documentation/git-add.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ in linkgit:gitglossary[7].
7979
`--force`::
8080
Allow adding otherwise ignored files.
8181

82+
`--include_ignored_submodules`::
83+
The option is also used when `submodule.<name>.ignore=all`
84+
is set, but you want to stage an update of the submodule. The
85+
`path` to the submodule must be explicitly specified.
86+
8287
`--sparse`::
8388
Allow updating index entries outside of the sparse-checkout cone.
8489
Normally, `git add` refuses to update index entries whose paths do

Documentation/gitmodules.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ submodule.<name>.ignore::
7070
--
7171
all;; The submodule will never be considered modified (but will
7272
nonetheless show up in the output of status and commit when it has
73-
been staged).
73+
been staged). Add `(new commits)` can be overruled using the
74+
`git add --include_ignored_submodules <submodule.path>`
75+
The setting affects `status`, `update-index`, `diff` and `log`(due
76+
to underlaying `diff`).
7477

7578
dirty;; All changes to the submodule's work tree will be ignored, only
7679
committed differences between the `HEAD` of the submodule and its

0 commit comments

Comments
 (0)