git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Abhradeep Chakraborty via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
	Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>
Subject: Re: [PATCH] amend error message violations
Date: Mon, 25 Oct 2021 14:37:38 +0200	[thread overview]
Message-ID: <211025.86y26hgtm0.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <pull.1062.git.1635164026698.gitgitgadget@gmail.com>


On Mon, Oct 25 2021, Abhradeep Chakraborty via GitGitGadget wrote:

> From: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>
>
> Issue no #635 in the gitgitgadget/git repo has a brief description
> about the violation of error message style convention. These
> violations are - 1) Do not end error messages with a full stop. 2) Do
> not capitalize ("unable to open %s", not "Unable to open %s") 3) Say
> what the error is first ("cannot open %s", not "%s: cannot open")

Let's summarize the guidelines instead of asking readers to visit
https://github.com/gitgitgadget/git/issues/635 (which isn't even
directly linked here) only to find a quote from CodingGuidelines.

I think it's good to split these up, e.g. the rewording of the BUG()
message for the 3rd quoted item in CodingGuidelines from cases where
you're only changing the capitalization of these messages.

> One thing to note that I didn't change any .po file as there is a
> doubt whether those are good to change or not.

Those should be left alone, and will be updated by translators as part
of the whole "git.pot" process.

> -			res = error(_("Could not parse HEAD^{tree}"));
> +			res = error(_("could not parse HEAD^{tree}"));

If we're going to mass-edit these I wouldn't mind an addition to the
guidelines that says we ''-quote things, and add that when appropriate....

>  				regerror(ret, &regex, errbuf, sizeof(errbuf));
> -				err(s, _("Malformed search regexp %s: %s"),
> +				err(s, _("malformed search regexp %s: %s"),
>  				    s->answer.buf, errbuf);
>  				continue;

..e.g. here.

> -	error(_("You have not concluded your merge (MERGE_HEAD exists)."));
> +	error(_("you have not concluded your merge (MERGE_HEAD exists)"));
>  	if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
>  		advise(_("Please, commit your changes before merging."));
> -	die(_("Exiting because of unfinished merge."));
> +	die(_("exiting because of unfinished merge"));
>  }

Surely any convention of not using full-stop should extend to advise()
too?

But in this case aren't we constructing sentences in parts? Maybe having
the full-stops here is better than not, I'm not sure.

Also, have you tried using coccinelle for this? Doing this sort of
replacement should be a small matter of some inline Python, the
linux.git repo has some good examples of that.

It would make discussing these changes easier, and per the "pending"
docs in contrib/coccinelle/README any patches could follow such rules
incrementally...

  reply	other threads:[~2021-10-25 12:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 12:13 [PATCH] amend error message violations Abhradeep Chakraborty via GitGitGadget
2021-10-25 12:37 ` Ævar Arnfjörð Bjarmason [this message]
2021-10-25 16:40   ` Abhradeep Chakraborty
2021-10-31  7:04   ` Abhradeep Chakraborty

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=211025.86y26hgtm0.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=chakrabortyabhradeep79@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@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).