1. 29 8月, 2014 2 次提交
    • S
      convert: stream from fd to required clean filter to reduce used address space · 9035d75a
      Steffen Prohaska 提交于
      The data is streamed to the filter process anyway.  Better avoid mapping
      the file if possible.  This is especially useful if a clean filter
      reduces the size, for example if it computes a sha1 for binary data,
      like git media.  The file size that the previous implementation could
      handle was limited by the available address space; large files for
      example could not be handled with (32-bit) msysgit.  The new
      implementation can filter files of any size as long as the filter output
      is small enough.
      
      The new code path is only taken if the filter is required.  The filter
      consumes data directly from the fd.  If it fails, the original data is
      not immediately available.  The condition can easily be handled as
      a fatal error, which is expected for a required filter anyway.
      
      If the filter was not required, the condition would need to be handled
      in a different way, like seeking to 0 and reading the data.  But this
      would require more restructuring of the code and is probably not worth
      it.  The obvious approach of falling back to reading all data would not
      help achieving the main purpose of this patch, which is to handle large
      files with limited address space.  If reading all data is an option, we
      can simply take the old code path right away and mmap the entire file.
      
      The environment variable GIT_MMAP_LIMIT, which has been introduced in
      a previous commit is used to test that the expected code path is taken.
      A related test that exercises required filters is modified to verify
      that the data actually has been modified on its way from the file system
      to the object store.
      Signed-off-by: NSteffen Prohaska <prohaska@zib.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9035d75a
    • S
      memory_limit: use git_env_ulong() to parse GIT_ALLOC_LIMIT · 9927d962
      Steffen Prohaska 提交于
      GIT_ALLOC_LIMIT limits xmalloc()'s size, which is of type size_t.
      Better use git_env_ulong() to parse the environment variable, so
      that the postfixes 'k', 'm', and 'g' can be used; and use size_t to
      store the limit for consistency.  The change to size_t has no direct
      practical impact, because the environment variable is only meant to
      be used for our own tests, and we use it to test small sizes.
      
      The cast of size in the call to die() is changed to uintmax_t to
      match the format string PRIuMAX.
      Signed-off-by: NSteffen Prohaska <prohaska@zib.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9927d962
  2. 14 8月, 2014 1 次提交
    • J
      tests: fix negated test_i18ngrep calls · 41ca19b6
      Johannes Sixt 提交于
      The helper function test_i18ngrep pretends that it found the expected
      results when it is running under GETTEXT_POISON. For this reason, it must
      not be used negated like so
      
         ! test_i18ngrep foo bar
      
      because the test case would fail under GETTEXT_POISON. The function offers
      a special syntax to test that a pattern is *not* found:
      
         test_i18ngrep ! foo bar
      
      Convert incorrect uses to this syntax.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      41ca19b6
  3. 31 7月, 2014 1 次提交
  4. 29 7月, 2014 4 次提交
  5. 26 7月, 2014 1 次提交
  6. 22 7月, 2014 8 次提交
  7. 18 7月, 2014 2 次提交
  8. 17 7月, 2014 1 次提交
    • J
      rebase: omit patch-identical commits with --fork-point · 1e0dacdb
      John Keeping 提交于
      When the `--fork-point` argument was added to `git rebase`, we changed
      the value of $upstream to be the fork point instead of the point from
      which we want to rebase.  When $orig_head..$upstream is empty this does
      not change the behaviour, but when there are new changes in the upstream
      we are no longer checking if any of them are patch-identical with
      changes in $upstream..$orig_head.
      
      Fix this by introducing a new variable to hold the fork point and using
      this to restrict the range as an extra (negative) revision argument so
      that the set of desired revisions becomes (in fork-point mode):
      
      	git rev-list --cherry-pick --right-only \
      		$upstream...$orig_head ^$fork_point
      
      This allows us to correctly handle the scenario where we have the
      following topology:
      
      	    C --- D --- E  <- dev
      	   /
      	  B  <- master@{1}
      	 /
      	o --- B' --- C* --- D*  <- master
      
      where:
      - B' is a fixed-up version of B that is not patch-identical with B;
      - C* and D* are patch-identical to C and D respectively and conflict
        textually if applied in the wrong order;
      - E depends textually on D.
      
      The correct result of `git rebase master dev` is that B is identified as
      the fork-point of dev and master, so that C, D, E are the commits that
      need to be replayed onto master; but C and D are patch-identical with C*
      and D* and so can be dropped, so that the end result is:
      
      	o --- B' --- C* --- D* --- E  <- dev
      
      If the fork-point is not identified, then picking B onto a branch
      containing B' results in a conflict and if the patch-identical commits
      are not correctly identified then picking C onto a branch containing D
      (or equivalently D*) results in a conflict.
      
      This change allows us to handle both of these cases, where previously we
      either identified the fork-point (with `--fork-point`) but not the
      patch-identical commits *or* (with `--no-fork-point`) identified the
      patch-identical commits but not the fact that master had been rewritten.
      Reported-by: NTed Felix <ted@tedfelix.com>
      Signed-off-by: NJohn Keeping <john@keeping.me.uk>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1e0dacdb
  9. 16 7月, 2014 3 次提交
    • E
      sha1_file: do not add own object directory as alternate · 539e7506
      Ephrim Khong 提交于
      When adding alternate object directories, we try not to add the
      directory of the current repository to avoid cycles.  Unfortunately,
      that test was broken, since it compared an absolute with a relative
      path.
      Signed-off-by: NEphrim Khong <dr.khong@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      539e7506
    • J
      t5539: update a flaky test · f0e802ca
      Jeff King 提交于
      The test creates some unrelated commits in two separate repositories,
      and then fetches from one to the other. Since the commit creation
      happens in a subshell, the first commit in each ends up with the
      same test_tick value. When fetch-pack looks at the two root commits
      "unrelated1" and "new-too", the exact sequence of ACKs is different
      depending on which one it pulls out of the queue first.
      
      With the current code, it happens to be "unrelated1" (though this is not
      at all guaranteed by the prio_queue data structure, it is deterministic
      for this particular sequence of input). We see the ready-ACK, and the
      test succeeds.
      
      With the stable queue, we reliably get "new-too" out (since it is our
      local tip, it is added to the queue before we even talk to the remote).
      We never see a ready-ACK, and the test fails due to the grep on the
      TRACE_PACKET output at the end (the fetch itself succeeds as expected).
      
      I'm really not quite clear on what's supposed to be going on in the
      test. I can make it pass with this change.
      f0e802ca
    • P
      tests: do not pass iso8859-1 encoded parameter · e6ce2be2
      Pat Thoyts 提交于
      git commit -m with some iso8859-1 encoded stuff is doomed to fail in MinGW,
      because Windows don't let you pass encoded bytes to a process (CreateProcessW
      always takes a UTF-16LE encoded string).
      
      It is safe to pass the iso8859-1 message using a file or a pipe.
      
      Thanks-to: Karsten Blees <blees@dcon.de>
      Author: Stepan Kasal <kasal@ucw.cz>
      Signed-off-by: NStepan Kasal <kasal@ucw.cz>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e6ce2be2
  10. 15 7月, 2014 13 次提交
    • J
      revert: add t3513 for submodule updates · 1621c99c
      Jens Lehmann 提交于
      Test that the revert command updates the work tree as expected (for
      submodule changes which don't result in conflicts). Add a helper function
      to first revert the checked out target commit to make the last revert
      produce the to-be-tested work tree.
      
      Set the KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT and
      KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR switches to
      document that revert has the similar failures.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1621c99c
    • J
      stash: add t3906 for submodule updates · da7fe3fb
      Jens Lehmann 提交于
      Test that the stash apply command updates the work tree as expected for
      changes which don't result in conflicts. To make that work add a helper
      function that uses read-tree to apply the changes of the target commit
      to the work tree, then stashes these changes and at last applies that
      stash.
      
      Implement the KNOWN_FAILURE_STASH_DOES_IGNORE_SUBMODULE_CHANGES switch
      and reuse two other already present switches to expect the known
      failure that stash does ignore submodule changes.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      da7fe3fb
    • J
      am: add t4255 for submodule updates · 23e2f388
      Jens Lehmann 提交于
      Test that the am command updates the work tree as expected (for submodule
      changes which don't result in conflicts). To make that work add two
      helper functions that use format-patch to create the input for am.
      
      Add the KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES
      switch to expect the known failure that --no-ff merges attempt to merge
      the new files in the former submodule directory with those of the removed
      submodule.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      23e2f388
    • J
      cherry-pick: add t3512 for submodule updates · 283f56a4
      Jens Lehmann 提交于
      Test that the cherry-pick command updates the work tree as expected (for
      submodule changes which don't result in conflicts).
      
      Set KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES
      and KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR to
      document that cherry-pick has the same --no-ff known failures merge has.
      
      Implement the KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT switch to expect
      the known failure that while cherry picking just a SHA-1 update for an
      ignored submodule the commit incorrectly fails with "The previous
      cherry-pick is now empty, possibly due to conflict resolution.".
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      283f56a4
    • J
      pull: add t5572 for submodule updates · 921f50b4
      Jens Lehmann 提交于
      Test that the pull command updates the work tree as expected (for
      submodule changes which don't result in conflicts) when used without
      arguments or with the '--ff', '--ff-only' and '--no-ff' flag each. Add
      helper functions to reset the branch to be updated to to the current
      HEAD so that pull is doing the transition from HEAD to the given branch.
      
      Set KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES
      and KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR to
      document that pull has the same --no-ff known failures merge has.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      921f50b4
    • J
      rebase: add t3426 for submodule updates · c7e69168
      Jens Lehmann 提交于
      Test that the rebase command updates the work tree as expected for
      changes which don't result in conflicts. To make that work add two
      helper functions that add a commit only touching files and then
      revert it. This allows to rebase the target commit over these two
      and to compare the result.
      
      Set KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR to
      document that "replace directory with submodule" fails for an
      interactive rebase because a directory "sub1" already exists.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c7e69168
    • J
      merge: add t7613 for submodule updates · 663ed39a
      Jens Lehmann 提交于
      Test that the merge command updates the work tree as expected (for
      submodule changes which don't result in conflicts) when used without
      arguments or with the '--ff', '--ff-only' and '--no-ff' flag.
      
      Implement the KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR
      switch to expect the known failure that --no-ff merges do not create the
      empty submodule directory.
      
      The KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES
      switch is also implemented to expect the known failure that --no-ff
      merges attempt to merge the new files in the former submodule directory
      with those of the removed submodule.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      663ed39a
    • J
      bisect: add t6041 for submodule updates · 8f8ba56b
      Jens Lehmann 提交于
      Test that the bisect command updates the work tree as expected. To make
      that work with the new submodule test framework a git_bisect helper
      function is added. This adds a commit after the one given to be switched
      to and makes that one the bad commit. The starting point is then given to
      bisect as the good commit which makes bisect change the work tree to the
      commit in between, which is the commit given.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8f8ba56b
    • J
      reset: add t7112 for submodule updates · 8ef85694
      Jens Lehmann 提交于
      Test that the reset command updates the work tree as expected for changes
      with '--keep', '--merge' (for changes which don't result in conflicts) and
      '--hard'.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8ef85694
    • J
      read-tree: add t1013 for submodule updates · 48294e1d
      Jens Lehmann 提交于
      Test that the read-tree command updates the work tree as expected for
      changes which don't result in conflicts with the '-m' and '--reset' flag.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      48294e1d
    • J
      apply: add t4137 for submodule updates · 558643e1
      Jens Lehmann 提交于
      Test that the apply command updates the work tree as expected for the
      '--index' and the '--3way' options (for submodule changes which don't
      result in conflicts).
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      558643e1
    • J
      checkout: call the new submodule update test framework · d78ecca5
      Jens Lehmann 提交于
      Test that the checkout command updates the work tree as expected with
      and without the '-f' flag.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d78ecca5
    • J
      submodules: add the lib-submodule-update.sh test library · 42639d23
      Jens Lehmann 提交于
      Add this test library to simplify covering all combinations of submodule
      update scenarios without having to add those to a test of each work tree
      manipulating command over and over again.
      
      The functions test_submodule_switch() and test_submodule_forced_switch()
      are intended to be called from a test script with a single argument. This
      argument is either a work tree manipulating command (including any command
      line options) or a function (when more than a single git command is needed
      to switch work trees from the current HEAD to another commit). This
      command (or function) is passed a target branch as argument. The two new
      functions check that each submodule transition is handled as expected,
      which currently means that submodule work trees are not affected until
      "git submodule update" is called. The "forced" variant is for commands
      using their '-f' or '--hard' option and expects them to overwrite local
      modifications as a result. Each of these two functions contains 14
      tests_expect_* calls.
      
      Calling one of these test functions the first time creates a repository
      named "submodule_update_repo". At first it contains two files, then a
      single submodule is added in another commit followed by commits covering
      all relevant submodule modifications. This repository is newly cloned into
      the "submodule_update" for each test_expect_* to avoid interference
      between different parts of the test functions (some to-be-tested commands
      also manipulate refs along with the work tree, e.g. "git reset").
      
      Follow-up commits will then call these two test functions for all work
      tree manipulating commands (with a combination of all their options
      relevant to what they do with the work tree) making sure they work as
      expected. Later this test library will be extended to cover merges
      resulting in conflicts too. Also it is intended to be easily extendable
      for the recursive update functionality, where even more combinations of
      submodule modifications have to be tested for.
      
      This version documents two bugs in current Git with expected failures:
      
      *) When a submodule is replaced with a tracked file of the same name the
         submodule work tree including any local modifications (and even the
         whole history if it uses a .git directory instead of a gitfile!) is
         silently removed.
      
      *) Forced work tree updates happily manipulate files in the directory of a
         submodule that has just been removed in the superproject (but is of
         course still present in the work tree due to the way submodules are
         currently handled). This becomes dangerous when files in the submodule
         directory are overwritten by files from the new superproject commit, as
         any modifications to the submodule files will be lost) and is expected
         to also destroy history in the - admittedly unlikely case - the new
         commit adds a file named ".git" to the submodule directory.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      42639d23
  11. 14 7月, 2014 2 次提交
  12. 11 7月, 2014 2 次提交
    • J
      t/Makefile: always test all lint targets when running tests · 00f6991d
      Jens Lehmann 提交于
      Only the two targets "test-lint-duplicates" and "test-lint-executable" are
      currently executed when running the test target. This was done on purpose
      when the TEST_LINT variable was added in 81127d74 to avoid twisted shell
      scripting by developers only to avoid false positives that might result
      from the rather simple minded tests, e.g. test-lint-shell-syntax. But it
      looks like it might be better to include all lint tests to help developers
      to detect non portable shell constructs before the patch is sent to the
      list and reviewed there.
      
      Change the TEST_LINT variable to run all lint test unless the TEST_LINT
      variable is overridden. If we hit false positives more often than helping
      developers to avoid non-portable code (or add less accurate or slow tests
      later) we could still fall back to exclude them like 81127d74 proposed.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      00f6991d
    • J
      t/Makefile: check helper scripts for non-portable shell commands too · cd78cea2
      Jens Lehmann 提交于
      Currently only the "t[0-9][0-9][0-9][0-9]-*.sh" scripts are tested for
      shell incompatibilities using the check-non-portable-shell.pl script. This
      makes it easy to miss non-POSIX constructs added to one of the t/*lib*.sh
      helper scripts, as they aren't automatically detected.
      
      Fix that by adding a THELPERS variable containing all shell scripts that
      aren't tests and add these to the "test-lint-shell-syntax" target too.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cd78cea2