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

Re: [PATCH v2 3/4] log --count: added test

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jul 3, 2015, 07:34 UTC
Message-ID
<vpqwpyh4rup.fsf@anie.imag.fr>
In-Reply-To
<1435881011-13879-4-git-send-email-lawrencesiebert@gmail.com>
Lawrence Siebert <lawrencesiebert@gmail.com> writes:
> added test comparing output between git log --count HEAD and
> git rev-list --count HEAD

Unless there is a very long list of tests, I'd rather see this squashed with PATCH 2/4. As a reviewer I prefer having code and tests in the same place.

Show 16 quoted lines
> Signed-off-by: Lawrence Siebert <lawrencesiebert@gmail.com>
> ---
>  t/t4202-log.sh | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index 1b2e981..35f8d82 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -871,4 +871,11 @@ test_expect_success 'log --graph --no-walk is forbidden' '
>  	test_must_fail git log --graph --no-walk
>  '
>  
> +test_expect_success 'log --count' '
> +	git log --count HEAD > actual &&
> +	git	rev-list --count HEAD > expect &&
The weird space is still there.
Also, we write ">actual", not "> actual" in the Git coding style.

That is actually a rather weak test. rev-list --count interacts with --left-right, so I guess you want to test --count --left-right.

Also, some revision-limiting options can reduce the count like
git log --grep whatever
and you should check that you actually count the right number here.

(I don't know this part of the code enough, but I'm not sure you actually deal with this properly)

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Lawrence SiebertNext: Lawrence Siebert
Message 11 of 17 in “git log --count”
  1. 0/4 git log --countLawrence Siebert, Jul 2, 2015
  2. 1/4 list-object: add get_commit_count functionLawrence Siebert, Jul 2, 2015
  3. Matthieu MoyJul 3, 2015
  4. Lawrence SiebertJul 3, 2015
  5. Matthieu MoyJul 3, 2015
  6. 2/4 log: add --count option to git logLawrence Siebert, Jul 2, 2015
  7. Matthieu MoyJul 3, 2015
  8. Lawrence SiebertJul 3, 2015
  9. Matthieu MoyJul 3, 2015
  10. 3/4 log --count: added testLawrence Siebert, Jul 2, 2015
  11. Matthieu MoyJul 3, 2015
  12. Lawrence SiebertJul 3, 2015
  13. Matthieu MoyJul 3, 2015
  14. Matthieu MoyJul 3, 2015
  15. Junio C HamanoJul 4, 2015
  16. Junio C HamanoJul 4, 2015
  17. 4/4 git-log: update man documentation for --countLawrence Siebert, Jul 2, 2015

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.