status: contextually notify user about an initial commit
commit4ddb1354e8d5daf5671d3d451a67d2d1e82d9b49
authorKaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Wed, 21 Jun 2017 18:16:14 +0000 (21 23:46 +0530)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Jun 2017 02:10:27 +0000 (21 19:10 -0700)
treeeb1bde38d4ccabc7267c26ee737def7520b5b632
parentfd99e2bda0ca6a361ef03c04d6d7fdc7a9c40b78
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>
builtin/commit.c
t/t7501-commit.sh
t/t7508-status.sh
wt-status.c
wt-status.h