git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stephan Beyer <s-beyer@gmx.net>
To: Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org,
	"Christian Couder" <christian.couder@gmail.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>
Subject: Re: [PATCH 4/5] Make sequencer abort safer
Date: Thu, 8 Dec 2016 20:17:29 +0100	[thread overview]
Message-ID: <c02708de-8b47-e490-4a1e-77f5727b1156@gmx.net> (raw)
In-Reply-To: <xmqqr35itjor.fsf@gitster.mtv.corp.google.com>

Hi,

I'm a little afraid of feeding Parkinson's law of triviality here, but... ;)

On 12/08/2016 06:27 PM, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
>> On Wed, 7 Dec 2016, Stephan Beyer wrote:
>>
>>> diff --git a/sequencer.c b/sequencer.c
>>> index 30b10ba14..c9b560ac1 100644
>>> --- a/sequencer.c
>>> +++ b/sequencer.c
>>> @@ -27,6 +27,7 @@ GIT_PATH_FUNC(git_path_seq_dir, "sequencer")
>>>  static GIT_PATH_FUNC(git_path_todo_file, "sequencer/todo")
>>>  static GIT_PATH_FUNC(git_path_opts_file, "sequencer/opts")
>>>  static GIT_PATH_FUNC(git_path_head_file, "sequencer/head")
>>> +static GIT_PATH_FUNC(git_path_curr_file, "sequencer/current")
>>
>> Is it required by law to have a four-letter infix, or can we have a nicer
>> variable name (e.g. git_path_current_file)?
> 
> I agree with you that, as other git_path_*_file variables match the
> actual name on the filesystem, this one should too, together with
> the update_curr_file() function.

I totally agree with that (and I don't know why I used "curr", probably
just because it looked consistent and good...).

However:

> -static void update_curr_file()
> +static void update_current_file(void)

This function name could lead to the impression that there is some
current file (defined by a global state or whatever) that is updated.

So I'd rather rename the *file* to one of

 * sequencer/abort-safety (consistent to am, describes its purpose)
 * sequencer/safety (shorter, still describes the purpose)
 * sequencer/current-head (describes what it contains)
 * sequencer/last (a four-letter word, not totally unambiguous though)

> By the way, this step seems to be a fix to an existing problem, and
> the new test added in 3/5 seems to be a demonstration of the issue.
> If that is the case, shouldn't the new test initially expect failure
> and updated by this step to expect success?

That's usually a matter of taste that I sometimes also discuss with
colleagues in other projects... However, for the git test suite with its
"known breakage" behavior, your recommendation is surely the best way to
do it (aside from introducing the test and the fix in one commit... but
that does not show in the history that there actually was that breakage)

~Stephan

  reply	other threads:[~2016-12-08 19:17 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06 18:58 BUG: "cherry-pick A..B || git reset --hard OTHER" Junio C Hamano
2016-12-07 14:31 ` Christian Couder
2016-12-07 18:36 ` Stephan Beyer
2016-12-07 20:04   ` Junio C Hamano
2016-12-07 20:35     ` Stephan Beyer
2016-12-07 23:21       ` Duy Nguyen
2016-12-09 11:33     ` Duy Nguyen
2016-12-09 11:34       ` [PATCH] rebase: rename --forget to be consistent with sequencer Nguyễn Thái Ngọc Duy
2016-12-09 11:34         ` [PATCH] revert, cherry-pick: rename --quit to be consistent with rebase Nguyễn Thái Ngọc Duy
2016-12-09 18:07       ` BUG: "cherry-pick A..B || git reset --hard OTHER" Junio C Hamano
2016-12-09 19:24         ` Stephan Beyer
2016-12-09 19:28           ` Stephan Beyer
2016-12-10 11:00           ` Duy Nguyen
2016-12-10 21:23             ` Junio C Hamano
2016-12-08  7:50   ` Christian Couder
2016-12-07 21:51 ` [PATCH 1/5] am: Fix filename in safe_to_abort() error message Stephan Beyer
2016-12-08 10:21   ` Paul Tan
2016-12-07 21:51 ` [PATCH 2/5] am: Change safe_to_abort()'s not rewinding error into a warning Stephan Beyer
2016-12-07 21:51 ` [PATCH 3/5] Add test that cherry-pick --abort does not unsafely change HEAD Stephan Beyer
2016-12-07 21:51 ` [PATCH 4/5] Make sequencer abort safer Stephan Beyer
2016-12-08 15:28   ` Johannes Schindelin
2016-12-08 17:27     ` Junio C Hamano
2016-12-08 19:17       ` Stephan Beyer [this message]
2016-12-09 18:33         ` Junio C Hamano
2016-12-09 19:01           ` [PATCH v2 1/5] am: Fix filename in safe_to_abort() error message Stephan Beyer
2016-12-09 19:01           ` [PATCH v2 2/5] am: Change safe_to_abort()'s not rewinding error into a warning Stephan Beyer
2016-12-09 19:01           ` [PATCH v2 3/5] Add test that cherry-pick --abort does not unsafely change HEAD Stephan Beyer
2016-12-09 19:01           ` [PATCH v2 4/5] Make sequencer abort safer Stephan Beyer
2016-12-10 19:56             ` Christian Couder
2016-12-10 20:04               ` Jeff King
2016-12-10 20:20                 ` Stephan Beyer
2016-12-09 19:01           ` [PATCH v2 5/5] sequencer: Remove useless get_dir() function Stephan Beyer
2016-12-07 21:51 ` [PATCH " Stephan Beyer

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=c02708de-8b47-e490-4a1e-77f5727b1156@gmx.net \
    --to=s-beyer@gmx.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=szeder.dev@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).