1. 21 3月, 2015 1 次提交
    • J
      t/test-lib: introduce --chain-lint option · bb79af9d
      Jeff King 提交于
      It's easy to miss an "&&"-chain in a test script, like:
      
        test_expect_success 'check something important' '
      	cmd1 &&
      	cmd2
      	cmd3
        '
      
      The test harness will notice if cmd3 fails, but a failure of
      cmd1 or cmd2 will go unnoticed, as their exit status is lost
      after cmd3 runs.
      
      The toy example above is easy to spot because the "cmds" are
      all the same length, but real code is much more complicated.
      It's also difficult to detect these situations by statically
      analyzing the shell code with regexps (like the
      check-non-portable-shell script does); there's too much
      context required to know whether a &&-chain is appropriate
      on a given line or not.
      
      This patch instead lets the shell check each test by
      sticking a command with a specific and unusual return code
      at the top of each test, like:
      
        (exit 117) &&
        cmd1 &&
        cmd2
        cmd3
      
      In a well-formed test, the non-zero exit from the first
      command prevents any of the rest from being run, and the
      test's exit code is 117. In a bad test (like the one above),
      the 117 is lost, and cmd3 is run.
      
      When we encounter a failure of this check, we abort the test
      script entirely. For one thing, we have no clue which subset
      of the commands in the test snippet were actually run.
      Running further tests would be pointless, because we're now
      in an unknown state. And two, this is not a "test failure"
      in the traditional sense. The test script is buggy, not the
      code it is testing. We should be able to fix these problems
      in the script once, and not have them come back later as a
      regression in git's code.
      
      After checking a test snippet for --chain-lint, we do still
      run the test itself.  We could actually have a pure-lint
      mode which just checks each test, but there are a few
      reasons not to. One, because the tests are executing
      arbitrary code, which could impact the later environment
      (e.g., that could impact which set of tests we run at all).
      And two, because a pure-lint mode would still be expensive
      to run, because a significant amount of code runs outside of
      the test_expect_* blocks.  Instead, this option is designed
      to be used as part of a normal test suite run, where it adds
      very little overhead.
      
      Turning on this option detects quite a few problems in
      existing tests, which will be fixed in subsequent patches.
      However, there are a number of places it cannot reach:
      
       - it cannot find a failure to break out of loops on error,
         like:
      
           cmd1 &&
           for i in a b c; do
      	     cmd2 $i
           done &&
           cmd3
      
         which will not notice failures of "cmd2 a" or "cmd b"
      
       - it cannot find a missing &&-chain inside a block or
         subfunction, like:
      
           foo () {
      	     cmd1
      	     cmd2
           }
      
           foo &&
           bar
      
         which will not notice a failure of cmd1.
      
       - it only checks tests that you run; every platform will
         have some tests skipped due to missing prequisites,
         so it's impossible to say from one run that the test
         suite is free of broken &&-chains. However, all tests get
         run by _somebody_, so eventually we will notice problems.
      
       - it does not operate on test_when_finished or prerequisite
         blocks. It could, but these tends to be much shorter and
         less of a problem, so I punted on them in this patch.
      
      This patch was inspired by an earlier patch by Jonathan
      Nieder:
      
        http://article.gmane.org/gmane.comp.version-control.git/235913
      
      This implementation and all bugs are mine.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bb79af9d
  2. 18 3月, 2015 9 次提交
    • J
      Post 2.3 cyce (batch #10) · 9ab698f4
      Junio C Hamano 提交于
      Also declare that the next one will be called v2.4 ;-)
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9ab698f4
    • J
      Merge branch 'mg/doc-status-color-slot' · 2a39bdb9
      Junio C Hamano 提交于
      Documentation fixes.
      
      * mg/doc-status-color-slot:
        config,completion: add color.status.unmerged
      2a39bdb9
    • J
      Merge branch 'mg/status-v-v' · 9bb56e47
      Junio C Hamano 提交于
      "git status" now allows the "-v" to be given twice to show the
      differences that are left in the working tree not to be committed.
      
      * mg/status-v-v:
        commit/status: show the index-worktree diff with -v -v
        t7508: test git status -v
        t7508: .gitignore 'expect' and 'output' files
      9bb56e47
    • J
      Merge branch 'mg/sequencer-commit-messages-always-verbatim' · 795b0142
      Junio C Hamano 提交于
      "git cherry-pick" used to clean-up the log message even when it is
      merely replaying an existing commit.  It now replays the message
      verbatim unless you are editing the message of resulting commits.
      
      * mg/sequencer-commit-messages-always-verbatim:
        sequencer: preserve commit messages
      795b0142
    • J
      Merge branch 'sg/completion-remote' · e5b8ce24
      Junio C Hamano 提交于
      Code simplification.
      
      * sg/completion-remote:
        completion: simplify __git_remotes()
        completion: add a test for __git_remotes() helper function
      e5b8ce24
    • J
      Merge branch 'es/rebase-i-count-todo' · fbcbcee5
      Junio C Hamano 提交于
      "git rebase -i" recently started to include the number of
      commits in the insn sheet to be processed, but on a platform
      that prepends leading whitespaces to "wc -l" output, the numbers
      are shown with extra whitespaces that aren't necessary.
      
      * es/rebase-i-count-todo:
        rebase-interactive: re-word "item count" comment
        rebase-interactive: suppress whitespace preceding item count
      fbcbcee5
    • J
      Merge branch 'ak/git-done-help-cleanup' · 860b05b7
      Junio C Hamano 提交于
      Code simplification.
      
      * ak/git-done-help-cleanup:
        git: make was_alias and done_help non-static
      860b05b7
    • J
      Merge branch 'rs/zip-text' · f0b7ab35
      Junio C Hamano 提交于
      "git archive" can now be told to set the 'text' attribute in the
      resulting zip archive.
      
      * rs/zip-text:
        archive-zip: mark text files in archives
      f0b7ab35
    • J
      Merge branch 'rs/deflate-init-cleanup' · 6902c4da
      Junio C Hamano 提交于
      Code simplification.
      
      * rs/deflate-init-cleanup:
        zlib: initialize git_zstream in git_deflate_init{,_gzip,_raw}
      6902c4da
  3. 14 3月, 2015 14 次提交
    • J
      Sync with 2.3.3 · 52cae643
      Junio C Hamano 提交于
      52cae643
    • J
      Git 2.3.3 · bb857753
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bb857753
    • J
      Merge branch 'mr/doc-clean-f-f' into maint · 4b23b5d1
      Junio C Hamano 提交于
      Documentation update.
      
      * mr/doc-clean-f-f:
        Documentation/git-clean.txt: document that -f may need to be given twice
      4b23b5d1
    • J
      Merge branch 'ak/t5516-typofix' into maint · 113bc160
      Junio C Hamano 提交于
      * ak/t5516-typofix:
        t5516: correct misspelled pushInsteadOf
      113bc160
    • J
      Merge branch 'jc/diff-test-updates' into maint · bb8f6de0
      Junio C Hamano 提交于
      Test clean-up.
      
      * jc/diff-test-updates:
        test_ln_s_add: refresh stat info of fake symbolic links
        t4008: modernise style
        t/diff-lib: check exact object names in compare_diff_raw
        tests: do not borrow from COPYING and README from the real source
        t4010: correct expected object names
        t9300: correct expected object names
        t4008: correct stale comments
      bb8f6de0
    • J
      Merge branch 'jk/diffcore-rename-duplicate' into maint · 3aab60b3
      Junio C Hamano 提交于
      A corrupt input to "git diff -M" can cause us to segfault.
      
      * jk/diffcore-rename-duplicate:
        diffcore-rename: avoid processing duplicate destinations
        diffcore-rename: split locate_rename_dst into two functions
      3aab60b3
    • J
      Merge branch 'bw/kwset-use-unsigned' into maint · ae8ada45
      Junio C Hamano 提交于
      The borrowed code in kwset API did not follow our usual convention
      to use "unsigned char" to store values that range from 0-255.
      
      * bw/kwset-use-unsigned:
        kwset: use unsigned char to store values with high-bit set
      ae8ada45
    • J
      Merge branch 'nd/grep-exclude-standard-help-fix' into maint · 2408f3b7
      Junio C Hamano 提交于
      Description given by "grep -h" for its --exclude-standard option
      was phrased poorly.
      
      * nd/grep-exclude-standard-help-fix:
        grep: correct help string for --exclude-standard
      2408f3b7
    • J
      Merge branch 'mg/doc-remote-tags-or-not' into maint · 3af1bcaf
      Junio C Hamano 提交于
      "git remote add" mentioned "--tags" and "--no-tags" and was not
      clear that fetch from the remote in the future will use the default
      behaviour when neither is given to override it.
      
      * mg/doc-remote-tags-or-not:
        git-remote.txt: describe behavior without --tags and --no-tags
      3af1bcaf
    • J
      Merge branch 'mk/diff-shortstat-dirstat-fix' into maint · a4b4f9b8
      Junio C Hamano 提交于
      "git diff --shortstat --dirstat=changes" showed a dirstat based on
      lines that was never asked by the end user in addition to the
      dirstat that the user asked for.
      
      * mk/diff-shortstat-dirstat-fix:
        diff --shortstat --dirstat: remove duplicate output
      a4b4f9b8
    • J
      Merge branch 'ms/submodule-update-config-doc' into maint · 30a52c1d
      Junio C Hamano 提交于
      The interaction between "git submodule update" and the
      submodule.*.update configuration was not clearly documented.
      
      * ms/submodule-update-config-doc:
        submodule: improve documentation of update subcommand
      30a52c1d
    • J
      Merge branch 'jc/apply-beyond-symlink' into maint · 5244a310
      Junio C Hamano 提交于
      "git apply" was not very careful about reading from, removing,
      updating and creating paths outside the working tree (under
      --index/--cached) or the current directory (when used as a
      replacement for GNU patch).
      
      * jc/apply-beyond-symlink:
        apply: do not touch a file beyond a symbolic link
        apply: do not read from beyond a symbolic link
        apply: do not read from the filesystem under --index
        apply: reject input that touches outside the working area
      5244a310
    • J
      Merge branch 'rs/daemon-interpolate' into maint · 1469d990
      Junio C Hamano 提交于
      "git daemon" looked up the hostname even when "%CH" and "%IP"
      interpolations are not requested, which was unnecessary.
      
      * rs/daemon-interpolate:
        daemon: use callback to build interpolated path
        daemon: look up client-supplied hostname lazily
      1469d990
    • J
      Merge branch 'jk/daemon-interpolate' into maint · c722ba48
      Junio C Hamano 提交于
      The "interpolated-path" option of "git daemon" inserted any string
      client declared on the "host=" capability request without checking.
      Sanitize and limit %H and %CH to a saner and a valid DNS name.
      
      * jk/daemon-interpolate:
        daemon: sanitize incoming virtual hostname
        t5570: test git-daemon's --interpolated-path option
        git_connect: let user override virtual-host we send to daemon
      c722ba48
  4. 11 3月, 2015 4 次提交
  5. 07 3月, 2015 12 次提交