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

Re: [PATCH v14 4/4] ls-remote: create '--sort' option

From
René Scharfe <l.s.r@web.de>
Date
May 12, 2018, 08:45 UTC
Message-ID
<b5555929-9f7c-1c4a-78e8-708ebdaaa9d2@web.de>
In-Reply-To
<20180409014226.2647-4-haraldnordgren@gmail.com>
Am 09.04.2018 um 03:42 schrieb Harald Nordgren:
> diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
> index 02106c922..83cd35c39 100755
> --- a/t/t5512-ls-remote.sh
> +++ b/t/t5512-ls-remote.sh
Show 25 quoted lines
> @@ -170,14 +206,18 @@ test_expect_success 'overrides work between mixed transfer/upload-pack hideRefs'
>   	grep refs/tags/magic actual
>   '
>   
> +git fetch origin
>   test_expect_success 'ls-remote --symref' '
> -	cat >expect <<-\EOF &&
> +	cat >expect <<-EOF &&
>   	ref: refs/heads/master	HEAD
> -	1bd44cb9d13204b0fe1958db0082f5028a16eb3a	HEAD
> -	1bd44cb9d13204b0fe1958db0082f5028a16eb3a	refs/heads/master
> -	1bd44cb9d13204b0fe1958db0082f5028a16eb3a	refs/remotes/origin/HEAD
> -	1bd44cb9d13204b0fe1958db0082f5028a16eb3a	refs/remotes/origin/master
> -	1bd44cb9d13204b0fe1958db0082f5028a16eb3a	refs/tags/mark
> +	$(git rev-parse HEAD)	HEAD
> +	$(git rev-parse refs/heads/master)	refs/heads/master
> +	$(git rev-parse HEAD)	refs/remotes/origin/HEAD
> +	$(git rev-parse refs/remotes/origin/master)	refs/remotes/origin/master
> +	$(git rev-parse refs/tags/mark)	refs/tags/mark
> +	$(git rev-parse refs/tags/mark1.1)	refs/tags/mark1.1
> +	$(git rev-parse refs/tags/mark1.10)	refs/tags/mark1.10
> +	$(git rev-parse refs/tags/mark1.2)	refs/tags/mark1.2
>   	EOF
>   	git ls-remote --symref >actual &&
>   	test_cmp expect actual

Why is fetch called outside of the test? Its output is shown among the test messages, where it doesn't belong:

    ok 23 - overrides work between mixed transfer/upload-pack hideRefs
    From /home/lsr/src/git/t/trash directory.t5512-ls-remote/
     * [new branch]      master     -> origin/master
    ok 24 - ls-remote --symref
-- >8 --
Subject: [PATCH] t5512: run git fetch inside test

Do the preparatory fetch inside the test of ls-remote --symref to avoid cluttering the test output and to be able to catch unexpected fetch failures.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 t/t5512-ls-remote.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index 83cd35c391..6a949484d0 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -206,8 +206,8 @@ test_expect_success 'overrides work between mixed transfer/upload-pack hideRefs'
 	grep refs/tags/magic actual
 '
 
-git fetch origin
 test_expect_success 'ls-remote --symref' '
+	git fetch origin &&
 	cat >expect <<-EOF &&
 	ref: refs/heads/master	HEAD
 	$(git rev-parse HEAD)	HEAD
