1. 06 9月, 2018 3 次提交
  2. 04 9月, 2018 2 次提交
  3. 29 8月, 2018 1 次提交
  4. 28 8月, 2018 23 次提交
  5. 24 8月, 2018 3 次提交
    • J
      i18n: fix mistakes in translated strings · 27c929ed
      Jean-Noël Avila 提交于
      Fix typos and convert a question which does not expect to be replied
      to a simple advice.
      Signed-off-by: NJean-Noël Avila <jn.avila@free.fr>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      27c929ed
    • D
      config: fix commit-graph related config docs · d915114a
      Derrick Stolee 提交于
      The core.commitGraph config setting was accidentally removed from
      the config documentation. In that same patch, the config setting
      that writes a commit-graph during garbage collection was incorrectly
      written to the doc as "gc.commitGraph" instead of "gc.writeCommitGraph".
      Reported-by: NSzeder Gábor <szeder.dev@gmail.com>
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d915114a
    • S
      t/lib-rebase.sh: support explicit 'pick' commands in 'fake_editor.sh' · 7afb0d67
      SZEDER Gábor 提交于
      The verbose output of the test 'reword without issues functions as
      intended' in 't3423-rebase-reword.sh', added in a9279c67 (sequencer:
      do not squash 'reword' commits when we hit conflicts, 2018-06-19),
      contains the following error output:
      
        sed: -e expression #1, char 2: extra characters after command
      
      This error comes from within the 'fake-editor.sh' script created by
      'lib-rebase.sh's set_fake_editor() function, and the root cause is the
      FAKE_LINES="pick 1 reword 2" variable in the test in question, in
      particular the "pick" word.  'fake-editor.sh' assumes 'pick' to be the
      default rebase command and doesn't support an explicit 'pick' command
      in FAKE_LINES.  As a result, 'pick' will be used instead of a line
      number when assembling the following 'sed' script:
      
        sed -n picks/^pick/pick/p
      
      which triggers the aforementioned error.
      
      Luckily, this didn't affect the test's correctness: the erroring 'sed'
      command doesn't write anything to the todo script, and processing the
      rest of FAKE_LINES generates the desired todo script, as if that
      'pick' command were not there at all.
      
      The minimal fix would be to remove the 'pick' word from FAKE_LINES,
      but that would leave us susceptible to similar issues in the future.
      
      Instead, teach the fake-editor script to recognize an explicit 'pick'
      command, which is still a fairly trivial change.
      
      In the future we might want to consider reinforcing this fake editor
      script with an &&-chain and stricter parsing of the FAKE_LINES
      variable (e.g. to error out when encountering unknown rebase commands
      or commands and line numbers in the wrong order).
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7afb0d67
  6. 23 8月, 2018 7 次提交
    • J
      hashcmp: assert constant hash size · 183a638b
      Jeff King 提交于
      Prior to 509f6f62 (cache: update object ID functions for
      the_hash_algo, 2018-07-16), hashcmp() called memcmp() with a
      constant size of 20 bytes. Some compilers were able to turn
      that into a few quad-word comparisons, which is faster than
      actually calling memcmp().
      
      In 509f6f62, we started using the_hash_algo->rawsz
      instead. Even though this will always be 20, the compiler
      doesn't know that while inlining hashcmp() and ends up just
      generating a call to memcmp().
      
      Eventually we'll have to deal with multiple hash sizes, but
      for the upcoming v2.19, we can restore some of the original
      performance by asserting on the size. That gives the
      compiler enough information to know that the memcmp will
      always be called with a length of 20, and it performs the
      same optimization.
      
      Here are numbers for p0001.2 run against linux.git on a few
      versions. This is using -O2 with gcc 8.2.0.
      
        Test     v2.18.0             v2.19.0-rc0               HEAD
        ------------------------------------------------------------------------------
        0001.2:  34.24(33.81+0.43)   34.83(34.42+0.40) +1.7%   33.90(33.47+0.42) -1.0%
      
      You can see that v2.19 is a little slower than v2.18. This
      commit ended up slightly faster than v2.18, but there's a
      fair bit of run-to-run noise (the generated code in the two
      cases is basically the same). This patch does seem to be
      consistently 1-2% faster than v2.19.
      
      I tried changing hashcpy(), which was also touched by
      509f6f62, in the same way, but couldn't measure any
      speedup. Which makes sense, at least for this workload. A
      traversal of the whole commit graph requires looking up
      every entry of every tree via lookup_object(). That's many
      multiples of the numbers of objects in the repository (most
      of the lookups just return "yes, we already saw that
      object").
      
      [jn: verified using "make object.s" that the memcmp call goes away.]
      Reported-by: NDerrick Stolee <stolee@gmail.com>
      Signed-off-by: Jeff King <peff@peff.net
      Reviewed-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      183a638b
    • S
      t3420-rebase-autostash: don't try to grep non-existing files · 27458170
      SZEDER Gábor 提交于
      Several tests in 't3420-rebase-autostash.sh' start various rebase
      processes that are expected to fail because of merge conflicts.  These
      tests then run '! grep' to ensure that the autostash feature did its
      job, and the dirty contents of a file is gone.  However, due to the
      test repo's history and the choice of upstream branch that file
      shouldn't exist in the conflicted state at all.  Consequently, this
      'grep' doesn't fail as expected, because it can't find the dirty
      content, but it fails because it can't open the file.
      
      Tighten this check by using 'test_path_is_missing' instead, thereby
      avoiding unexpected errors from 'grep' as well.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      27458170
    • S
      t3903-stash: don't try to grep non-existing file · 79b04f9b
      SZEDER Gábor 提交于
      The test 'store updates stash ref and reflog' in 't3903-stash.sh'
      creates a stash from a new file, runs 'git reset --hard' to throw away
      any modifications to the work tree, and then runs '! grep' to ensure
      that the staged contents are gone.  Since the file didn't exist
      before, it shouldn't exist after 'git reset' either.  Consequently,
      this 'grep' doesn't fail as expected, because it can't find the staged
      content, but it fails because it can't open the file.
      
      Tighten this check by using 'test_path_is_missing' instead, thereby
      avoiding an unexpected error from 'grep' as well.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      79b04f9b
    • J
      Merge branch 'nd/pack-deltify-regression-fix' · 29d9e3e2
      Junio C Hamano 提交于
      In a recent update in 2.18 era, "git pack-objects" started
      producing a larger than necessary packfiles by missing
      opportunities to use large deltas.
      
      * nd/pack-deltify-regression-fix:
        pack-objects: fix performance issues on packing large deltas
      29d9e3e2
    • S
      t6018-rev-list-glob: fix 'empty stdin' test · b89b4a66
      SZEDER Gábor 提交于
      Prior to d3c6751b (tests: make use of the test_must_be_empty
      function, 2018-07-27), in the test 'rev-list should succeed with empty
      output on empty stdin' in 't6018-rev-list-glob' the empty 'expect'
      file served dual purpose: besides specifying the expected output, as
      usual, it also served as empty input for 'git rev-list --stdin'.
      
      Then d3c6751b came along, and, as part of the conversion to
      'test_must_be_empty', removed this empty 'expect' file, not realizing
      its secondary purpose.  Redirecting stdin from the now non-existing
      file failed the test, but since this test expects failure in the first
      place, this issue went unnoticed.
      
      Redirect 'git rev-list's stdin explicitly from /dev/null to provide
      empty input.  (Strictly speaking we don't need this redirection,
      because the test script's stdin is already redirected from /dev/null
      anyway, but I think it's better to be explicit about it.)
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b89b4a66
    • S
      t4051-diff-function-context: read the right file · c8b35b95
      SZEDER Gábor 提交于
      The test ' context does not include preceding empty lines' in the
      block of tests 'change with long common tail and no context' in
      't4051-diff-function-context.sh' tries to read the file
      'long_common_tail.diff.diff', but that file doesn't exist as its name
      contains one more '.diff' suffixes than necessary.
      
      Despite this error the test still succeeded without checking what it's
      supposed to, because this erroneous read is done on the line:
      
        test "$(first_context_line <long_common_tail.diff.diff)" != " "
      
      which means that:
      
        - the command substitution hides the error, so it won't fail the
          test, and
      
        - the result of the command substitution is the empty string, which
          is, of course, not equal to a single space character, so the
          condition is fulfilled, and the test succeeds.
      
      As a minimal fix, fix the name of the file to be read.
      
      In the future we might want to reorganize this test script (1) to use
      'test_cmp' instead of 'test's and command substitutions to catch
      failing commands and to provide helpful error messages, and (2) to
      specify what the expected result actually _is_ instead of what it
      isn't.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c8b35b95
    • S
      t0020-crlf: check the right file · 30612cb6
      SZEDER Gábor 提交于
      In the test 'checkout with autocrlf=input' in 't0020-crlf.sh', one of
      the 'has_cr' checks looks at the non-existing file 'two' instead of
      'dir/two'.  The test still succeeds, without actually checking what it
      was supposed to, because this check is expected to fail anyway.
      
      As a minimal fix, fix the name of the file to be checked.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      30612cb6
  7. 22 8月, 2018 1 次提交
    • S
      t7501-commit: drop silly command substitution · 15da7537
      SZEDER Gábor 提交于
      The test '--dry-run with conflicts fixed from a merge' in
      't7501-commit.sh', added in 8dc874b2 (wt-status.c: set commitable
      bit if there is a meaningful merge., 2016-02-15), runs the following
      unnecessary and downright bogus command substitution:
      
        ! $(git merge --no-commit commit-1) &&
      
      I.e. after 'git merge ...' is executed and expectedly fails, the test
      attempts to execute its output:
      
        Merging:
        80f2ea2 commit 2
        virtual commit-1
        found 1 common ancestor:
        e60d113 Initial commit
        Auto-merging test-file
        CONFLICT (content): Merge conflict in test-file
        Automatic merge failed; fix conflicts and then commit the result.
      
      as a command, which most likely fails, because there is no such
      command as "Merging:".  Then '!' negates the failed exit status, the
      test continues, and eventually succeeds.
      
      Remove this command substitution and use 'test_must_fail' to ensure
      that 'git merge' fails.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      15da7537