@matheusbsbs / matheus-bagliano / commits / 8d9e7d5293
Fork 0

Updates for dirty submodules in release notes and user manual

In the release notes "git status" was not mentioned, also shortly explain the "-dirty" output generated by diff. Added a paragraph to the "Pitfalls with submodules" section in user-manual.txt describing new and old behavior of "git status" and "git diff" for dirty submodules. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jens Lehmann committed Feb 1, 2010 at 19:09 UTC 8d9e7d5293d6a8b50c9e0eb8e23ef5fed45c86d0
2 files changed +27 -5
Documentation/RelNotes-1.7.0.txt
+7 -5
@@ -200,11 +200,13 @@ release, unless otherwise noted.
200 from non-root dir, 2010-01-26) may be merged to older maintenance
201 branches.
202
203 - * When "git diff" is asked to compare the work tree with something,
204 - it used to consider that a checked-out submodule with uncommitted
205 - changes is not modified; this could cause people to forget committing
206 - these changes in the submodule before committing in the superproject.
207 - It now considers such a change as a modification.
203 + * When using "git status" or asking "git diff" to compare the work tree
204 + with something, they used to consider that a checked-out submodule with
205 + uncommitted changes is not modified; this could cause people to forget
206 + committing these changes in the submodule before committing in the
207 + superproject. They now consider such a change as a modification and
208 + "git diff" will append a "-dirty" to the work tree side when generating
209 + patch output or when used with the --submodule option.
210
211 --
212 exec >/var/tmp/1
Documentation/user-manual.txt
+20
@@ -3640,6 +3640,26 @@ Did you forget to 'git add'?
3640 Unable to checkout '261dfac35cb99d380eb966e102c1197139f7fa24' in submodule path 'a'
3641 -------------------------------------------------
3642
3643 +In older git versions it could be easily forgotten to commit new or modified
3644 +files in a submodule, which silently leads to similar problems as not pushing
3645 +the submodule changes. Starting with git 1.7.0 both "git status" and "git diff"
3646 +in the superproject show submodules as modified when they contain new or
3647 +modified files to protect against accidentally committing such a state. "git
3648 +diff" will also add a "-dirty" to the work tree side when generating patch
3649 +output or used with the --submodule option:
3650 +
3651 +-------------------------------------------------
3652 +$ git diff
3653 +diff --git a/sub b/sub
3654 +--- a/sub
3655 ++++ b/sub
3656 +@@ -1 +1 @@
3657 +-Subproject commit 3f356705649b5d566d97ff843cf193359229a453
3658 ++Subproject commit 3f356705649b5d566d97ff843cf193359229a453-dirty
3659 +$ git diff --submodule
3660 +Submodule sub 3f35670..3f35670-dirty:
3661 +-------------------------------------------------
3662 +
3663 You also should not rewind branches in a submodule beyond commits that were
3664 ever recorded in any superproject.
3665