submodules: overhaul documentation
PATCH v3 1/1 submodules: overhaul documentation
This patch aims to detangle (a) the usage of git-submodule from (b) the concept of submodules and (c) how the actual implementation looks like, such as where they are configured and (d) what the best practices are.
To do so, move the conceptual parts of the 'git-submodule' man page to a new man page gitsubmodules(7). This new page is just like gitmodules(5), gitattributes(5), gitcredentials(7), gitnamespaces(7), gittutorial(7), which introduce a concept rather than explaining a specific command.
---
Implemented all but one point, that Jonathan remarked. The point not implemented was addressed and reasoned about at
https://public-inbox.org/git/CAGZ79kYbjYyFk5-z+68iUqM=U8dgnDEzReS9aTshXb97Co+RqQ@mail.gmail.com/
Thanks,
Stefan
Documentation/Makefile | 1 + Documentation/git-rm.txt | 4 +- Documentation/git-submodule.txt | 44 +++------- Documentation/gitsubmodules.txt | 190 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 203 insertions(+), 36 deletions(-) create mode 100644 Documentation/gitsubmodules.txt
Documentation/Makefile +1 -0
@@ -31,6 +31,7 @@ MAN7_TXT += giteveryday.txt MAN7_TXT += gitglossary.txt MAN7_TXT += gitnamespaces.txt MAN7_TXT += gitrevisions.txt +MAN7_TXT += gitsubmodules.txt MAN7_TXT += gittutorial-2.txt MAN7_TXT += gittutorial.txt MAN7_TXT += gitworkflows.txt
Documentation/git-rm.txt +2 -2
@@ -152,8 +152,8 @@ Ignored files are deemed expendable and won't stop a submodule's work tree from being removed. If you only want to remove the local checkout of a submodule from your -work tree without committing the removal, -use linkgit:git-submodule[1] `deinit` instead. +work tree without committing the removal, use linkgit:git-submodule[1] `deinit` +instead. Also see linkgit:gitsubmodules[7] for details on submodule removal. EXAMPLES --------
Documentation/git-submodule.txt +10 -34
68 lines not on this page · raw message
Documentation/gitsubmodules.txt new file +190 -0
190 lines not on this page · raw message
Signature · 1 line
2.12.2.575.gb14f27f917
Documentation/gitsubmodules.txt line 21
Quoted 6 lines · Stefan Beller
Documentation/gitsubmodules.txt new file +6
-0+DESCRIPTION +----------- + +A submodule is another Git repository tracked inside a repository. +The tracked repository has its own history, which does not +interfere with the history of the current repository.
As a naive reader, I have/got no idea what it means to "interfere (or not to interfere) with the history of the current repository."
Quoted 1 line
+It consists of a tracking subdirectory in the working directory,
Is a "tracking subdirectory" something special than an ordinary subdirectory? How does a naive reader who experiments with Git tell between a tracking and an ordinary subdirectory?
Or did you mean just "a subdirectory" (which is used to house its working tree)? s/in the working directory/& of the superproject/ or something like that may be needed to disambiguate between the two.
Quoted 1 line
+a
gitlinkobject in the working tree and an entry in the
I am not sure how you two are defining "gitlink object" here, even after reading the previous discussion. You two are not referring to an 'object' in the Git object database sense. If you are referring to the entry with mode 160000 that points at a commit object in the index of the superproject, that is not "in the working tree" but in the index.
Quoted 2 lines
+
.gitmodulesfile (see linkgit:gitmodules[5]) at the root of +the source tree and its git.
Again, as you are describing a submodule and superproject combo, you need to clarify whose "root" you are referring to. I guess this is at the root of superproject's working tree? I have no idea what you wanted to say with "and its git".
I seriously doubt the value of introducing a random new word "tracking subdirectory" without defining what it is in the glossary. The word "tracking" is already overused and with loaded meaning in Git, so even if we need a new word that differenciates a subdirectory used for the submodule from other subdirectories superproject has, we should find a different word (but I do not think we need such a new word---just saying "submodule directory" should be enough).
Documentation/gitsubmodules.txt line 31
Quoted 4 lines
Documentation/gitsubmodules.txt new file +4
-0+The tracking subdirectory appears in the main repository's working +tree at the point where the submodules gitlink is tracked in the +tree. It is empty when the submodule is not populated, otherwise +it contains the content of the submodule repository.
Hmph, "the content of" is probably a too dignified word to use here. A naive reader (like me) would think that "a copy of the submodule repository" would appear at that subdirectory in the superproject once the submodule is populated.
Documentation/gitsubmodules.txt line 42
Quoted 11 lines
Documentation/gitsubmodules.txt new file +11
-0+The main repository is often referred to as superproject. + +The gitlink contains the object name of a particular commit +of the submodule. + +The `.gitmodules` file establishes a relationship between the +path, which is where the gitlink is in the tree, and the logical +name, which is used for the location of the submodules git +directory. The `.gitmodules` file has the same syntax as the +$GIT_DIR/config file and the mapping of path to name +is done via setting `submodule.<name>.path = <path>`.
This is mapping of name to path, though ;-)