1. 22 6月, 2019 6 次提交
    • Æ
      tests: replace test_tristate with "git env--helper" · 3b072c57
      Ævar Arnfjörð Bjarmason 提交于
      The test_tristate helper introduced in 83d842dc ("tests: turn on
      network daemon tests by default", 2014-02-10) can now be better
      implemented with "git env--helper" to give the variables in question
      the standard boolean behavior.
      
      The reason for the "tristate" was to have all of false/true/auto,
      where "auto" meant either "false" or "true" depending on what the
      fallback was. With the --default option to "git env--helper" we can
      simply have e.g. GIT_TEST_HTTPD where we know if it's true because the
      user asked explicitly ("true"), or true implicitly ("auto").
      
      This breaks backwards compatibility for explicitly setting "auto" for
      these variables, but I don't think anyone cares. That was always
      intended to be internal.
      
      This means the test_normalize_bool() code in test-lib-functions.sh
      goes away in addition to test_tristate(). We still need the
      test_skip_or_die() helper, but now it takes the variable name instead
      of the value, and uses "git env--bool" to distinguish a default "true"
      from an explicit "true" (in those "explicit true" cases we want to
      fail the test in question).
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3b072c57
    • Æ
      tests README: re-flow a previously changed paragraph · 423b05e1
      Ævar Arnfjörð Bjarmason 提交于
      A previous change to the "GIT_TEST_GETTEXT_POISON" variable left this
      paragraph needing to be re-flowed. Let's do that in this separate
      change to make it easy to see that there's no change here when viewed
      with "--word-diff".
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      423b05e1
    • Æ
      tests: make GIT_TEST_GETTEXT_POISON a boolean · 1ff750b1
      Ævar Arnfjörð Bjarmason 提交于
      Change the GIT_TEST_GETTEXT_POISON variable from being "non-empty?" to
      being a more standard boolean variable.
      
      Since it needed to be checked in both C code and shellscript (via test
      -n) it was one of the remaining shellscript-like variables. Now that
      we have "env--helper" we can change that.
      
      There's a couple of tricky edge cases that arise because we're using
      git_env_bool() early, and the config-reading "env--helper".
      
      If GIT_TEST_GETTEXT_POISON is set to an invalid value die_bad_number()
      will die, but to do so it would usually call gettext(). Let's detect
      the special case of GIT_TEST_GETTEXT_POISON and always emit that
      message in the C locale, lest we infinitely loop.
      
      As seen in the updated tests in t0017-env-helper.sh there's also a
      caveat related to "env--helper" needing to read the config for trace2
      purposes.
      
      Since the C_LOCALE_OUTPUT prerequisite is lazy and relies on
      "env--helper" we could get invalid results if we failed to read the
      config (e.g. because we'd loop on includes) when combined with
      e.g. "test_i18ngrep" wanting to check with "env--helper" if
      GIT_TEST_GETTEXT_POISON was true or not.
      
      I'm crossing my fingers and hoping that a test similar to the one I
      removed in the earlier "config tests: simplify include cycle test"
      change in this series won't happen again, and testing for this
      explicitly in "env--helper"'s own tests.
      
      This change breaks existing uses of
      e.g. GIT_TEST_GETTEXT_POISON=YesPlease, which we've documented in
      po/README and other places. As noted in [1] we might want to consider
      also accepting "YesPlease" in "env--helper" as a special-case.
      
      But as the lack of uproar over 6cdccfce ("i18n: make GETTEXT_POISON
      a runtime option", 2018-11-08) demonstrates the audience for this
      option is a really narrow set of git developers, who shouldn't have
      much trouble modifying their test scripts, so I think it's better to
      deal with that minor headache now and make all the relevant GIT_TEST_*
      variables boolean in the same way than carry the "YesPlease"
      special-case forward.
      
      1. https://public-inbox.org/git/xmqqtvckm3h8.fsf@gitster-ct.c.googlers.com/Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1ff750b1
    • Æ
      t6040 test: stop using global "script" variable · e3d5e4bd
      Ævar Arnfjörð Bjarmason 提交于
      Change test code added in c0234b2e ("stat_tracking_info(): clear
      object flags used during counting", 2008-07-03) to stop using the
      "script" variable also used for lazy prerequisites in
      test-lib-functions.sh.
      
      Since this test uses test_i18ncmp and expects to use its own "script"
      variable twice it implicitly depends on the C_LOCALE_OUTPUT
      prerequisite not being a lazy prerequisite. A follow-up change will
      make it a lazy prerequisite, so we must remove this landmine before
      inadvertently stepping on it as we make that change.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e3d5e4bd
    • Æ
      config.c: refactor die_bad_number() to not call gettext() early · 2e43cd4c
      Ævar Arnfjörð Bjarmason 提交于
      Prepare die_bad_number() for a change to specially handle
      GIT_TEST_GETTEXT_POISON calling git_env_bool() by making
      die_bad_number() not call gettext() early, which would in turn call
      git_env_bool().
      
      There's no meaningful change here yet, just a re-arrangement of the
      current code to make that subsequent change easier to read.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2e43cd4c
    • Æ
      env--helper: new undocumented builtin wrapping git_env_*() · b4f207f3
      Ævar Arnfjörð Bjarmason 提交于
      We have many GIT_TEST_* variables that accept a <boolean> because
      they're implemented in C, and then some that take <non-empty?> because
      they're implemented at least partially in shellscript.
      
      Add a helper that wraps git_env_bool() and git_env_ulong() as the
      first step in fixing this. This isn't being added as a test-tool mode
      because some of these are used outside the test suite.
      
      Part of what this tool does can be done via a trick with "git config"
      added in 83d842dc ("tests: turn on network daemon tests by default",
      2014-02-10) for test_tristate(), i.e.:
      
          git -c magic.variable="$1" config --bool magic.variable 2>/dev/null
      
      But as subsequent changes will show being able to pass along the
      default value makes all the difference, and we'll be able to replace
      test_tristate() itself with that.
      
      The --type=bool option will be used by subsequent patches, but not
      --type=ulong. I figured it was easy enough to add it & test for it so
      I left it in so we'd have wrappers for both git_env_*() functions, and
      to have a template to make it obvious how we'd add --type=int etc. if
      it's needed in the future.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b4f207f3
  2. 21 6月, 2019 1 次提交
    • Æ
      config tests: simplify include cycle test · 84230835
      Ævar Arnfjörð Bjarmason 提交于
      Simplify an overly verbose test added in 9b25a0b5 ("config: add
      include directive", 2012-02-06). The "expect" file was never used, and
      by using .gitconfig it's not as intuitive to reproduce this manually
      with "-d" as some other tests, since HOME needs to be set in the
      environment.
      
      Also remove the use of test_i18ngrep added in a769bfc7 ("config.c:
      mark more strings for translation", 2018-07-21) in favor of overriding
      the GIT_TEST_GETTEXT_POISON value.
      
      Using the i18n test wrappers hasn't been needed since my
      6cdccfce ("i18n: make GETTEXT_POISON a runtime option", 2018-11-08).
      As a follow-up change to the yet-to-be-added t0017-env-helper.sh will
      show, doing it this way can hide a regression when combined with
      trace2's early config reading. That early config reading was added in
      bce9db6d ("trace2: use system/global config for default trace2
      settings", 2019-04-15).
      
      So let's remove the testing for that potential regression here, I'll
      instead add it explicitly to t0017-env-helper.sh in a follow-up
      change.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      84230835
  3. 18 6月, 2019 21 次提交
    • J
      The second batch · a6a95cd1
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a6a95cd1
    • J
      Merge branch 'xl/record-partial-clone-origin' · 14f49b20
      Junio C Hamano 提交于
      When creating a partial clone, the object filtering criteria is
      recorded for the origin of the clone, but this incorrectly used a
      hardcoded name "origin" to name that remote; it has been corrected
      to honor the "--origin <name>" option.
      
      * xl/record-partial-clone-origin:
        clone: respect user supplied origin name when setting up partial clone
      14f49b20
    • J
      Merge branch 'pb/request-pull-verify-remote-ref' · dedc0464
      Junio C Hamano 提交于
      "git request-pull" learned to warn when the ref we ask them to pull
      from in the local repository and in the published repository are
      different.
      
      * pb/request-pull-verify-remote-ref:
        request-pull: warn if the remote object is not the same as the local one
        request-pull: quote regex metacharacters in local ref
      dedc0464
    • J
      Merge branch 'mm/p4-unshelve-windows-fix' · add59c47
      Junio C Hamano 提交于
      The command line to invoke a "git cat-file" command from inside
      "git p4" was not properly quoted to protect a caret and running a
      broken command on Windows, which has been corrected.
      
      * mm/p4-unshelve-windows-fix:
        p4 unshelve: fix "Not a valid object name HEAD0" on Windows
      add59c47
    • J
      Merge branch 'po/git-help-on-git-itself' · d4fdeed0
      Junio C Hamano 提交于
      "git help git" was hard to discover (well, at least for some
      people).
      
      * po/git-help-on-git-itself:
        Doc: git.txt: remove backticks from link and add git-scm.com/docs
        git.c: show usage for accessing the git(1) help page
      d4fdeed0
    • J
      Merge branch 'es/first-contrib-tutorial' · 55b34f30
      Junio C Hamano 提交于
      A new tutorial targetting specifically aspiring git-core
      developers.
      
      * es/first-contrib-tutorial:
        doc: add some nit fixes to MyFirstContribution
        documentation: add anchors to MyFirstContribution
        documentation: add tutorial for first contribution
      55b34f30
    • J
      Merge branch 'bb/unicode-12.1-reiwa' · 3dc47c42
      Junio C Hamano 提交于
      Update to Unicode 12.1 width table.
      
      * bb/unicode-12.1-reiwa:
        unicode: update the width tables to Unicode 12.1
      3dc47c42
    • J
      Merge branch 'sw/git-p4-unshelve-branched-files' · e7ef93ba
      Junio C Hamano 提交于
      "git p4" update.
      
      * sw/git-p4-unshelve-branched-files:
        git-p4: allow unshelving of branched files
      e7ef93ba
    • J
      Merge branch 'js/fsmonitor-unflake' · a3e6b426
      Junio C Hamano 提交于
      The data collected by fsmonitor was not properly written back to
      the on-disk index file, breaking t7519 tests occasionally, which
      has been corrected.
      
      * js/fsmonitor-unflake:
        mark_fsmonitor_valid(): mark the index as changed if needed
        fill_stat_cache_info(): prepare for an fsmonitor fix
      a3e6b426
    • J
      Merge branch 'ds/topo-traversal-using-commit-graph' · bdc81d15
      Junio C Hamano 提交于
      Prepare use of reachability index in topological walker that works
      on a range (A..B).
      
      * ds/topo-traversal-using-commit-graph:
        revision: keep topo-walk free of unintersting commits
        revision: use generation for A..B --topo-order queries
      bdc81d15
    • J
      Merge branch 'bl/userdiff-octave' · 2f475317
      Junio C Hamano 提交于
      The pattern "git diff/grep" use to extract funcname and words
      boundary for Matlab has been extend to cover Octave, which is more
      or less equivalent.
      
      * bl/userdiff-octave:
        userdiff: fix grammar and style issues
        userdiff: add Octave
      2f475317
    • J
      Merge branch 'ba/clone-remote-submodules' · 94760948
      Junio C Hamano 提交于
      "git clone --recurse-submodules" learned to set up the submodules
      to ignore commit object names recorded in the superproject gitlink
      and instead use the commits that happen to be at the tip of the
      remote-tracking branches from the get-go, by passing the new
      "--remote-submodules" option.
      
      * ba/clone-remote-submodules:
        clone: add `--remote-submodules` flag
      94760948
    • J
      Merge branch 'vv/merge-squash-with-explicit-commit' · 6e0b1c60
      Junio C Hamano 提交于
      "git merge --squash" is designed to update the working tree and the
      index without creating the commit, and this cannot be countermanded
      by adding the "--commit" option; the command now refuses to work
      when both options are given.
      
      * vv/merge-squash-with-explicit-commit:
        merge: refuse --commit with --squash
      6e0b1c60
    • J
      Merge branch 'js/bundle-verify-require-object-store' · 3a54d80a
      Junio C Hamano 提交于
      "git bundle verify" needs to see if prerequisite objects exist in
      the receiving repository, but the command did not check if we are
      in a repository upfront, which has been corrected.
      
      * js/bundle-verify-require-object-store:
        bundle verify: error out if called without an object database
      3a54d80a
    • J
      Merge branch 'js/bisect-helper-check-get-oid-return-value' · 5b476dc2
      Junio C Hamano 提交于
      Code cleanup.
      
      * js/bisect-helper-check-get-oid-return-value:
        bisect--helper: verify HEAD could be parsed before continuing
      5b476dc2
    • J
      Merge branch 'jk/am-i-resolved-fix' · 9b3897ab
      Junio C Hamano 提交于
      "git am -i --resolved" segfaulted after trying to see a commit as
      if it were a tree, which has been corrected.
      
      * jk/am-i-resolved-fix:
        am: fix --interactive HEAD tree resolution
        am: drop tty requirement for --interactive
        am: read interactive input from stdin
        am: simplify prompt response handling
      9b3897ab
    • J
      Merge branch 'jk/HEAD-symref-in-xfer-namespaces' · 86d87307
      Junio C Hamano 提交于
      The server side support for "git fetch" used to show incorrect
      value for the HEAD symbolic ref when the namespace feature is in
      use, which has been corrected.
      
      * jk/HEAD-symref-in-xfer-namespaces:
        upload-pack: strip namespace from symref data
      86d87307
    • J
      Merge branch 'ew/server-info-remove-crufts' · 63b6b4b7
      Junio C Hamano 提交于
      "git update-server-info" used to leave stale packfiles in its
      output, which has been corrected.
      
      * ew/server-info-remove-crufts:
        server-info: do not list unlinked packs
      63b6b4b7
    • J
      Merge branch 'es/grep-require-name-when-needed' · ac97dc4f
      Junio C Hamano 提交于
      More parameter validation.
      
      * es/grep-require-name-when-needed:
        grep: fail if call could output and name is null
      ac97dc4f
    • J
      Merge branch 'es/git-debugger-doc' · 7df94cd1
      Junio C Hamano 提交于
      Doc update.
      
      * es/git-debugger-doc:
        doc: hint about GIT_DEBUGGER in CodingGuidelines
      7df94cd1
    • J
      Merge branch 'ds/object-info-for-prefetch-fix' · 5d5c46b2
      Junio C Hamano 提交于
      Code cleanup and futureproof.
      
      * ds/object-info-for-prefetch-fix:
        sha1-file: split OBJECT_INFO_FOR_PREFETCH
      5d5c46b2
  4. 14 6月, 2019 12 次提交
    • J
      The first batch after 2.22 · 0aae918d
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0aae918d
    • J
      Merge branch 'pw/rebase-edit-message-for-replayed-merge' · c5102611
      Junio C Hamano 提交于
      A "merge -c" instruction during "git rebase --rebase-merges" should
      give the user a chance to edit the log message, even when there is
      otherwise no need to create a new merge and replace the existing
      one (i.e. fast-forward instead), but did not.  Which has been
      corrected.
      
      * pw/rebase-edit-message-for-replayed-merge:
        rebase -r: always reword merge -c
      c5102611
    • J
      Merge branch 'ab/deprecate-R-for-dynpath' · 51d6c0f0
      Junio C Hamano 提交于
      The way of specifying the path to find dynamic libraries at runtime
      has been simplified.  The old default to pass -R/path/to/dir has been
      replaced with the new default to pass -Wl,-rpath,/path/to/dir,
      which is the more recent GCC uses.  Those who need to build with an
      old GCC can still use "CC_LD_DYNPATH=-R"
      
      * ab/deprecate-R-for-dynpath:
        Makefile: remove the NO_R_TO_GCC_LINKER flag
      51d6c0f0
    • J
      Merge branch 'mh/import-transport-fd-fix' · 2a983b22
      Junio C Hamano 提交于
      The ownership rule for the file descriptor to fast-import remote
      backend was mixed up, leading to unrelated file descriptor getting
      closed, which has been fixed.
      
      * mh/import-transport-fd-fix:
        Use xmmap_gently instead of xmmap in use_pack
        dup() the input fd for fast-import used for remote helpers
      2a983b22
    • J
      Merge branch 'ew/update-server-info' · 813a3a2a
      Junio C Hamano 提交于
      "git update-server-info" learned not to rewrite the file with the
      same contents.
      
      * ew/update-server-info:
        update-server-info: avoid needless overwrites
      813a3a2a
    • J
      Merge branch 'jk/help-unknown-ref-fix' · 8d32d255
      Junio C Hamano 提交于
      Improve the code to show args with potential typo that cannot be
      interpreted as a commit-ish.
      
      * jk/help-unknown-ref-fix:
        help_unknown_ref(): check for refname ambiguity
        help_unknown_ref(): duplicate collected refnames
      8d32d255
    • J
      Merge branch 'dl/format-patch-notes-config' · e91f65d0
      Junio C Hamano 提交于
      "git format-patch" learns a configuration to set the default for
      its --notes=<ref> option.
      
      * dl/format-patch-notes-config:
        format-patch: teach format.notes config option
        git-format-patch.txt: document --no-notes option
      e91f65d0
    • J
      Merge branch 'nd/merge-quit' · c4a38d16
      Junio C Hamano 提交于
      "git merge" learned "--quit" option that cleans up the in-progress
      merge while leaving the working tree and the index still in a mess.
      
      * nd/merge-quit:
        merge: add --quit
        merge: remove drop_save() in favor of remove_merge_branch_state()
      c4a38d16
    • J
      Merge branch 'ab/fail-prereqs-in-test' · 89d1b573
      Junio C Hamano 提交于
      Developer support to emulate unsatisfied prerequisites in tests to
      ensure that the remainer of the tests still succeeds when tests
      with prerequisites are skipped.
      
      * ab/fail-prereqs-in-test:
        tests: add a special setup where prerequisites fail
      89d1b573
    • J
      Merge branch 'nd/corrupt-worktrees' · 000bce0e
      Junio C Hamano 提交于
      "git worktree add" used to fail when another worktree connected to
      the same repository was corrupt, which has been corrected.
      
      * nd/corrupt-worktrees:
        worktree add: be tolerant of corrupt worktrees
      000bce0e
    • J
      Merge branch 'js/rebase-cleanup' · ed7f8acb
      Junio C Hamano 提交于
      Update supporting parts of "git rebase" to remove code that should
      no longer be used.
      
      * js/rebase-cleanup:
        rebase: fold git-rebase--common into the -p backend
        sequencer: the `am` and `rebase--interactive` scripts are gone
        .gitignore: there is no longer a built-in `git-rebase--interactive`
        t3400: stop referring to the scripted rebase
        Drop unused git-rebase--am.sh
      ed7f8acb
    • J
      Merge branch 'nd/worktree-name-sanitization' · 0d107b19
      Junio C Hamano 提交于
      In recent versions of Git, per-worktree refs are exposed in
      refs/worktrees/<wtname>/ hierarchy, which means that worktree names
      must be a valid refname component.  The code now sanitizes the names
      given to worktrees, to make sure these refs are well-formed.
      
      * nd/worktree-name-sanitization:
        worktree add: sanitize worktree names
      0d107b19