-- 
2.17.0
Previous: Harald NordgrenNext: Jeff King
Message 61 of 62 in “ls-remote: create option to sort by versions”
  1. ls-remote: create option to sort by versionsHarald Nordgren, Apr 2, 2018
  2. Ævar Arnfjörð BjarmasonApr 2, 2018
  3. Harald NordgrenApr 2, 2018
  4. Ævar Arnfjörð BjarmasonApr 2, 2018
  5. Harald NordgrenApr 2, 2018
  6. Jeff KingApr 2, 2018
  7. Junio C HamanoApr 2, 2018
  8. Harald NordgrenApr 2, 2018
  9. ls-remote: create '--sort' optionHarald Nordgren, Apr 2, 2018
  10. Eric SunshineApr 2, 2018
  11. Eric SunshineApr 2, 2018
  12. ls-remote: create '--sort' optionHarald Nordgren, Apr 3, 2018
  13. ls-remote: create '--sort' optionHarald Nordgren, Apr 2, 2018
  14. ls-remote: create '--sort' optionHarald Nordgren, Apr 4, 2018
  15. Harald NordgrenApr 4, 2018
  16. Harald NordgrenApr 4, 2018
  17. Jeff KingApr 4, 2018
  18. Jeff KingApr 4, 2018
  19. ls-remote: create '--sort' optionHarald Nordgren, Apr 4, 2018
  20. Harald NordgrenApr 4, 2018
  21. Jeff KingApr 6, 2018
  22. 1/3 ref-filter: use "struct object_id" consistentlyJeff King, Apr 6, 2018
  23. 2/3 ref-filter: make ref_array_item allocation more consistentJeff King, Apr 6, 2018
  24. 3/3 ref-filter: factor ref_array pushing into its own functionJeff King, Apr 6, 2018
  25. Derrick StoleeApr 6, 2018
  26. Harald NordgrenApr 7, 2018
  27. Junio C HamanoApr 8, 2018
  28. Jeff KingApr 9, 2018
  29. ls-remote: create '--sort' optionHarald Nordgren, Apr 4, 2018
  30. ls-remote: create '--sort' optionHarald Nordgren, Apr 5, 2018
  31. 1/4 ref-filter: use "struct object_id" consistentlyHarald Nordgren, Apr 7, 2018
  32. 2/4 ref-filter: make ref_array_item allocation more consistentHarald Nordgren, Apr 7, 2018
  33. 3/4 ref-filter: factor ref_array pushing into its own functionHarald Nordgren, Apr 7, 2018
  34. 4/4 ls-remote: create '--sort' optionHarald Nordgren, Apr 7, 2018
  35. Eric SunshineApr 8, 2018
  36. Eric SunshineApr 8, 2018
  37. Harald NordgrenApr 8, 2018
  38. 1/4 ref-filter: use "struct object_id" consistentlyHarald Nordgren, Apr 8, 2018
  39. 3/4 ref-filter: factor ref_array pushing into its own functionHarald Nordgren, Apr 8, 2018
  40. 4/4 ls-remote: create '--sort' optionHarald Nordgren, Apr 8, 2018
  41. Junio C HamanoApr 8, 2018
  42. Harald NordgrenApr 9, 2018
  43. Junio C HamanoApr 9, 2018
  44. Eric SunshineApr 9, 2018
  45. 2/4 ref-filter: make ref_array_item allocation more consistentHarald Nordgren, Apr 8, 2018
  46. 1/4 ref-filter: use "struct object_id" consistentlyHarald Nordgren, Apr 8, 2018
  47. 2/4 ref-filter: make ref_array_item allocation more consistentHarald Nordgren, Apr 8, 2018
  48. 4/4 ls-remote: create '--sort' optionHarald Nordgren, Apr 8, 2018
  49. Junio C HamanoApr 9, 2018
  50. Harald NordgrenApr 9, 2018
  51. 3/4 ref-filter: factor ref_array pushing into its own functionHarald Nordgren, Apr 8, 2018
  52. 1/4 ref-filter: use "struct object_id" consistentlyHarald Nordgren, Apr 9, 2018
  53. 2/4 ref-filter: make ref_array_item allocation more consistentHarald Nordgren, Apr 9, 2018
  54. Harald NordgrenApr 11, 2018
  55. Stefan BellerApr 11, 2018
  56. Todd ZullingerApr 11, 2018
  57. Eric SunshineApr 11, 2018
  58. Junio C HamanoApr 11, 2018
  59. 3/4 ref-filter: factor ref_array pushing into its own functionHarald Nordgren, Apr 9, 2018
  60. 4/4 ls-remote: create '--sort' optionHarald Nordgren, Apr 9, 2018
  61. René ScharfeMay 12, 2018
  62. Jeff KingMay 12, 2018

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.