All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] commit: Avoid redundant scissor line with --cleanup=scissors -v
Date: Tue, 27 Feb 2024 09:10:35 -0800	[thread overview]
Message-ID: <xmqqedcxvnn8.fsf@gitster.g> (raw)
In-Reply-To: <Zd2eLxPelxvP8FDk@localhost> (Josh Triplett's message of "Tue, 27 Feb 2024 00:32:47 -0800")

Josh Triplett <josh@joshtriplett.org> writes:

> I could add statefulness to wt_status_add_cut_line instead, on the
> assumption that it's the only thing that should be adding a cut line,
> and having it not add the line if previously added. For instance, it
> could accept a pointer to the full wt_status rather than just the fp,
> and keep a boolean state there.

Yeah, that approach also has to assume that wt_status structure is
used only once to create a single message buffer without being
reused, but I think that is a safe assumption, too.  The function
being the only thing that adds the scissors line should also be a
safe assumption in code hygiene standpoint---if somebody else tries
to manually write such a line, we'll shoot such a patch down and
tell them to call this function anyway ;-).

> I did run the testsuite, and it passed. I can add a simple test easily
> enough.

It would be prudent to do so.

Thanks.


      parent reply	other threads:[~2024-02-27 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26  4:23 [PATCH] commit: Avoid redundant scissor line with --cleanup=scissors -v Josh Triplett
2024-02-26 18:03 ` Junio C Hamano
2024-02-27  8:32   ` Josh Triplett
2024-02-27  9:16     ` [PATCH v2 1/2] " Josh Triplett
2024-02-27  9:17       ` [PATCH v2 2/2] commit: Unify logic to avoid multiple scissors lines when merging Josh Triplett
2024-02-27 17:43       ` [PATCH v2 1/2] commit: Avoid redundant scissor line with --cleanup=scissors -v Junio C Hamano
2024-02-29  4:19         ` Josh Triplett
2024-02-29  5:41           ` Junio C Hamano
2024-02-29  6:09             ` Josh Triplett
2024-02-29 16:38               ` Junio C Hamano
2024-02-27 17:10     ` Junio C Hamano [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=xmqqedcxvnn8.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=josh@joshtriplett.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.