<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t, branch v2.10.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.10.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.10.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-10-28T16:01:24Z</updated>
<entry>
<title>Merge branch 'pb/test-parse-options-expect' into maint</title>
<updated>2016-10-28T16:01:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-28T16:01:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=020222ef4dc1c8478fd217ccc524677215674821'/>
<id>urn:sha1:020222ef4dc1c8478fd217ccc524677215674821</id>
<content type='text'>
Test clean-up.

* pb/test-parse-options-expect:
  t0040: convert all possible tests to use `test-parse-options --expect`
</content>
</entry>
<entry>
<title>Merge branch 'jk/tap-verbose-fix' into maint</title>
<updated>2016-10-28T16:01:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-28T16:01:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b943a213fe6740f64e2ce3fafebce453814115d9'/>
<id>urn:sha1:b943a213fe6740f64e2ce3fafebce453814115d9</id>
<content type='text'>
The Travis CI configuration we ship ran the tests with --verbose
option but this risks non-TAP output that happens to be "ok" to be
misinterpreted as TAP signalling a test that passed.  This resulted
in unnecessary failure.  This has been corrected by introducing a
new mode to run our tests in the test harness to send the verbose
output separately to the log file.

* jk/tap-verbose-fix:
  test-lib: bail out when "-v" used under "prove"
  travis: use --verbose-log test option
  test-lib: add --verbose-log option
  test-lib: handle TEST_OUTPUT_DIRECTORY with spaces
</content>
</entry>
<entry>
<title>Merge branch 'tg/add-chmod+x-fix' into maint</title>
<updated>2016-10-28T16:01:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-28T16:01:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dce97d6ec73cdb1011589f7260e602a87088939b'/>
<id>urn:sha1:dce97d6ec73cdb1011589f7260e602a87088939b</id>
<content type='text'>
A hot-fix for a test added by a recent topic that went to both
'master' and 'maint' already.

* tg/add-chmod+x-fix:
  t3700: fix broken test under !SANITY
</content>
</entry>
<entry>
<title>Merge branch 'jk/fetch-quick-tag-following' into maint</title>
<updated>2016-10-28T16:01:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-28T16:01:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=39000e849970a554a257577dcb2fb844a523a1d1'/>
<id>urn:sha1:39000e849970a554a257577dcb2fb844a523a1d1</id>
<content type='text'>
When fetching from a remote that has many tags that are irrelevant
to branches we are following, we used to waste way too many cycles
when checking if the object pointed at by a tag (that we are not
going to fetch!) exists in our repository too carefully.

* jk/fetch-quick-tag-following:
  fetch: use "quick" has_sha1_file for tag following
</content>
</entry>
<entry>
<title>Merge branch 'jk/merge-base-fork-point-without-reflog' into maint</title>
<updated>2016-10-28T16:01:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-28T16:01:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=96ec83ce5207be0aac3c1df1ac92356f9de9ad81'/>
<id>urn:sha1:96ec83ce5207be0aac3c1df1ac92356f9de9ad81</id>
<content type='text'>
"git rebase" immediately after "git clone" failed to find the fork
point from the upstream.

* jk/merge-base-fork-point-without-reflog:
  merge-base: handle --fork-point without reflog
</content>
</entry>
<entry>
<title>Merge branch 'dk/worktree-dup-checkout-with-bare-is-ok' into maint</title>
<updated>2016-10-28T16:01:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-28T16:01:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a5406125cc3989a7007d4fad7e5757cdb9837ebf'/>
<id>urn:sha1:a5406125cc3989a7007d4fad7e5757cdb9837ebf</id>
<content type='text'>
In a worktree connected to a repository elsewhere, created via "git
worktree", "git checkout" attempts to protect users from confusion
by refusing to check out a branch that is already checked out in
another worktree.  However, this also prevented checking out a
branch, which is designated as the primary branch of a bare
reopsitory, in a worktree that is connected to the bare
repository.  The check has been corrected to allow it.

* dk/worktree-dup-checkout-with-bare-is-ok:
  worktree: allow the main brach of a bare repository to be checked out
</content>
</entry>
<entry>
<title>Merge branch 'jk/ref-symlink-loop' into maint</title>
<updated>2016-10-28T16:01:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-28T16:01:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=42a9c6c0e2060327def808d9c4c2aa167d6d8934'/>
<id>urn:sha1:42a9c6c0e2060327def808d9c4c2aa167d6d8934</id>
<content type='text'>
A stray symbolic link in $GIT_DIR/refs/ directory could make name
resolution loop forever, which has been corrected.

* jk/ref-symlink-loop:
  files_read_raw_ref: prevent infinite retry loops in general
  files_read_raw_ref: avoid infinite loop on broken symlinks
</content>
</entry>
<entry>
<title>test-lib: bail out when "-v" used under "prove"</title>
<updated>2016-10-24T16:26:00Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-22T04:45:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=614fe015212d057c0571885c42a29a995973107d'/>
<id>urn:sha1:614fe015212d057c0571885c42a29a995973107d</id>
<content type='text'>
When there is a TAP harness consuming the output of our test
scripts, the "--verbose" breaks the output by mingling
test command output with TAP. Because the TAP::Harness
module used by "prove" is fairly lenient, this _usually_
works, but it violates the spec, and things get very
confusing if the commands happen to output a line that looks
like TAP (e.g., the word "ok" on its own line).

