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

Re: Latest master failing t7401 submodule tests

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 3, 2010, 21:28 UTC
Message-ID
<7vzl2phz8e.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7v3a0hktga.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 24 quoted lines
> Jeff King <peff@peff.net> writes:
>
>>>  - "git submodule summary path...", defaults to HEAD which is _not_ unborn
>>>    (we shouldn't shift).
>>
>> I don't think this is a problem. We do:
>>
>>   git rev-parse -q --verify --default HEAD path
>>
>> and it correctly reports failure, so we never do the problematic shift.
>
> Stepping back a bit, why do we even special case an unborn branch case in
> the first place?  
>
>     rm -fr one && git init one && cd one && git diff HEAD
>
> would diagnose it as an error (we may want to sugarcoat "ambiguous
> argument" error message, but that is a tangent).
>
> I may be able to buy "status/diff internally calls submodule summary, and
> that codepath needs to special case a submodule on an unborn branch _for
> such and such reasons_" if the reasoning is sound, but even if that is the
> case, shouldn't that special case be triggered explicitly by the caller of
> "submodule summary" with an option?

Continuing to mutter to myself... I am suspecting that the right solution to the issue $gmane/140066 raised may be your "dwim-ref fix in 003c6ab (dwim_ref: fix dangling symref warning, 2010-02-16) and a patch along the line of the attached (with 3deea89 reverted of course).

We _might_ also want to revert 003c6ab, though it is more or less an independent issue.

 wt-status.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index 5807fc3..1cca3aa 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -476,6 +476,9 @@ static void wt_status_print_submodule_summary(struct wt_status *s, int uncommitt
 		NULL
 	};
 
+	if (s->is_initial && !uncommitted)
+		return;
+
 	sprintf(summary_limit, "%d", s->submodule_summary);
 	snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", s->index_file);
 
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 17 in “Latest master failing t7401 submodule tests”
  1. A Large Angry SCMMar 3, 2010
  2. Junio C HamanoMar 3, 2010
  3. Jeff KingMar 3, 2010
  4. Junio C HamanoMar 3, 2010
  5. Jeff KingMar 3, 2010
  6. Junio C HamanoMar 3, 2010
  7. Junio C HamanoMar 3, 2010
  8. What should "git submodule summary" give before an initial commit?Junio C Hamano, Mar 3, 2010
  9. Johan HerlandMar 3, 2010
  10. Jens LehmannMar 4, 2010
  11. Sverre RabbelierMar 4, 2010
  12. Junio C HamanoMar 4, 2010
  13. Sverre RabbelierMar 4, 2010
  14. Junio C HamanoMar 4, 2010
  15. Sverre RabbelierMar 4, 2010
  16. Jeff KingMar 3, 2010
  17. Junio C HamanoMar 3, 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.