git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] Capitalization and punctuation fixes to some user visible messages

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 23, 2023, 20:39 UTC
Message-ID
<xmqqttyb6w3j.fsf@gitster.g>
In-Reply-To
<20230323162234.995485-1-oswald.buddenhagen@gmx.de>
Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:
>  			require_clean_work_tree(the_repository,
>  				N_("pull with rebase"),
> -				_("please commit or stash them."), 1, 0);
> +				_("Please commit or stash them."), 1, 0);

The require_clean_work_tree() function uses the message this patch touches here like so:

	...
	if (err) {
		if (hint)
			error("%s", hint);
		if (!gently)
			exit(128);
	}

and the message given to error() is shown with "error: " prefix. Our friendly CodingGuidelines is fairly clear on what to do to a single sentence error message like this one:

| Error Messages
| 
|  - Do not end error messages with a full stop.
| 
|  - Do not capitalize the first word, only because it is the first word
|    in the message ("unable to open %s", not "Unable to open %s").  But
|    "SHA-3 not supported" is fine, because the reason the first word is
|    capitalized is not because it is at the beginning of the sentence,
|    but because the word would be spelled in capital letters even when
|    it appeared in the middle of the sentence.

So, if you want to touch this message, what you want to do is to leave the capitalization alone, but to drop the full stop at the end.

Show 10 quoted lines
> diff --git a/sequencer.c b/sequencer.c
> index 3be23d7ca2..fda68cd33d 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -3629,13 +3629,13 @@ static int do_exec(struct repository *r, const char *command_line)
>  			  "\n"),
>  			command_line,
>  			dirty ? N_("and made changes to the index and/or the "
> -				"working tree\n") : "");
> +				"working tree.\n") : "");

I think this long and multi-sentence warning message should be split into two and the latter half should become an advice message that the user can squelch. Until it happens, which would require us to rewrite these messages, I wouldn't bother touching this message if I were you.

Show 7 quoted lines
>  	} else if (dirty) {
>  		warning(_("execution succeeded: %s\nbut "
> -			  "left changes to the index and/or the working tree\n"
> +			  "left changes to the index and/or the working tree.\n"
>  			  "Commit or stash your changes, and then run\n"
>  			  "\n"
>  			  "  git rebase --continue\n"
Likewise.
Previous: Oswald BuddenhagenNext: Oswald Buddenhagen
Message 9 of 21 in “Capitalization and punctuation fixes to some user visible messages”
  1. 1/3 Capitalization and punctuation fixes to some user visible messagesOswald Buddenhagen, Mar 23, 2023
  2. 3/3 advice: translate all actions in error_resolve_conflict()Oswald Buddenhagen, Mar 23, 2023
  3. Junio C HamanoMar 24, 2023
  4. 2/3 sequencer: actually translate report in do_exec()Oswald Buddenhagen, Mar 23, 2023
  5. Junio C HamanoMar 23, 2023
  6. Oswald BuddenhagenMar 23, 2023
  7. Junio C HamanoMar 23, 2023
  8. Oswald BuddenhagenMar 23, 2023
  9. Junio C HamanoMar 23, 2023
  10. Oswald BuddenhagenMar 23, 2023
  11. 1/3 advice: handle "rebase" in error_resolve_conflict()Oswald Buddenhagen, Apr 28, 2023
  12. 2/3 sequencer: actually translate report in do_exec()Oswald Buddenhagen, Apr 28, 2023
  13. Junio C HamanoApr 28, 2023
  14. 3/3 Capitalization and punctuation fixes to some user visible messagesOswald Buddenhagen, Apr 28, 2023
  15. Junio C HamanoApr 28, 2023
  16. Junio C HamanoApr 28, 2023
  17. Junio C HamanoApr 28, 2023
  18. Oswald BuddenhagenApr 29, 2023
  19. Junio C HamanoApr 30, 2023
  20. advice: handle "rebase" in error_resolve_conflict()Oswald Buddenhagen, Aug 7, 2023
  21. Junio C HamanoAug 7, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.