From: Junio C Hamano <gitster@pobox.com>
To: David Aguilar <davvid@gmail.com>
Cc: Zoltan Klinger <zoltan.klinger@gmail.com>,
git@vger.kernel.org, sunshine@sunshineco.com
Subject: Re: [PATCH v3] difftool: Change prompt to display the number of files in the diff queue
Date: Tue, 17 Dec 2013 22:06:19 -0800 [thread overview]
Message-ID: <xmqqmwjyk810.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20131218052523.GB90546@gmail.com> (David Aguilar's message of "Tue, 17 Dec 2013 21:25:25 -0800")
David Aguilar <davvid@gmail.com> writes:
> Thanks for the patch, and sorry for the late response.
> I have just a couple of notes below...
>
> On Fri, Dec 06, 2013 at 10:38:46AM +1100, Zoltan Klinger wrote:
>> diff --git a/diff.c b/diff.c
>> index e34bf97..a7d5a47 100644
>> --- a/diff.c
>> +++ b/diff.c
>> @@ -2899,11 +2899,16 @@ static void run_external_diff(const char *pgm,
>> struct diff_filespec *one,
>> struct diff_filespec *two,
>> const char *xfrm_msg,
>> - int complete_rewrite)
>> + int complete_rewrite,
>> + struct diff_options *o)
>
> Very minor nit -- "o" is a very terse variable name.
> Maybe "opts"?
The diff-options parameter passed around in the callchain has always
been "o" throughout this file from the beginning of time, though ;-).
>
>> {
>> const char *spawn_arg[10];
>> int retval;
>> const char **arg = &spawn_arg[0];
>> + struct diff_queue_struct *q = &diff_queued_diff;
>> + const char *env[3] = { NULL };
>> + char env_counter[50];
>> + char env_total[50];
>
> Hard-coded 50; what's the length of the maximum signed int?
;-) A bit of slack is fine, but 50 might be excessive (more than
twice as big as necessary).
>> diff --git a/diff.h b/diff.h
>> index e342325..42bd34c 100644
>> --- a/diff.h
>> +++ b/diff.h
>> @@ -164,6 +164,8 @@ struct diff_options {
>> diff_prefix_fn_t output_prefix;
>> int output_prefix_length;
>> void *output_prefix_data;
>> +
>> + int diff_path_counter;
>> };
>
> Since these are already "diff_options" it seems redundant to call
> the struct entry the "diff_path_counter" when "path_count"
> should be specific enough. Would it make sense to rename it?
Yeah, makes sense. diff_options->diff_path_counter++ sounds awful,
while options->path_count++ looks quite tame and reasonable.
> These are tiny nitpicky style notes; it looks good otherwise.
Thanks.
prev parent reply other threads:[~2013-12-18 6:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-05 23:38 [PATCH v3] difftool: Change prompt to display the number of files in the diff queue Zoltan Klinger
2013-12-06 22:00 ` Junio C Hamano
2013-12-16 20:02 ` Jeff King
2013-12-16 21:04 ` Junio C Hamano
2013-12-18 5:25 ` David Aguilar
2013-12-18 6:06 ` 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=xmqqmwjyk810.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.com \
--cc=zoltan.klinger@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 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.