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

Re: [PATCH] status: show in-progress info for short status

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 31, 2017, 18:14 UTC
Message-ID
<xmqq8tnlz53m.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<2c3c8028cd057428758bb1e21a064a264936de90.1490968428.git.git@grubix.eu>
Michael J Gruber <git@grubix.eu> writes:
Show 12 quoted lines
> Ordinary (long) status shows information about bisect, revert, am,
> rebase, cherry-pick in progress, and so does git-prompt.sh. status
> --short currently shows none of this information.
>
> Introduce an `--inprogress` argument to git status so that, when used with
> `--short --branch`, in-progress information is shown next to the branch
> information. Just like `--branch`, this comes with a config option.
>
> The wording for the in-progress information is taken over from
> git-prompt.sh.
>
> Signed-off-by: Michael J Gruber <git@grubix.eu>

I haven't formed an opinion on the feature itself, or the way it is triggered, so I won't comment on them. I just say --porcelain (any version) may (or may not) want to be extended in backward compatible way (but again I haven't formed an opinion on the issue--I just know and say there is an issue there that needs to be considered at this point).

Show 25 quoted lines
> diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
> index 458608cc1e..103e006249 100755
> --- a/t/t7512-status-help.sh
> +++ b/t/t7512-status-help.sh
> @@ -74,7 +74,6 @@ test_expect_success 'prepare for rebase conflicts' '
>  
>  
>  test_expect_success 'status when rebase in progress before resolving conflicts' '
> -	test_when_finished "git rebase --abort" &&
>  	ONTO=$(git rev-parse --short HEAD^^) &&
>  	test_must_fail git rebase HEAD^ --onto HEAD^^ &&
>  	cat >expected <<EOF &&
> @@ -96,6 +95,15 @@ EOF
>  	test_i18ncmp expected actual
>  '
>  
> +test_expect_success 'short status when rebase in progress' '
> +	test_when_finished "git rebase --abort" &&
> +	cat >expected <<EOF &&
> +## HEAD (no branch); REBASE-m
> +UU main.txt
> +EOF
> +	git status --untracked-files=no --short --branch --inprogress >actual &&
> +	test_i18ncmp expected actual
> +'

This is not a good way to structure the test. If the one in the previous hunk is what creates a conflicted state by running "rebase", check the status output from within that test, after the conflicting "rebase" fails and other things the existing test checks are tested. That way, you do not have to worry about this new check getting confused if the previous one fails in the middle.

Likewise for the most (if not all---I didn't check very carefully) of the remaining hunks in this test script.

Previous: Michael J GruberNext: Michael J Gruber
Message 2 of 13 in “status: show in-progress info for short status”
  1. status: show in-progress info for short statusMichael J Gruber, Mar 31, 2017
  2. Junio C HamanoMar 31, 2017
  3. Michael J GruberApr 7, 2017
  4. Jacob KellerApr 7, 2017
  5. Junio C HamanoApr 13, 2017
  6. Jacob KellerApr 13, 2017
  7. Junio C HamanoMay 11, 2017
  8. Jacob KellerApr 13, 2017
  9. brian m. carlsonApr 1, 2017
  10. SZEDER GáborApr 6, 2017
  11. Michael J GruberApr 7, 2017
  12. SZEDER GáborApr 13, 2017
  13. Junio C HamanoApr 17, 2017

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.