Let's detect this situation and complain. Just calling
error() isn't great, though; prove will tell us that the
script failed, but the message doesn't make it through to
the user. Instead, we can use the special TAP signal "Bail
out!". This not only shows the message to the user, but
instructs the harness to stop running the tests entirely.
This is exactly what we want here, as the problem is in the
command-line options, and every test script would produce
the same error.

The result looks like this (the first "Bailout called" line
is in red if prove uses color on your terminal):

 $ make GIT_TEST_OPTS='--verbose --tee'
 rm -f -r 'test-results'
 *** prove ***
 Bailout called.  Further testing stopped:  verbose mode forbidden under TAP harness; try --verbose-log
 FAILED--Further testing stopped: verbose mode forbidden under TAP harness; try --verbose-log
 Makefile:39: recipe for target 'prove' failed
 make: *** [prove] Error 255

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>test-lib: add --verbose-log option</title>
<updated>2016-10-21T16:54:35Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-21T10:48:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=452320f1f53a579f891eba678993508e7cbf3339'/>
<id>urn:sha1:452320f1f53a579f891eba678993508e7cbf3339</id>
<content type='text'>
The "--verbose" option redirects output from arbitrary
test commands to stdout. This is useful for examining the
output manually, like:

  ./t5547-push-quarantine.sh -v | less

But it also means that the output is intermingled with the
TAP directives, which can confuse a TAP parser like "prove".
This has always been a potential problem, but became an
issue recently when one test happened to output the word
"ok" on a line by itself, which prove interprets as a test
success:

  $ prove t5547-push-quarantine.sh :: -v
  t5547-push-quarantine.sh .. 1/? To dest.git
   * [new branch]      HEAD -&gt; master
  To dest.git
   ! [remote rejected] reject -&gt; reject (pre-receive hook declined)
  error: failed to push some refs to 'dest.git'
  fatal: git cat-file d08c8eba97f4e683ece08654c7c8d2ba0c03b129: bad file
  t5547-push-quarantine.sh .. Failed -1/4 subtests

  Test Summary Report
  -------------------
  t5547-push-quarantine.sh (Wstat: 0 Tests: 5 Failed: 0)
    Parse errors: Tests out of sequence.  Found (2) but expected (3)
                  Tests out of sequence.  Found (3) but expected (4)
                  Tests out of sequence.  Found (4) but expected (5)
                  Bad plan.  You planned 4 tests but ran 5.
  Files=1, Tests=5,  0 wallclock secs ( 0.01 usr +  0.01 sys =  0.02 CPU)
  Result: FAIL

One answer is "if it hurts, don't do it", but that's not
quite the whole story. The Travis tests use "--verbose
--tee" so that they can get the benefit of prove's parallel
options, along with a verbose log in case there is a
failure. We just need the verbose output to go to the log,
but keep stdout clean.

Getting this right turns out to be surprisingly difficult.
Here's the progression of alternatives I considered:

 1. Add an option to write verbose output to stderr. This is
    hard to capture, though, because we want each test to
    have its own log (because they're all run in parallel
    and the jumbled output would be useless).

 2. Add an option to write verbose output to a file in
    test-results. This works, but the log is missing all of
    the non-verbose output, which gives context.

 3. Like (2), but teach say_color() to additionally output
    to the log. This mostly works, but misses any output
    that happens outside of the say() functions (which isn't
    a lot, but is a potential maintenance headache).

 4. Like (2), but make the log file the same as the "--tee"
    file. That almost works, but now we have two processes
    opening the same file. That gives us two separate
    descriptors, each with their own idea of the current
    position. They'll each start writing at offset 0, and
    overwrite each other's data.

 5. Like (4), but in each case open the file for appending.
    That atomically positions each write at the end of the
    file.

    It's possible we may still get sheared writes between
    the two processes, but this is already the case when
    writing to stdout. It's not a problem in practice
    because the test harness generally waits for snippets to
    finish before writing the TAP output.

    We can ignore buffering issues with tee, because POSIX
    mandates that it does not buffer. Likewise, POSIX
    specifies "tee -a", so it should be available
    everywhere.

This patch implements option (5), which seems to work well
in practice.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>test-lib: handle TEST_OUTPUT_DIRECTORY with spaces</title>
<updated>2016-10-21T16:54:34Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-21T10:42:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=925bdc928e3debdc6dbf28b5648711eb1c5583d3'/>
<id>urn:sha1:925bdc928e3debdc6dbf28b5648711eb1c5583d3</id>
<content type='text'>
We are careful in test_done to handle a results directory
with a space in it, but the "--tee" code path does not.
Doing:

  export TEST_OUTPUT_DIRECTORY='/tmp/path with spaces'
  ./t000-init.sh --tee

results in errors. Let's consistently double-quote our path
variables so that this works.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
