git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jacob Keller <jacob.keller@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jacob Keller <jacob.e.keller@intel.com>,
	Git mailing list <git@vger.kernel.org>,
	Stefan Beller <stefanbeller@gmail.com>, Jeff King <peff@peff.net>,
	Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH v6 2/3] graph: add support for --line-prefix on all graph-aware output
Date: Tue, 16 Aug 2016 13:19:32 -0700	[thread overview]
Message-ID: <CA+P7+xrsbNpCjm_bQ6kBK=FGcWOr0WkuVnWyV6p_0FFEMKTxhw@mail.gmail.com> (raw)
In-Reply-To: <xmqqlgzwd14w.fsf@gitster.mtv.corp.google.com>

On Tue, Aug 16, 2016 at 11:22 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Jacob Keller <jacob.e.keller@intel.com> writes:
>
>> To make this work, we have to fix a few bugs in the graph API that force
>> graph_show_commit_msg to be used only when you have a valid graph.
>> Additionally, we extend the default_diff_output_prefix handler to work
>> even when no graph is enabled.
>>
>> This is somewhat of a hack on top of the graph API, but I think it
>> should be acceptable here.
>
> Unlike the opt-prefix-length I removed in 1/3, the length of the
> line-prefix will never change during the lifetime of a single
> diff_options struct, so it might turn out that repeated strlen()
> on it for each and every line output is wasteful.
>

I could change this to store the length at option initialization,
probably a good idea. Would it be better to just store it as a strbuf,
since these know their length already? Or just add a
line_prefix_length field? I agree that calling strlen a lot is
probably wasteful.

> Other than that, I didn't spot anything immediately questionable.
>

Thanks. I definitely feel like this is somewhat abusing the graph API
because we're adding something not exactly graph-related. But in some
ways it really is graph related as well, so I think it makes some
sense.

Regards,
Jake

> Thanks.

  reply	other threads:[~2016-08-16 20:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15 23:06 [PATCH v6 0/3] Add support for displaying submodules as a proper diff Jacob Keller
2016-08-15 23:07 ` [PATCH v6 1/3] diff.c: remove output_prefix_length field Jacob Keller
2016-08-16 18:03   ` Junio C Hamano
2016-08-16 18:08     ` Jacob Keller
2016-08-15 23:07 ` [PATCH v6 2/3] graph: add support for --line-prefix on all graph-aware output Jacob Keller
2016-08-16 18:22   ` Junio C Hamano
2016-08-16 20:19     ` Jacob Keller [this message]
2016-08-15 23:07 ` [PATCH v6 3/3] diff: add SUBMODULE_DIFF format to display submodule diff Jacob Keller
2016-08-16 18:48   ` Junio C Hamano
2016-08-16 20:25     ` Jacob Keller
2016-08-16 21:14       ` Junio C Hamano
2016-08-16 21:20         ` Jacob Keller
2016-08-16 21:31           ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CA+P7+xrsbNpCjm_bQ6kBK=FGcWOr0WkuVnWyV6p_0FFEMKTxhw@mail.gmail.com' \
    --to=jacob.keller@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=jacob.e.keller@intel.com \
    --cc=peff@peff.net \
    --cc=stefanbeller@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).