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

[PATCH] rewrite t1500-rev-parse.sh

From
Michael Rappazzo <rappazzo@gmail.com>
Date
Apr 9, 2016, 11:19 UTC
Message-ID
<1460200767-32864-1-git-send-email-rappazzo@gmail.com>

I was working on a simple bug fix[1], and I wanted to add a test to t1500. I put the new test at the beginning rather than try to decipher what state the test run would be in at the end. In the review, Eric Sunshine described the test:

> this script is ancient and cd's all around the place with wild abandon and
> leaks environment variables

I decided to rewrite this test in (what I hope is) the modern test format. In doing so, I expanded the size of the test file greatly, but I think it is much clearer to read and understand as you go through it. This also has the advantage of allowing a tester to use verbose options when testing. As noted in the commit comment, tests which compare text (rather than booleans) were also adjusted to use the test_cmp function.

This patch is based on 'pu' because of a feature to add `--absolute-git-dir` to rev-parse[2].

I considered including this patch as the first commit in the aforementioned bug fix, but I wanted to get it out for review to make sure that it is acceptible.

[1]http://thread.gmane.org/gmane.comp.version-control.git/290669 [2]http://article.gmane.org/gmane.comp.version-control.git/287462

Michael Rappazzo (1):
  t1500-rev-parse: rewrite each test to run in isolation
 t/t1500-rev-parse.sh | 607 +++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 545 insertions(+), 62 deletions(-)
-- 
2.8.0
Next: Michael Rappazzo
Message 1 of 7 in “rewrite t1500-rev-parse.sh”
  1. rewrite t1500-rev-parse.shMichael Rappazzo, Apr 9, 2016
  2. t1500-rev-parse: rewrite each test to run in isolationMichael Rappazzo, Apr 9, 2016
  3. Junio C HamanoApr 13, 2016
  4. SZEDER GáborApr 16, 2016
  5. Eric SunshineApr 13, 2016
  6. Mike RappazzoApr 13, 2016
  7. Jeff KingApr 13, 2016

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.