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

Re: [PATCH 1/2] wt-status: turn advice_status_hints into a field of wt_status

From
Jeff King <peff@peff.net>
Date
Sep 12, 2013, 09:52 UTC
Message-ID
<20130912095207.GA31493@sigill.intra.peff.net>
In-Reply-To
<vpqeh8u1iip.fsf@anie.imag.fr>
On Thu, Sep 12, 2013 at 11:44:30AM +0200, Matthieu Moy wrote:
Show 12 quoted lines
> That is clean, but a bit long and it is essentially duplicated between
> status and commit. I went another way: put all the similar code in a
> common function status_init_config:
> 
> static void status_init_config(struct wt_status *s, config_fn_t fn)
> {
> 	wt_status_prepare(s);
> 	gitmodules_config();
> 	git_config(git_status_config, s);
> 	determine_whence(s);
> 	s->hints = advice_status_hints; /* must come after git_config() */
> }
s/git_status_config/fn/, I assume.
> We could split the git_config call, but that would not bring much
> benefit IMHO. In any case, it can be done very simply on top of my patch
> if needed later, as there is now only one call site for git_config.

Yeah, I think that is fine. The other cleanup may or may not be worth it, but should not be a blocker to your patch. With what you suggest above, you are certainly not making anything worse with respect to the code organization.

Thanks.
-Peff
Previous: Matthieu Moy
Message 6 of 6 in “wt-status: turn advice_status_hints into a field of wt_status”
  1. 1/2 wt-status: turn advice_status_hints into a field of wt_statusMatthieu Moy, Sep 11, 2013
  2. 2/2 commit: disable status hints when writing to COMMIT_EDITMSGMatthieu Moy, Sep 11, 2013
  3. Eric SunshineSep 11, 2013
  4. Jeff KingSep 11, 2013
  5. Matthieu MoySep 12, 2013
  6. Jeff KingSep 12, 2013

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.