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

Re: [PATCH v2 1/2] extract setting of wt_status.commitable flag out of wt_status_print_updated()

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 4, 2015, 21:34 UTC
Message-ID
<xmqq8ubzupi8.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1433440591-30917-2-git-send-email-rctay89@gmail.com>
Tay Ray Chuan <rctay89@gmail.com> writes:
> It may not be obvious from its name that wt_status_print_updated() that
> it also sets wt_status.commitable, which affects commit functionality.
> Extract this out into a separate function for improved clarity, though
> at the expense of executing another loop.
Makes sense.
Show 8 quoted lines
> @@ -1360,6 +1374,7 @@ void wt_status_print(struct wt_status *s)
>  
>  	wt_status_print_updated(s);
>  	wt_status_print_unmerged(s);
> +	wt_status_mark_commitable(s);
>  	wt_status_print_changed(s);
>  	if (s->submodule_summary &&
>  	    (!s->ignore_submodule_arg ||

As this is the only callsite of _updated(), we can be assured that the conversion would not change the behaviour.

But I am not sure the placement of the new call is sensible. The standard pattern used in the wt-status infrastructure is to first collect the information and then make output based on what was collected. Because the value of this patch is to separte the "is it committable?" information gathering step out of the output step, shouldn't the call be made a lot earlier than these sequence of wt_status_print_blah() calls?

I am wondering if the flipping of the "is it committable?" bit belongs to wt_status_collect(). It could be that some other crufty checks that wt_status_print() have accumulated over time might be better moved to the "collect" phase, but that is a separate topic.

Previous: Tay Ray ChuanNext: Junio C Hamano
Message 4 of 9 in “make commit --verbose work with --no-status”
  1. 0/2 make commit --verbose work with --no-statusTay Ray Chuan, Jun 4, 2015
  2. 1/2 extract setting of wt_status.commitable flag out of wt_status_print_updated()Tay Ray Chuan, Jun 4, 2015
  3. 2/2 make commit --verbose work with --no-statusTay Ray Chuan, Jun 4, 2015
  4. Junio C HamanoJun 4, 2015
  5. Junio C HamanoJun 4, 2015
  6. Tay Ray ChuanJun 5, 2015
  7. Junio C HamanoJun 5, 2015
  8. Tay Ray ChuanJun 5, 2015
  9. Junio C HamanoJun 5, 2015

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.