1. 30 5月, 2019 3 次提交
    • N
      parse-options: check empty value in OPT_INTEGER and OPT_ABBREV · f7e68a08
      Nguyễn Thái Ngọc Duy 提交于
      When parsing the argument for OPT_INTEGER and OPT_ABBREV, we check if we
      can parse the entire argument to a number with "if (*s)". There is one
      missing check: if "arg" is empty to begin with, we fail to notice.
      
      This could happen with long option by writing like
      
        git diff --inter-hunk-context= blah blah
      
      Before 16ed6c97 (diff-parseopt: convert --inter-hunk-context,
      2019-03-24), --inter-hunk-context is handled by a custom parser
      opt_arg() and does detect this correctly.
      
      This restores the bahvior for --inter-hunk-context and make sure all
      other integer options are handled the same (sane) way. For OPT_ABBREV
      this is new behavior. But it makes it consistent with the rest.
      
      PS. OPT_MAGNITUDE has similar code but git_parse_ulong() does detect
      empty "arg". So it's good to go.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f7e68a08
    • N
      diff-parseopt: restore -U (no argument) behavior · 8ef05193
      Nguyễn Thái Ngọc Duy 提交于
      Before d473e2e0 (diff.c: convert -U|--unified, 2019-01-27), -U and
      --unified are implemented with a custom parser opt_arg() in diff.c. I
      didn't check this code carefully and not realize that it's the
      equivalent of PARSE_OPT_NONEG | PARSE_OPT_OPTARG.
      
      In other words, if -U is specified without any argument, the option
      should be accepted, and the default value should be used. Without
      PARSE_OPT_OPTARG, parse_options() will reject this case and cause a
      regression.
      Reported-by: NBryan Turner <bturner@atlassian.com>
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8ef05193
    • N
      diff-parseopt: correct variable types that are used by parseopt · 7f125ff9
      Nguyễn Thái Ngọc Duy 提交于
      Most number-related OPT_ macros store the value in an 'int'
      variable. Many of the variables in 'struct diff_options' have a
      different type, but during the conversion to using parse_options() I
      failed to notice and correct.
      
      The problem was reported on s360x which is a big-endian
      architechture. The variable to store '-w' option in this case is
      xdl_opts, 'long' type, 8 bytes. But since parse_options() assumes
      'int' (4 bytes), it will store bits in the wrong part of xdl_opts. The
      problem was found on little-endian platforms because parse_options()
      will accidentally store at the right part of xdl_opts.
      
      There aren't much to say about the type change (except that 'int' for
      xdl_opts should still be big enough, since Windows' long is the same
      size as 'int' and nobody has complained so far). Some safety checks may
      be implemented in the future to prevent class of bugs.
      Reported-by: NTodd Zullinger <tmz@pobox.com>
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7f125ff9
  2. 28 1月, 2019 13 次提交
  3. 19 1月, 2019 24 次提交
    • N
    • J
      Third batch after 2.20 · 16a465bc
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      16a465bc
    • J
      Merge branch 'js/gc-repack-close-before-remove' · 5104f8f1
      Junio C Hamano 提交于
      "git gc" and "git repack" did not close the open packfiles that
      they found unneeded before removing them, which didn't work on a
      platform incapable of removing an open file.  This has been
      corrected.
      
      * js/gc-repack-close-before-remove:
        gc/repack: release packs when needed
      5104f8f1
    • J
      Merge branch 'en/show-ref-doc-fix' · eab7584e
      Junio C Hamano 提交于
      Doc update.
      
      * en/show-ref-doc-fix:
        git-show-ref.txt: fix order of flags
      eab7584e
    • J
      Merge branch 'ot/ref-filter-object-info' · 55574bd0
      Junio C Hamano 提交于
      The "--format=<placeholder>" option of for-each-ref, branch and tag
      learned to show a few more traits of objects that can be learned by
      the object_info API.
      
      * ot/ref-filter-object-info:
        ref-filter: give uintmax_t to format with %PRIuMAX
        ref-filter: add docs for new options
        ref-filter: add tests for deltabase
        ref-filter: add deltabase option
        ref-filter: add tests for objectsize:disk
        ref-filter: add check for negative file size
        ref-filter: add objectsize:disk option
      55574bd0
    • J
      Merge branch 'sg/stress-test' · 3fe47ff4
      Junio C Hamano 提交于
      Flaky tests can now be repeatedly run under load with the
      "--stress" option.
      
      * sg/stress-test:
        test-lib: add the '--stress' option to run a test repeatedly under load
        test-lib-functions: introduce the 'test_set_port' helper function
        test-lib: set $TRASH_DIRECTORY earlier
        test-lib: consolidate naming of test-results paths
        test-lib: parse command line options earlier
        test-lib: parse options in a for loop to keep $@ intact
        test-lib: extract Bash version check for '-x' tracing
        test-lib: translate SIGTERM and SIGHUP to an exit
      3fe47ff4
    • J
      Merge branch 'rs/sha1-file-close-mapped-file-on-error' · 2c0a645d
      Junio C Hamano 提交于
      Code clean-up.
      
      * rs/sha1-file-close-mapped-file-on-error:
        sha1-file: close fd of empty file in map_sha1_file_1()
      2c0a645d
    • J
      Merge branch 'rs/loose-object-cache-perffix' · eb8638ab
      Junio C Hamano 提交于
      The loose object cache used to optimize existence look-up has been
      updated.
      
      * rs/loose-object-cache-perffix:
        object-store: retire odb_load_loose_cache()
        object-store: use one oid_array per subdirectory for loose cache
        object-store: factor out odb_clear_loose_cache()
        object-store: factor out odb_loose_cache()
      eb8638ab
    • J
      Merge branch 'po/git-p4-wo-login' · 702bbfef
      Junio C Hamano 提交于
      "git p4" update.
      
      * po/git-p4-wo-login:
        git-p4: fix problem when p4 login is not necessary
      702bbfef
    • J
      Merge branch 'mm/multimail-1.5' · 41db1372
      Junio C Hamano 提交于
      Update "git multimail" from the upstream.
      
      * mm/multimail-1.5:
        git-multimail: update to release 1.5.0
      41db1372
    • J
      Merge branch 'tg/t5570-drop-racy-test' · 9462ac72
      Junio C Hamano 提交于
      An inherently racy test that caused intermittent failures has been
      removed.
      
      * tg/t5570-drop-racy-test:
        Revert "t/lib-git-daemon: record daemon log"
        t5570: drop racy test
      9462ac72
    • J
      Merge branch 'jk/dev-build-format-security' · 74ae0652
      Junio C Hamano 提交于
      Earlier we added "-Wformat-security" to developer builds, assuming
      that "-Wall" (which includes "-Wformat" which in turn is required
      to use "-Wformat-security") is always in effect.  This is not true
      when config.mak.autogen is in use, unfortunately.  This has been
      fixed by unconditionally adding "-Wall" to developer builds.
      
      * jk/dev-build-format-security:
        config.mak.dev: add -Wall, primarily for -Wformat, to help autoconf users
      74ae0652
    • J
      Merge branch 'so/cherry-pick-always-allow-m1' · 77fbd96a
      Junio C Hamano 提交于
      "git cherry-pick -m1" was forbidden when picking a non-merge
      commit, even though there _is_ parent number 1 for such a commit.
      This was done to avoid mistakes back when "cherry-pick" was about
      picking a single commit, but is no longer useful with "cherry-pick"
      that can pick a range of commits.  Now the "-m$num" option is
      allowed when picking any commit, as long as $num names an existing
      parent of the commit.
      
      Technically this is a backward incompatible change; hopefully
      nobody is relying on the error-checking behaviour.
      
      * so/cherry-pick-always-allow-m1:
        t3506: validate '-m 1 -ff' is now accepted for non-merge commits
        t3502: validate '-m 1' argument is now accepted for non-merge commits
        cherry-pick: do not error on non-merge commits when '-m 1' is specified
        t3510: stop using '-m 1' to force failure mid-sequence of cherry-picks
      77fbd96a
    • J
      Merge branch 'nd/worktree-remove-with-uninitialized-submodules' · 726f89c2
      Junio C Hamano 提交于
      "git worktree remove" and "git worktree move" refused to work when
      there is a submodule involved.  This has been loosened to ignore
      uninitialized submodules.
      
      * nd/worktree-remove-with-uninitialized-submodules:
        worktree: allow to (re)move worktrees with uninitialized submodules
      726f89c2
    • J
      Merge branch 'sg/test-bash-version-fix' · bb20dbbc
      Junio C Hamano 提交于
      The test suite tried to see if it is run under bash, but the check
      itself failed under some other implementations of shell (notably
      under NetBSD).  This has been corrected.
      
      * sg/test-bash-version-fix:
        test-lib: check Bash version for '-x' without using shell arrays
      bb20dbbc
    • J
      Merge branch 'rb/hpe' · 9f2eba2b
      Junio C Hamano 提交于
      Portability updates for the HPE NonStop platform.
      
      * rb/hpe:
        compat/regex/regcomp.c: define intptr_t and uintptr_t on NonStop
        git-compat-util.h: add FLOSS headers for HPE NonStop
        config.mak.uname: support for modern HPE NonStop config.
        transport-helper: drop read/write errno checks
        transport-helper: use xread instead of read
      9f2eba2b
    • J
      Merge branch 'ed/simplify-setup-git-dir' · e805dc18
      Junio C Hamano 提交于
      Code simplification.
      
      * ed/simplify-setup-git-dir:
        Simplify handling of setup_git_directory_gently() failure cases.
      e805dc18
    • J
      Merge branch 'cy/zsh-completion-SP-in-path' · b84e2977
      Junio C Hamano 提交于
      With zsh, "git cmd path<TAB>" was completed to "git cmd path name"
      when the completed path has a special character like SP in it,
      without any attempt to keep "path name" a single filename.  This
      has been fixed to complete it to "git cmd path\ name" just like
      Bash completion does.
      
      * cy/zsh-completion-SP-in-path:
        completion: treat results of git ls-tree as file paths
        zsh: complete unquoted paths with spaces correctly
      b84e2977
    • J
      Merge branch 'cy/completion-typofix' · c4338578
      Junio C Hamano 提交于
      Typofix.
      
      * cy/completion-typofix:
        completion: fix typo in git-completion.bash
      c4338578
    • J
      Merge branch 'ew/ban-strncat' · 81bf66b7
      Junio C Hamano 提交于
      The "strncat()" function is now among the banned functions.
      
      * ew/ban-strncat:
        banned.h: mark strncat() as banned
      81bf66b7
    • J
      Merge branch 'ds/commit-graph-assert-missing-parents' · d01a3faa
      Junio C Hamano 提交于
      Tightening error checking in commit-graph writer.
      
      * ds/commit-graph-assert-missing-parents:
        commit-graph: writing missing parents is a BUG
      d01a3faa
    • J
      Merge branch 'es/doc-worktree-guessremote-config' · 540ee40e
      Junio C Hamano 提交于
      Doc clarification.
      
      * es/doc-worktree-guessremote-config:
        doc/config: do a better job of introducing 'worktree.guessRemote'
      540ee40e
    • J
      Merge branch 'sb/submodule-unset-core-worktree-when-worktree-is-lost' · 39429209
      Junio C Hamano 提交于
      The core.worktree setting in a submodule repository should not be
      pointing at a directory when the submodule loses its working tree
      (e.g. getting deinit'ed), but the code did not properly maintain
      this invariant.
      
      * sb/submodule-unset-core-worktree-when-worktree-is-lost:
        submodule deinit: unset core.worktree
        submodule--helper: fix BUG message in ensure_core_worktree
        submodule: unset core.worktree if no working tree is present
        submodule update: add regression test with old style setups
      39429209
    • J
      Merge branch 'ma/asciidoctor' · 1ed943e9
      Junio C Hamano 提交于
      Some of the documentation pages formatted incorrectly with
      Asciidoctor, which have been fixed.
      
      * ma/asciidoctor:
        git-status.txt: render tables correctly under Asciidoctor
        Documentation: do not nest open blocks
        git-column.txt: fix section header
      1ed943e9