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

Re: sh -x -i -v with continuous integration, was Re: [PATCH 1/4] t7601: test for pull.ff=true overrides merge.ff=false

From
Jeff King <peff@peff.net>
Date
May 18, 2015, 18:45 UTC
Message-ID
<20150518184528.GA11463@peff.net>
In-Reply-To
<xmqq1tigfij8.fsf@gitster.dls.corp.google.com>
On Sat, May 16, 2015 at 12:07:23PM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > Do we object to having to sprinkle the "verbose" throughout the test
> > scripts?
> 
> Yes.  
> 
> An unconstrained "verbose" that applies to anything would make
> people less careful to come up with more useful abstractions,
> e.g. test_line_count, which I view as a bigger problem.
I don't think that is true at all. They serve two different purposes.

We need "test_line_count" because of portability considerations. But we do not need "test_eq" for that; the only reason to add it is for debuggable output. We _could_ add a bunch of little helpers to cover each situation, but empirically we have not[1], because it's annoying to do so. Instead we just write a bare "test". I had hoped that "verbose" would make it sufficiently easy to improve upon the status quo that people would actually use it[2].

So I don't really buy the argument that "verbose" makes things worse. I think I _do_ buy the argument that it is not worth the extra effort given that I implemented "-x" around the same time. I think the "verbose" output is a little nicer, as I said earlier, but having the test-writer do literally zero work may be worth it.

-Peff
[1] The exception, AFAIK, is test_path_is_*.
[2] For the most part, actually, I think the status quo is using
    test_cmp, and most of the uses of "test" are old. Using test_cmp is
    more verbose, but it does have the advantage of checking the exit
    code of the sub-programs (and also its output is much saner for
    multi-line comparisons, but that isn't relevant to Paul's patches).
    I'd be in favor of helpers that made it shorter to use test_cmp.
    E.g.:
      # "actual" contains "foo\n"; we save one line of "echo"
      git foo >actual &&
      test_cmp_str foo actual
      # same, but take multiline input on stdin. Saves one line of "cat"
      git foo >actual &&
      test_cmp_str - actual <<-\EOF
      foo
      EOF
      # similar, but it runs the command for us and compares its
      # stdout, saving another line. Note that we take stdout as-is,
      # so you get no opportunity to post-process it (but you
      # can still do it the "long" way as above if you need to).
      test_cmp_cmd foo git foo
      # same, with stdin; obviously this doesn't work if you need to
      # send something over stdin to the command, but again, you can
      # fallback to the old way.
      test_cmp_cmd - git foo <<-\EOF
      foo
      EOF
   These also go in the direction of "verbose", by providing generic
   solutions rather than specific ones. So by the argument you made
   above, this is a bad thing.
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 17 in “make pull.ff=true override merge.ff”
  1. 0/4 make pull.ff=true override merge.ffPaul Tan, May 13, 2015
  2. 1/4 t7601: test for pull.ff=true overrides merge.ff=falsePaul Tan, May 13, 2015
  3. Johannes SchindelinMay 14, 2015
  4. Junio C HamanoMay 14, 2015
  5. sh -x -i -v with continuous integration, was Re: [PATCH 1/4] t7601: test for pull.ff=true overrides merge.ff=falseJohannes Schindelin, May 14, 2015
  6. Junio C HamanoMay 14, 2015
  7. Jeff KingMay 16, 2015
  8. Junio C HamanoMay 16, 2015
  9. Jeff KingMay 18, 2015
  10. Junio C HamanoMay 18, 2015
  11. Jeff KingMay 18, 2015
  12. Junio C HamanoMay 18, 2015
  13. Paul TanMay 16, 2015
  14. 2/4 pull: make pull.ff=true override merge.ffPaul Tan, May 13, 2015
  15. 3/4 Documentation/config.txt: clarify that pull.ff overrides merge.ffPaul Tan, May 13, 2015
  16. 4/4 pull: parse pull.ff as a bool or stringPaul Tan, May 13, 2015
  17. Johannes SchindelinMay 14, 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.