git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Liam Beguin <liambeguin@gmail.com>,
	git@vger.kernel.org, avarab@gmail.com
Subject: Re: [PATCH 3/5] rebase -i: add exec commands via the rebase--helper
Date: Tue, 28 Nov 2017 08:45:21 +0900	[thread overview]
Message-ID: <xmqqk1yb9tgu.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1.1711272230490.6482@virtualbox> (Johannes Schindelin's message of "Mon, 27 Nov 2017 22:41:37 +0100 (CET)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> As the name of a public function, it does not feel that this hints
>> it strongly enough that it is from and a part of sequencer.c API.
>
> How about a "yes, and" instead? As in:
>
> To further improve this patch, let's use the name
> sequencer_add_exec_commands() for this function because it is defined
> globally now.

I would do so when I have a single "this is strictly better"
suggestion.  In this case, I didn't, but somebody who does not have
a "better suggestion" can still have a good sense of smell to tell
something is "not right".

>> > +	const char *todo_file = rebase_path_todo();
>> > +	struct todo_list todo_list = TODO_LIST_INIT;
>> > +	int fd, res, i, first = 1;
>> > +	FILE *out;
>> 
>> Having had to scan backwards while trying to see what the loop that
>> uses this variable is doing and if it gets affected by things that
>> happened before we entered the loop, I'd rather not to see 'first'
>> initialized here, left unused for quite some time until the loop is
>> entered.  It would make it a lot easier to follow if it is declared
>> and left uninitilized here, and set to 1 immediately before the
>> for() loop that uses it.
>
> Funny, I would have assumed it the other way round: since "first" always
> has to be initialized with 1, I would have been surprised to see an
> explicit assignment much later than it is declared.

Unfortunately that would force readers to see what happens before
the loop to see if there are cases where first is incremented, and
in this case there is not any.

  reply	other threads:[~2017-11-27 23:45 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27  4:55 [PATCH 0/5] rebase -i: add config to abbreviate command names Liam Beguin
2017-11-27  4:55 ` [PATCH 1/5] Documentation: move rebase.* configs to new file Liam Beguin
2017-11-27 21:27   ` Johannes Schindelin
2017-11-27  4:55 ` [PATCH 2/5] Documentation: use preferred name for the 'todo list' script Liam Beguin
2017-11-27 21:28   ` Johannes Schindelin
2017-11-27  4:55 ` [PATCH 3/5] rebase -i: add exec commands via the rebase--helper Liam Beguin
2017-11-27  5:14   ` Junio C Hamano
2017-11-27 21:41     ` Johannes Schindelin
2017-11-27 23:45       ` Junio C Hamano [this message]
2017-11-29  2:01     ` liam Beguin
2017-11-27 22:42   ` Johannes Schindelin
2017-11-27 23:48     ` Junio C Hamano
2017-11-29  2:06     ` liam Beguin
2017-11-29 21:35       ` Johannes Schindelin
2017-11-27  4:55 ` [PATCH 4/5] rebase -i: learn to abbreviate command names Liam Beguin
2017-11-27  5:19   ` Junio C Hamano
2017-11-29  2:08     ` liam Beguin
2017-11-27 23:04   ` Johannes Schindelin
2017-11-27 23:11     ` Jeff King
2017-11-29  2:11       ` liam Beguin
2017-11-29  2:10     ` liam Beguin
2017-11-29 21:40       ` Johannes Schindelin
2017-12-03  1:18         ` Junio C Hamano
2017-11-27  4:55 ` [PATCH 5/5] t3404: add test case for abbreviated commands Liam Beguin
2017-11-27  5:28   ` Junio C Hamano
2017-11-27 23:16   ` Johannes Schindelin
2017-11-27  5:23 ` [PATCH 0/5] rebase -i: add config to abbreviate command names Junio C Hamano
2017-11-29  1:56   ` liam Beguin
2017-12-03 22:17 ` [PATCH v2 0/9] " Liam Beguin
2017-12-03 22:17   ` [PATCH v2 1/9] Documentation: move rebase.* configs to new file Liam Beguin
2017-12-03 22:17   ` [PATCH v2 2/9] Documentation: use preferred name for the 'todo list' script Liam Beguin
2017-12-03 22:17   ` [PATCH v2 3/9] rebase -i: set commit to null in exec commands Liam Beguin
2017-12-03 22:17   ` [PATCH v2 4/9] rebase -i: refactor transform_todo_ids Liam Beguin
2017-12-04 14:42     ` Johannes Schindelin
2017-12-04 16:09       ` Junio C Hamano
2017-12-05  3:36         ` liam Beguin
2017-12-05 12:35           ` Junio C Hamano
2017-12-05  3:39       ` liam Beguin
2017-12-03 22:17   ` [PATCH v2 5/9] rebase -i: replace reference to sha1 with oid Liam Beguin
2017-12-03 22:17   ` [PATCH v2 6/9] rebase -i: update functions to use a flags parameter Liam Beguin
2017-12-04 15:46     ` Johannes Schindelin
2017-12-04 16:06       ` Johannes Schindelin
2017-12-05  3:42       ` liam Beguin
2017-12-05 12:37         ` Junio C Hamano
2017-12-05 12:41           ` Kerry, Richard
2017-12-05 14:42             ` liam Beguin
2017-12-05 16:05             ` Junio C Hamano
2017-12-05 16:14               ` Kerry, Richard
2017-12-03 22:17   ` [PATCH v2 7/9] rebase -i -x: add exec commands via the rebase--helper Liam Beguin
2017-12-03 22:17   ` [PATCH v2 8/9] rebase -i: learn to abbreviate command names Liam Beguin
2017-12-25 12:48     ` Duy Nguyen
2017-12-25 15:39       ` Liam Beguin
2017-12-25 23:58         ` Duy Nguyen
2017-12-27 19:15       ` Junio C Hamano
2017-12-27 21:58         ` Liam Beguin
2017-12-28 18:55           ` Junio C Hamano
2017-12-03 22:17   ` [PATCH v2 9/9] t3404: add test case for abbreviated commands Liam Beguin
2017-12-04 16:07   ` [PATCH v2 0/9] rebase -i: add config to abbreviate command names Johannes Schindelin
2017-12-05 17:52 ` Liam Beguin
2017-12-05 17:52   ` [PATCH v3 1/9] Documentation: move rebase.* configs to new file Liam Beguin
2017-12-05 17:52   ` [PATCH v3 2/9] Documentation: use preferred name for the 'todo list' script Liam Beguin
2017-12-05 17:52   ` [PATCH v3 3/9] rebase -i: set commit to null in exec commands Liam Beguin
2017-12-05 17:52   ` [PATCH v3 4/9] rebase -i: refactor transform_todo_ids Liam Beguin
2017-12-05 17:52   ` [PATCH v3 5/9] rebase -i: replace reference to sha1 with oid Liam Beguin
2017-12-05 17:52   ` [PATCH v3 6/9] rebase -i: update functions to use a flags parameter Liam Beguin
2017-12-05 17:52   ` [PATCH v3 7/9] rebase -i -x: add exec commands via the rebase--helper Liam Beguin
2017-12-05 17:52   ` [PATCH v3 8/9] rebase -i: learn to abbreviate command names Liam Beguin
2017-12-05 17:52   ` [PATCH v3 9/9] t3404: add test case for abbreviated commands Liam Beguin
2017-12-05 22:21   ` [PATCH v2 0/9] rebase -i: add config to abbreviate command names Junio C Hamano
2017-12-06  2:42     ` liam Beguin

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=xmqqk1yb9tgu.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=liambeguin@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).