summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>2017-06-21 23:46:14 +0530
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-06-21 19:10:27 -0700
commit4ddb1354e8d5daf5671d3d451a67d2d1e82d9b49 (patch)
treeeb1bde38d4ccabc7267c26ee737def7520b5b632 /builtin
parentPrepare for 2.13.2 (diff)
downloadtgif-4ddb1354e8d5daf5671d3d451a67d2d1e82d9b49.tar.xz
status: contextually notify user about an initial commit
The existing message, "Initial commit", makes sense for the commit template notifying users that it's their initial commit, but is confusing when merely checking the status of a fresh repository (or orphan branch) without having any commits yet. Change the output of "status" to say "No commits yet" when "git status" is run on a fresh repo (or orphan branch), while retaining the current "Initial commit" message displayed in the template that's displayed in the editor when the initial commit is being authored. Correspondingly change the output of "short status" to "No commits yet on " when "git status -sb" is run on a fresh repo (or orphan branch). A few alternatives considered were, * Waiting for initial commit * Your current branch does not have any commits * Current branch waiting for initial commit The most succint one among the alternatives was chosen. [with help on tests from Ævar] Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 8d1cac0629..3d614a2ace 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1648,6 +1648,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);
+ s.commit_template = 1;
status_format = STATUS_FORMAT_NONE; /* Ignore status.short */
s.colopts = 0;