Re: [PATCH v3 0/2] Doc/submodules: a few updates

2018-01-16 Thread Kaartic Sivaraam
On Wednesday 17 January 2018 01:32 AM, Junio C Hamano wrote:
> I had a few "Huh?"
> moments while reading the resulting text, but nothing show-stopping.
> 

It always happens when there are people around who are trying to be over
careful :)

Anyways, it's only now that I remember that I've missed a change that I
thought of doing. The change is about clarifying what a "de-initialized"
submodule means and what an "inactive" submodule means and how they work
together (IIUC, a submodule has not active flag when its deinitialized).
I foresee people confusing 'init' and 'active'. So, I thought the
documentation should be helpful enough in that aspect.
Documenation/gitsubmodules doesn't seem to be talking much about 'init'.
(It talks about 'active' a lot after these patches :)

Now I think it's better to do that as separate change and move this
forward as I don't want to make this clumsy anymore. Please let me know,
if I'm over thinking things again. :)

-- 
Kaartic



signature.asc
Description: OpenPGP digital signature


Re: [PATCH v3 0/2] Doc/submodules: a few updates

2018-01-16 Thread Junio C Hamano
Kaartic Sivaraam  writes:

> These are just a few improvements that I thought would make the 
> documentation
> related to submodules a little better in various way such as readability,
> consistency etc., These were things I noticed while reading thise 
> documents.

Overall they look like reasonable improvements.  I had a few "Huh?"
moments while reading the resulting text, but nothing show-stopping.


[PATCH v3 0/2] Doc/submodules: a few updates

2018-01-14 Thread Kaartic Sivaraam
Quoting from v1,

These are just a few improvements that I thought would make the 
documentation
related to submodules a little better in various way such as readability,
consistency etc., These were things I noticed while reading thise documents.

Changes since v2:

   - Made some changes suggested by Stefan.
   - A few more that caught my eyes.

Inter diff between v2 and v3:

diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 801d291ca..71c5618e8 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -70,8 +70,8 @@ status [--cached] [--recursive] [--] [...]::
Show the status of the submodules. This will print the SHA-1 of the
currently checked out commit for each submodule, along with the
submodule path and the output of 'git describe' for the
-   SHA-1. Each SHA-1 will be prefixed with `-` if the submodule is not
-   initialized, `+` if the currently checked out submodule commit
+   SHA-1. Each SHA-1 will possibly be prefixed with `-` if the submodule is
+   not initialized, `+` if the currently checked out submodule commit
does not match the SHA-1 found in the index of the containing
repository and `U` if the submodule has merge conflicts.
 +
diff --git a/Documentation/gitsubmodules.txt b/Documentation/gitsubmodules.txt
index ce2369c2d..47bbc62e8 100644
--- a/Documentation/gitsubmodules.txt
+++ b/Documentation/gitsubmodules.txt
@@ -101,7 +101,7 @@ remotes are configured in the submodule as usual in the 
`$GIT_DIR/config`
 file.
 
  * The configuration file `$GIT_DIR/config` in the superproject.
-   Git only recurses into active submodules (see 'ACTIVE SUBMODULES'
+   Git only recurses into active submodules (see "ACTIVE SUBMODULES"
section below).
 +
 If the submodule is not yet initialized, then the configuration
@@ -164,52 +164,59 @@ from another repository.
 To completely remove a submodule, manually delete
 `$GIT_DIR/modules//`.
 
-Active submodules
+ACTIVE SUBMODULES
 -
 
 A submodule is considered active,
 
-  (a) if `submodule..active` is set
+  (a) if `submodule..active` is set to `true`
  or
-  (b) if the submodules path matches the pathspec in `submodule.active`
+  (b) if the submodule's path matches the pathspec in `submodule.active`
  or
   (c) if `submodule..url` is set.
 
+and these are evaluated in this order.
+
 For example:
 
-[submodule "foo"]
-active = false
-url = https://example.org/foo
-[submodule "bar"]
-active = true
-url = https://example.org/bar
-[submodule "baz"]
-url = https://example.org/baz
+  [submodule "foo"]
+active = false
+url = https://example.org/foo
+  [submodule "bar"]
+active = true
+url = https://example.org/bar
+  [submodule "baz"]
+url = https://example.org/baz
 
-In the above config only the submodule bar and baz are active,
-bar due to (a) and baz due to (c).
+In the above config only the submodule 'bar' and 'baz' are active,
+'bar' due to (a) and 'baz' due to (c). 'foo' is inactive because
+(a) takes precedence over (c).
 
-Note that '(c)' is a historical artefact and will be ignored if the
-pathspec set in (b) excludes the submodule. For example:
+Note that (c) is a historical artefact and will be ignored if the
+(a) and (b) specify that the submodule is not active. In other words,
+if we have an `submodule..active` set to `false` or if the
+submodule's path is excluded in the pathspec in `submodule.active`, the
+url doesn't matter whether it is present or not. This is illustrated in
+the example that follows.
 
-[submodule "foo"]
-active = true
-url = https://example.org/foo
-[submodule "bar"]
-url = https://example.org/bar
-[submodule "baz"]
-url = https://example.org/baz
-[submodule "bob"]
-ignore = true
-[submodule]
-active = b*
-active = (:exclude) baz
+  [submodule "foo"]
+active = true
+url = https://example.org/foo
+  [submodule "bar"]
+url = https://example.org/bar
+  [submodule "baz"]
+url = https://example.org/baz
+  [submodule "bob"]
+ignore = true
+  [submodule]
+active = b*
+active = :(exclude) baz
 
-In here all submodules except baz (foo, bar, bob) are active.
+In here all submodules except 'baz' (foo, bar, bob) are active.
 'foo' due to its own active flag and all the others due to the
 submodule active pathspec, which specifies that any submodule
-starting with 'b' except 'baz' are also active, no matter if
-the .url field is present.
+starting with 'b' except 'baz' are also active, regardless of the
+presence of the .url field.
 
 Workflow for a third party library
 --



Kaartic Sivaraam (2):
  Doc/gitsubmodules: make some changes to improve readability and syntax
  Doc/git-submodule: improve readability and grammar of a sentence

 Documentation/git-submodule.txt |  16