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

[PATCH 1/3] rename STATUS_FORMAT_NONE to STATUS_FORMAT_DEFAULT

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Feb 21, 2014, 19:09 UTC
Message-ID
<1393009762-31133-2-git-send-email-rctay89@gmail.com>
In-Reply-To
<1393009762-31133-1-git-send-email-rctay89@gmail.com>
Cc: Jeff King <peff@peff.net>

In f3f47a1 (status: add --long output format option), STATUS_FORMAT_NONE was introduced, meaning "the user did not specify anything". Rename this to *_DEFAULT to better indicate its meaning.

This paves the way for _NONE to really mean "no status".
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 builtin/commit.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/builtin/commit.c b/builtin/commit.c
index 3783bca..2e86b76 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -125,7 +125,7 @@ static const char *only_include_assumed;
 static struct strbuf message = STRBUF_INIT;
 
 static enum status_format {
-	STATUS_FORMAT_NONE = 0,
+	STATUS_FORMAT_DEFAULT = 0,
 	STATUS_FORMAT_LONG,
 	STATUS_FORMAT_SHORT,
 	STATUS_FORMAT_PORCELAIN,
@@ -487,7 +487,7 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int
 	case STATUS_FORMAT_UNSPECIFIED:
 		die("BUG: finalize_deferred_config() should have been called");
 		break;
-	case STATUS_FORMAT_NONE:
+	case STATUS_FORMAT_DEFAULT:
 	case STATUS_FORMAT_LONG:
 		wt_status_print(s);
 		break;
@@ -1028,7 +1028,7 @@ static void finalize_deferred_config(struct wt_status *s)
 				   !s->null_termination);
 
 	if (s->null_termination) {
-		if (status_format == STATUS_FORMAT_NONE ||
+		if (status_format == STATUS_FORMAT_DEFAULT ||
 		    status_format == STATUS_FORMAT_UNSPECIFIED)
 			status_format = STATUS_FORMAT_PORCELAIN;
 		else if (status_format == STATUS_FORMAT_LONG)
@@ -1038,7 +1038,7 @@ static void finalize_deferred_config(struct wt_status *s)
 	if (use_deferred_config && status_format == STATUS_FORMAT_UNSPECIFIED)
 		status_format = status_deferred_config.status_format;
 	if (status_format == STATUS_FORMAT_UNSPECIFIED)
-		status_format = STATUS_FORMAT_NONE;
+		status_format = STATUS_FORMAT_DEFAULT;
 
 	if (use_deferred_config && s->show_branch < 0)
 		s->show_branch = status_deferred_config.show_branch;
@@ -1141,7 +1141,7 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	if (all && argc > 0)
 		die(_("Paths with -a does not make sense."));
 
-	if (status_format != STATUS_FORMAT_NONE)
+	if (status_format != STATUS_FORMAT_DEFAULT)
 		dry_run = 1;
 
 	return argc;
@@ -1197,7 +1197,7 @@ static int git_status_config(const char *k, const char *v, void *cb)
 		if (git_config_bool(k, v))
 			status_deferred_config.status_format = STATUS_FORMAT_SHORT;
 		else
-			status_deferred_config.status_format = STATUS_FORMAT_NONE;
+			status_deferred_config.status_format = STATUS_FORMAT_DEFAULT;
 		return 0;
 	}
 	if (!strcmp(k, "status.branch")) {
@@ -1314,7 +1314,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
 	case STATUS_FORMAT_UNSPECIFIED:
 		die("BUG: finalize_deferred_config() should have been called");
 		break;
-	case STATUS_FORMAT_NONE:
+	case STATUS_FORMAT_DEFAULT:
 	case STATUS_FORMAT_LONG:
 		s.verbose = verbose;
 		s.ignore_submodule_arg = ignore_submodule_arg;
@@ -1522,7 +1522,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 		usage_with_options(builtin_commit_usage, builtin_commit_options);
 
 	status_init_config(&s, git_commit_config);
-	status_format = STATUS_FORMAT_NONE; /* Ignore status.short */
+	status_format = STATUS_FORMAT_DEFAULT; /* Ignore status.short */
 	s.colopts = 0;
 
 	if (get_sha1("HEAD", sha1))
-- 
1.9.0.291.g027825b
Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 2 of 8 in “make commit --verbose work with --no-status”
  1. 0/3 make commit --verbose work with --no-statusTay Ray Chuan, Feb 21, 2014
  2. 1/3 rename STATUS_FORMAT_NONE to STATUS_FORMAT_DEFAULTTay Ray Chuan, Feb 21, 2014
  3. 2/3 extract setting of wt_status.commitable flag out of wt_status_print_updated()Tay Ray Chuan, Feb 21, 2014
  4. 3/3 make commit --verbose work with --no-statusTay Ray Chuan, Feb 21, 2014
  5. Jeff KingFeb 22, 2014
  6. Tay Ray ChuanFeb 24, 2014
  7. Jeff KingFeb 24, 2014
  8. Jeff KingFeb 22, 2014

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.