git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git status: Fix false positive "new commits" output for dirty submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2010, 20:04 UTC
Message-ID
<7v3a061v7m.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4B9909F6.5090104@web.de>
Jens Lehmann <Jens.Lehmann@web.de> writes:
> Another way to fix this bug would have been to enter the correct sha1
> into two->sha1 for submodules with new commits.

I didn't follow all the codepaths involved, but it might be worth a try. The beginning of the patch may look something like this, and then you would probably have to fix potential fallouts in diff.c from this change.

 diff-lib.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/diff-lib.c b/diff-lib.c
index d7e13cb..a147d9c 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -182,10 +182,9 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
 		    && !DIFF_OPT_TST(&revs->diffopt, IGNORE_SUBMODULES)
 		    && (!changed || (revs->diffopt.output_format & DIFF_FORMAT_PATCH))
 		    && is_submodule_modified(ce->name)) {
-			changed = 1;
 			dirty_submodule = 1;
 		}
-		if (!changed) {
+		if (!changed && !dirty_submodule) {
 			ce_mark_uptodate(ce);
 			if (!DIFF_OPT_TST(&revs->diffopt, FIND_COPIES_HARDER))
 				continue;
Previous: Jens LehmannNext: Junio C Hamano
Message 2 of 4 in “git status: Fix false positive "new commits" output for dirty submodules”
  1. git status: Fix false positive "new commits" output for dirty submodulesJens Lehmann, Mar 11, 2010
  2. Junio C HamanoMar 11, 2010
  3. Junio C HamanoMar 11, 2010
  4. git status: Fix false positive "new commits" output for dirty submodulesJens Lehmann, Mar 12, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.