git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: git@vger.kernel.org, gitster@pobox.com, javierdo1@gmail.com,
	jrnieder@gmail.com, judge.packham@gmail.com
Subject: Re: [PATCH 1/2] wt-status: turn advice_status_hints into a field of wt_status
Date: Thu, 12 Sep 2013 05:52:07 -0400	[thread overview]
Message-ID: <20130912095207.GA31493@sigill.intra.peff.net> (raw)
In-Reply-To: <vpqeh8u1iip.fsf@anie.imag.fr>

On Thu, Sep 12, 2013 at 11:44:30AM +0200, Matthieu Moy wrote:

> 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

      reply	other threads:[~2013-09-12  9:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11  9:08 [PATCH 1/2] wt-status: turn advice_status_hints into a field of wt_status Matthieu Moy
2013-09-11  9:08 ` [PATCH 2/2] commit: disable status hints when writing to COMMIT_EDITMSG Matthieu Moy
2013-09-11  9:13   ` Eric Sunshine
2013-09-11 18:35 ` [PATCH 1/2] wt-status: turn advice_status_hints into a field of wt_status Jeff King
2013-09-12  9:44   ` Matthieu Moy
2013-09-12  9:52     ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130912095207.GA31493@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=javierdo1@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=judge.packham@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).