Thread (13 messages) flat view 13 messages, 3 authors, 2017-06-21

Re: [PATCH/FINAL] status: contextually notify user about an initial commit

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2017-06-21 14:52:15

Possibly related (same subject, not in this thread)

On Wed, Jun 21 2017, Kaartic Sivaraam jotted:
On Wed, 2017-06-21 at 08:07 +0530, Kaartic Sivaraam wrote:
quoted
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.

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.

Helped-by: Junio C Hamano [off-list ref]
Signed-off-by: Kaartic Sivaraam <redacted>
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---

The 'FINAL' part in the subject is just my opinion about
this patch
Just for the note, the tests passed locally and all travis-ci builds
jobs succeeded except for the one in which the 'GITTEXT_POISON'
environment variable is enabled. I guess that isn't an issue, from what
I came to know while digging about it.
No, this is a bug in your patch, the test suite should pass under
poison.

The issue is that you changed the test code I gave you (to also add more
tests, yay) along the way to do:

    test_must_fail test_i18ngrep ...

Instead of the correct form:

    test_i18ngrep ! ...

This fixup for your patch makes it work again:
    
    diff --git a/t/t7508-status.sh b/t/t7508-status.sh
    index e0d2c9e581..b3743ff0a8 100755
    --- a/t/t7508-status.sh
    +++ b/t/t7508-status.sh
    @@ -1618,7 +1618,7 @@ test_expect_success '"No commits yet" should not be noted in status output' '
            git checkout --orphan empty-branch-2 &&
            test_commit test-commit-1 &&
            git status >output &&
    -       test_must_fail test_i18ngrep "No commits yet" output
    +       test_i18ngrep ! "No commits yet" output
     '
     
     test_expect_success '"Initial commit" should be noted in commit template' '
    @@ -1635,7 +1635,7 @@ test_expect_success '"Initial commit" should not be noted in commit template' '
            touch to_be_committed_2 &&
            git add to_be_committed_2 &&
            git commit --dry-run >output &&
    -       test_must_fail test_i18ngrep "Initial commit" output
    +       test_i18ngrep ! "Initial commit" output
     '
     
     test_done
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help