git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Zak Johnson <zakj@nox.cx>
Subject: Re: [PATCH 2/5] status: refactor colopts handling
Date: Tue, 8 May 2012 20:27:45 +0700	[thread overview]
Message-ID: <CACsJy8ADt0C=gyom8R15GoM+_6oHDvWasMgSqnwbiKqnXGwxug@mail.gmail.com> (raw)
In-Reply-To: <20120507212333.GB19567@sigill.intra.peff.net>

On Tue, May 8, 2012 at 4:23 AM, Jeff King <peff@peff.net> wrote:
> The current code reads the config and command-line options
> into a separate "colopts" variable, and then copies the
> contents of that variable into the "struct wt_status". We
> can eliminate the extra variable and copy just write
> straight into the wt_status struct.
>
> This simplifies the "status" code a little bit.
> Unfortunately, it makes the "commit" code one line more
> complex; a side effect of the separate variable was that
> "commit" did not copy the colopts variable, so any
> column.status configuration had no effect.
>
> The result still ends up cleaner, though. In the previous
> version, it was unclear whether commit simply forgot to copy
> the colopt variable, or whether it was intentional. Now it
> explicitly turns off column options. Furthermore, if commit
> later learns to respect column.status, this will make the
> end result simpler. I punted on just adding that feature
> now, because it was sufficiently non-obvious that it should
> not go into a refactoring patch.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> For the reasons mentioned above, this ended up as a less impressive
> cleanup than I had hoped. I think it's still worth doing, but I won't be
> too sad if it gets dropped.

I'm neutral. But this patch reduces one line so it wins a "yes" from me.

>  builtin/commit.c | 13 ++++++-------
>  wt-status.h      |  2 +-
>  2 files changed, 7 insertions(+), 8 deletions(-)
-- 
Duy

  reply	other threads:[~2012-05-08 13:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-06 13:29 [PATCH] correct git-status Porcelain Format documentation Jeff King
2012-05-06 13:51 ` Jeff King
2012-05-07 18:10   ` Junio C Hamano
2012-05-07 18:13     ` Jeff King
2012-05-07 21:21       ` Jeff King
2012-05-07 21:22         ` [PATCH 1/5] commit: refactor option parsing Jeff King
2012-05-07 21:23         ` [PATCH 2/5] status: refactor colopts handling Jeff King
2012-05-08 13:27           ` Nguyen Thai Ngoc Duy [this message]
2012-05-07 21:24         ` [PATCH 3/5] status: refactor null_termination option Jeff King
2012-05-07 21:24         ` [PATCH 4/5] status: fix null termination with "-b" Jeff King
2012-05-07 21:25         ` [PATCH 5/5] status: respect "-b" for porcelain format Jeff King
2012-05-07 21:28           ` Jeff King
2012-05-08  4:55             ` Junio C Hamano
2012-05-08  9:04               ` Jeff King
2012-05-08 17:52                 ` Junio C Hamano
2012-05-07 18:03 ` [PATCH] correct git-status Porcelain Format documentation Junio C Hamano

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='CACsJy8ADt0C=gyom8R15GoM+_6oHDvWasMgSqnwbiKqnXGwxug@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=zakj@nox.cx \
    /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).