mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "René Scharfe" <>
To: Git Mailing List <>
Cc: Junio C Hamano <>
Subject: [PATCH] help: make help_unknown_ref() NORETURN
Date: Thu, 29 Aug 2019 21:13:16 +0200	[thread overview]
Message-ID: <> (raw)

Announce that calling help_unknown_ref() exits the program.

Signed-off-by: René Scharfe <>
Patch generated with --function-context for easier review.

 help.c | 3 ++-
 help.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/help.c b/help.c
index 5261d83ecf..9ff2be6b18 100644
--- a/help.c
+++ b/help.c
@@ -774,22 +774,23 @@ static struct string_list guess_refs(const char *ref)
 	return similar_refs;

-void help_unknown_ref(const char *ref, const char *cmd, const char *error)
+NORETURN void help_unknown_ref(const char *ref, const char *cmd,
+			       const char *error)
 	int i;
 	struct string_list suggested_refs = guess_refs(ref);

 	fprintf_ln(stderr, _("%s: %s - %s"), cmd, ref, error);

 	if ( > 0) {
 			   Q_("\nDid you mean this?",
 			      "\nDid you mean one of these?",
 		for (i = 0; i <; i++)
 			fprintf(stderr, "\t%s\n", suggested_refs.items[i].string);

 	string_list_clear(&suggested_refs, 0);
diff --git a/help.h b/help.h
index b8780fbd0f..7a455beeb7 100644
--- a/help.h
+++ b/help.h
@@ -42,8 +42,8 @@ void list_commands(unsigned int colopts, struct cmdnames *main_cmds, struct cmdn
  * call this to die(), when it is suspected that the user mistyped a
  * ref to the command, to give suggested "correct" refs.
-void help_unknown_ref(const char *ref, const char *cmd, const char *error);
+NORETURN void help_unknown_ref(const char *ref, const char *cmd, const char *error);

 static inline void list_config_item(struct string_list *list,
 				    const char *prefix,

             reply	other threads:[~2019-08-29 19:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 19:13 René Scharfe [this message]
2019-08-29 19:40 ` [PATCH] help: make help_unknown_ref() NORETURN Martin Ågren
2019-08-29 20:08   ` René Scharfe
2019-08-30  3:50     ` Martin Ågren

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:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* 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

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).