From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Lehmann Subject: [PATCH] Updates for dirty submodules in release notes and user manual Date: Mon, 01 Feb 2010 19:09:39 +0100 Message-ID: <4B6718E3.1060403@web.de> References: <7vaavvi4r5.fsf@alter.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: git@vger.kernel.org To: Junio C Hamano X-From: git-owner@vger.kernel.org Mon Feb 01 19:09:58 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nc0ij-0007TV-H5 for gcvg-git-2@lo.gmane.org; Mon, 01 Feb 2010 19:09:57 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754923Ab0BASJx (ORCPT ); Mon, 1 Feb 2010 13:09:53 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:48815 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754402Ab0BASJw (ORCPT ); Mon, 1 Feb 2010 13:09:52 -0500 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate01.web.de (Postfix) with ESMTP id A3A28145F1BDC; Mon, 1 Feb 2010 19:09:39 +0100 (CET) Received: from [80.128.107.148] (helo=[192.168.178.26]) by smtp07.web.de with asmtp (WEB.DE 4.110 #314) id 1Nc0iR-0007kx-00; Mon, 01 Feb 2010 19:09:39 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 In-Reply-To: <7vaavvi4r5.fsf@alter.siamese.dyndns.org> X-Sender: Jens.Lehmann@web.de X-Provags-ID: V01U2FsdGVkX1+12VUzfRnq5kESMPBpxX6vkqA9N2JMxOH2XMDD pulP54sHs3K+xqj6NfVuebMc2vepFgNib45WD5vybFEl1f6S9P R6V//dVeUgArFeFe1Oxw== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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 --- Documentation/RelNotes-1.7.0.txt | 12 +++++++----- Documentation/user-manual.txt | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Documentation/RelNotes-1.7.0.txt b/Documentation/RelNotes-1.7.0.txt index 6510d42..323ae54 100644 --- a/Documentation/RelNotes-1.7.0.txt +++ b/Documentation/RelNotes-1.7.0.txt @@ -200,11 +200,13 @@ release, unless otherwise noted. from non-root dir, 2010-01-26) may be merged to older maintenance branches. - * When "git diff" is asked to compare the work tree with something, - it used to consider that a checked-out submodule with uncommitted - changes is not modified; this could cause people to forget committing - these changes in the submodule before committing in the superproject. - It now considers such a change as a modification. + * When using "git status" or asking "git diff" to compare the work tree + with something, they used to consider that a checked-out submodule with + uncommitted changes is not modified; this could cause people to forget + committing these changes in the submodule before committing in the + superproject. They now consider such a change as a modification and + "git diff" will append a "-dirty" to the work tree side when generating + patch output or when used with the --submodule option. -- exec >/var/tmp/1 diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 517daca..fe6fb72 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -3640,6 +3640,26 @@ Did you forget to 'git add'? Unable to checkout '261dfac35cb99d380eb966e102c1197139f7fa24' in submodule path 'a' ------------------------------------------------- +In older git versions it could be easily forgotten to commit new or modified +files in a submodule, which silently leads to similar problems as not pushing +the submodule changes. Starting with git 1.7.0 both "git status" and "git diff" +in the superproject show submodules as modified when they contain new or +modified files to protect against accidentally committing such a state. "git +diff" will also add a "-dirty" to the work tree side when generating patch +output or used with the --submodule option: + +------------------------------------------------- +$ git diff +diff --git a/sub b/sub +--- a/sub ++++ b/sub +@@ -1 +1 @@ +-Subproject commit 3f356705649b5d566d97ff843cf193359229a453 ++Subproject commit 3f356705649b5d566d97ff843cf193359229a453-dirty +$ git diff --submodule +Submodule sub 3f35670..3f35670-dirty: +------------------------------------------------- + You also should not rewind branches in a submodule beyond commits that were ever recorded in any superproject. -- 1.7.0.rc1.156.g05baa