1. 06 2月, 2016 23 次提交
    • J
      Merge branch 'jk/ref-cache-non-repository-optim' into maint · e2d77390
      Junio C Hamano 提交于
      The underlying machinery used by "ls-files -o" and other commands
      have been taught not to create empty submodule ref cache for a
      directory that is not a submodule.  This removes a ton of wasted
      CPU cycles.
      
      * jk/ref-cache-non-repository-optim:
        resolve_gitlink_ref: ignore non-repository paths
        clean: make is_git_repository a public function
      e2d77390
    • J
      Merge branch 'js/dirname-basename' into maint · 07be1da2
      Junio C Hamano 提交于
      dirname() emulation has been added, as Msys2 lacks it.
      
      * js/dirname-basename:
        mingw: avoid linking to the C library's isalpha()
        t0060: loosen overly strict expectations
        t0060: verify that basename() and dirname() work as expected
        compat/basename.c: provide a dirname() compatibility function
        compat/basename: make basename() conform to POSIX
        Refactor skipping DOS drive prefixes
      07be1da2
    • J
      Merge branch 'tb/complete-word-diff-regex' into maint · 081363dd
      Junio C Hamano 提交于
      * tb/complete-word-diff-regex:
        completion: complete "diff --word-diff-regex="
      081363dd
    • J
      Merge branch 'pw/completion-stash' into maint · 0a8748d8
      Junio C Hamano 提交于
      * pw/completion-stash:
        completion: update completion arguments for stash
      0a8748d8
    • J
      Merge branch 'pw/completion-show-branch' into maint · 39abb2ed
      Junio C Hamano 提交于
      * pw/completion-show-branch:
        completion: complete show-branch "--date-order"
      39abb2ed
    • J
      Merge branch 'jk/completion-rebase' into maint · d509fa44
      Junio C Hamano 提交于
      * jk/completion-rebase:
        completion: add missing git-rebase options
      d509fa44
    • J
      Merge branch 'nd/diff-with-path-params' into maint · 02dab5d3
      Junio C Hamano 提交于
      A few options of "git diff" did not work well when the command was
      run from a subdirectory.
      
      * nd/diff-with-path-params:
        diff: make -O and --output work in subdirectory
        diff-no-index: do not take a redundant prefix argument
      02dab5d3
    • J
      Merge branch 'dw/subtree-split-do-not-drop-merge' into maint · 6a65bdcc
      Junio C Hamano 提交于
      The "split" subcommand of "git subtree" (in contrib/) incorrectly
      skipped merges when it shouldn't, which was corrected.
      
      * dw/subtree-split-do-not-drop-merge:
        contrib/subtree: fix "subtree split" skipped-merge bug
      6a65bdcc
    • J
      Merge branch 'ew/svn-1.9.0-auth' into maint · 0244713d
      Junio C Hamano 提交于
      * ew/svn-1.9.0-auth:
        git-svn: fix auth parameter handling on SVN 1.9.0+
      0244713d
    • J
      Merge branch 'jk/list-tag-2.7-regression' into maint · 88ec75db
      Junio C Hamano 提交于
      "git tag" started listing a tag "foo" as "tags/foo" when a branch
      named "foo" exists in the same repository; remove this unnecessary
      disambiguation, which is a regression introduced in v2.7.0.
      
      * jk/list-tag-2.7-regression:
        tag: do not show ambiguous tag names as "tags/foo"
        t6300: use test_atom for some un-modern tests
      88ec75db
    • J
      Merge branch 'jk/sanity' into maint · 913c2c7c
      Junio C Hamano 提交于
      The description for SANITY prerequisite the test suite uses has
      been clarified both in the comment and in the implementation.
      
      * jk/sanity:
        test-lib: clarify and tighten SANITY
      913c2c7c
    • J
      Merge branch 'jk/filter-branch-no-index' into maint · 16f5e268
      Junio C Hamano 提交于
      A recent optimization to filter-branch in v2.7.0 introduced a
      regression when --prune-empty filter is used, which has been
      corrected.
      
      * jk/filter-branch-no-index:
        filter-branch: resolve $commit^{tree} in no-index case
      16f5e268
    • J
      Merge branch 'js/close-packs-before-gc' into maint · f748e691
      Junio C Hamano 提交于
      Many codepaths that run "gc --auto" before exiting kept packfiles
      mapped and left the file descriptors to them open, which was not
      friendly to systems that cannot remove files that are open.  They
      now close the packs before doing so.
      
      * js/close-packs-before-gc:
        receive-pack: release pack files before garbage-collecting
        merge: release pack files before garbage-collecting
        am: release pack files before garbage-collecting
        fetch: release pack files before garbage-collecting
      f748e691
    • J
      Merge branch 'jk/ok-to-fail-gc-auto-in-rebase' into maint · b11a3bad
      Junio C Hamano 提交于
      "git rebase", unlike all other callers of "gc --auto", did not
      ignore the exit code from "gc --auto".
      
      * jk/ok-to-fail-gc-auto-in-rebase:
        rebase: ignore failures from "gc --auto"
      b11a3bad
    • J
      Merge branch 'ho/gitweb-squelch-undef-warning' into maint · 15f40964
      Junio C Hamano 提交于
      Asking gitweb for a nonexistent commit left a warning in the server
      log.
      
      Somebody may want to follow this up with a new test, perhaps?
      IIRC, we do test that no Perl warnings are given to the server log,
      so this should have been caught if our test coverage were good.
      
      * ho/gitweb-squelch-undef-warning:
        gitweb: squelch "uninitialized value" warning
      15f40964
    • J
      Merge branch 'js/fopen-harder' into maint · da07df3e
      Junio C Hamano 提交于
      Some codepaths used fopen(3) when opening a fixed path in $GIT_DIR
      (e.g. COMMIT_EDITMSG) that is meant to be left after the command is
      done.  This however did not work well if the repository is set to
      be shared with core.sharedRepository and the umask of the previous
      user is tighter.  They have been made to work better by calling
      unlink(2) and retrying after fopen(3) fails with EPERM.
      
      * js/fopen-harder:
        Handle more file writes correctly in shared repos
        commit: allow editing the commit message even in shared repos
      da07df3e
    • J
      Merge branch 'nd/exclusion-regression-fix' into maint · 9496acc1
      Junio C Hamano 提交于
      The ignore mechanism saw a few regressions around untracked file
      listing and sparse checkout selection areas in 2.7.0; the change
      that is responsible for the regression has been reverted.
      
      * nd/exclusion-regression-fix:
        Revert "dir.c: don't exclude whole dir prematurely if neg pattern may match"
      9496acc1
    • J
      Merge branch 'dk/reflog-walk-with-non-commit' into maint · 90b99869
      Junio C Hamano 提交于
      "git reflog" incorrectly assumed that all objects that used to be
      at the tip of a ref must be commits, which caused it to segfault.
      
      * dk/reflog-walk-with-non-commit:
        reflog-walk: don't segfault on non-commit sha1's in the reflog
      90b99869
    • J
      Merge branch 'dw/signoff-doc' into maint · 7aae9ba6
      Junio C Hamano 提交于
      The documentation has been updated to hint the connection between
      the '--signoff' option and DCO.
      
      * dw/signoff-doc:
        Expand documentation describing --signoff
      7aae9ba6
    • J
      Merge branch 'jk/clang-pedantic' into maint · 6e29ac23
      Junio C Hamano 提交于
      A few unportable C construct have been spotted by clang compiler
      and have been fixed.
      
      * jk/clang-pedantic:
        bswap: add NO_UNALIGNED_LOADS define
        avoid shifting signed integers 31 bits
      6e29ac23
    • J
      Merge branch 'ew/send-email-mutt-alias-fix' into maint · 25b1166a
      Junio C Hamano 提交于
      "git send-email" was confused by escaped quotes stored in the alias
      files saved by "mutt", which has been corrected.
      
      * ew/send-email-mutt-alias-fix:
        git-send-email: do not double-escape quotes from mutt
      25b1166a
    • J
      Merge branch 'nd/dir-exclude-cleanup' into maint · af3e464a
      Junio C Hamano 提交于
      The "exclude_list" structure has the usual "alloc, nr" pair of
      fields to be used by ALLOC_GROW(), but clear_exclude_list() forgot
      to reset 'alloc' to 0 when it cleared 'nr' to discard the managed
      array.
      
      * nd/dir-exclude-cleanup:
        dir.c: clean the entire struct in clear_exclude_list()
      af3e464a
    • J
      Merge branch 'nd/stop-setenv-work-tree' into maint · d6998341
      Junio C Hamano 提交于
      An earlier change in 2.5.x-era broke users' hooks and aliases by
      exporting GIT_WORK_TREE to point at the root of the working tree,
      interfering when they tried to use a different working tree without
      setting GIT_WORK_TREE environment themselves.
      
      * nd/stop-setenv-work-tree:
        Revert "setup: set env $GIT_WORK_TREE when work tree is set, like $GIT_DIR"
      d6998341
  2. 27 1月, 2016 3 次提交
    • E
      git-svn: fix auth parameter handling on SVN 1.9.0+ · 0b664155
      Eric Wong 提交于
      For users with "store-passwords = no" set in the "[auth]" section of
      their ~/.subversion/config, SVN 1.9.0+ would fail with the
      following message when attempting to call svn_auth_set_parameter:
      
        Value is not a string (or undef) at Git/SVN/Ra.pm
      
      Ironically, this breakage was caused by r1553823 in subversion:
      
        "Make svn_auth_set_parameter() usable from Perl bindings."
      
      Since 2007 (602015e0), git-svn has used a workaround to make
      svn_auth_set_parameter usable internally.  However this workaround
      breaks under SVN 1.9+, which deals properly with the type mapping
      and fails to recognize our workaround.
      
      For pre-1.9.0 SVN, we continue to use the existing workaround for
      the lack of proper type mapping in the bindings.
      
      Tested under subversion 1.6.17 and 1.9.3.
      
      I've also verified r1553823 was not backported to SVN 1.8.x:
      
        BRANCH=http://svn.apache.org/repos/asf/subversion/branches/1.8.x
        svn log -v $BRANCH/subversion/bindings/swig/core.i
      
      ref: https://bugs.debian.org/797705
      Cc: 797705@bugs.debian.org
      Reported-by: NThierry Vignaud <thierry.vignaud@gmail.com>
      Signed-off-by: NEric Wong <normalperson@yhbt.net>
      Tested-by: NThierry Vignaud <thierry.vignaud@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0b664155
    • J
      tag: do not show ambiguous tag names as "tags/foo" · 0571979b
      Jeff King 提交于
      Since b7cc53e9 (tag.c: use 'ref-filter' APIs, 2015-07-11),
      git-tag has started showing tags with ambiguous names (i.e.,
      when both "heads/foo" and "tags/foo" exists) as "tags/foo"
      instead of just "foo". This is both:
      
        - pointless; the output of "git tag" includes only
          refs/tags, so we know that "foo" means the one in
          "refs/tags".
      
      and
      
        - ambiguous; in the original output, we know that the line
          "foo" means that "refs/tags/foo" exists. In the new
          output, it is unclear whether we mean "refs/tags/foo" or
          "refs/tags/tags/foo".
      
      The reason this happens is that commit b7cc53e9 switched
      git-tag to use ref-filter's "%(refname:short)" output
      formatting, which was adapted from for-each-ref. This more
      general code does not know that we care only about tags, and
      uses shorten_unambiguous_ref to get the short-name. We need
      to tell it that we care only about "refs/tags/", and it
      should shorten with respect to that value.
      
      In theory, the ref-filter code could figure this out by us
      passing FILTER_REFS_TAGS. But there are two complications
      there:
      
        1. The handling of refname:short is deep in formatting
           code that does not even have our ref_filter struct, let
           alone the arguments to the filter_ref struct.
      
        2. In git v2.7.0, we expose the formatting language to the
           user. If we follow this path, it will mean that
           "%(refname:short)" behaves differently for "tag" versus
           "for-each-ref" (including "for-each-ref refs/tags/"),
           which can lead to confusion.
      
      Instead, let's add a new modifier to the formatting
      language, "strip", to remove a specific set of prefix
      components. This fixes "git tag", and lets users invoke the
      same behavior from their own custom formats (for "tag" or
      "for-each-ref") while leaving ":short" with its same
      consistent meaning in all places.
      
      We introduce a test in t7004 for "git tag", which fails
      without this patch. We also add a similar test in t3203 for
      "git branch", which does not actually fail. But since it is
      likely that "branch" will eventually use the same formatting
      code, the test helps defend against future regressions.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0571979b
    • P
      completion: update completion arguments for stash · d7d4ca87
      Paul Wagland 提交于
      Add --all and --include-untracked to the git stash save completions.
      Add --quiet to the git stash drop completions.
      Update git stash branch so that the first argument expands out to the
      possible branch names, and the other arguments expand to the stash
      names.
      Signed-off-by: NPaul Wagland <paul@kungfoocoder.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d7d4ca87
  3. 26 1月, 2016 6 次提交
    • P
      f7c2e1a0
    • J
      completion: add missing git-rebase options · fa4b5e3a
      John Keeping 提交于
      This adds the --no-* variants where those are documented in
      git-rebase(1).
      Signed-off-by: NJohn Keeping <john@keeping.me.uk>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fa4b5e3a
    • J
      mingw: avoid linking to the C library's isalpha() · e7d5ce81
      Johannes Sixt 提交于
      The implementation of mingw_skip_dos_drive_prefix() calls isalpha() via
      has_dos_drive_prefix(). Since the definition occurs long before isalpha()
      is defined in git-compat-util.h, my build environment reports:
      
          CC alloc.o
      In file included from git-compat-util.h:186,
                       from cache.h:4,
                       from alloc.c:12:
      compat/mingw.h: In function 'mingw_skip_dos_drive_prefix':
      compat/mingw.h:365: warning: implicit declaration of function 'isalpha'
      
      Dscho does not see a similar warning in his build and suspects that
      ctype.h is included somehow behind the scenes. This implies that his build
      links to the C library's isalpha() and does not use git's isalpha().
      
      To fix both the warning in my build and the inconsistency in Dscho's
      build, move the function definition to mingw.c. Then it picks up git's
      isalpha() because git-compat-util.h is included at the top of the file.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e7d5ce81
    • J
      t6300: use test_atom for some un-modern tests · 1d094db9
      Jeff King 提交于
      Because this script has to test so many formatters, we have
      the nice "test_atom" helper, but we don't use it
      consistently. Let's do so. This is shorter, gets rid of some
      tests that have their "expected" setup outside of a
      test_expect_success block, and lets us organize the changes
      better (e.g., putting "refname:short" near "refname").
      
      We also expand the "%(push)" tests a little to match the
      "%(upstream)" ones.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1d094db9
    • J
      resolve_gitlink_ref: ignore non-repository paths · a2d5156c
      Jeff King 提交于
      When we want to look up a submodule ref, we use
      get_ref_cache(path) to find or auto-create its ref cache.
      But if we feed a path that isn't actually a git repository,
      we blindly create the ref cache, and then may die deeper in
      the code when we try to access it. This is a problem because
      many callers speculatively feed us a path that looks vaguely
      like a repository, and expect us to tell them when it is
      not.
      
      This patch teaches resolve_gitlink_ref to reject
      non-repository paths without creating a ref_cache. This
      avoids the die(), and also performs better if you have a
      large number of these faux-submodule directories (because
      the ref_cache lookup is linear, under the assumption that
      there won't be a large number of submodules).
      
      To accomplish this, we also break get_ref_cache into two
      pieces: the lookup and auto-creation (the latter is lumped
      into create_ref_cache). This lets us first cheaply ask our
      cache "is it a submodule we know about?" If so, we can avoid
      repeating our filesystem lookup. So lookups of real
      submodules are not penalized; they examine the submodule's
      .git directory only once.
      
      The test in t3000 demonstrates a case where this improves
      correctness (we used to just die). The new perf case in
      p7300 shows off the speed improvement in an admittedly
      pathological repository:
      
      Test                  HEAD^               HEAD
      ----------------------------------------------------------------
      7300.4: ls-files -o   66.97(66.15+0.87)   0.33(0.08+0.24) -99.5%
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a2d5156c
    • J
      clean: make is_git_repository a public function · ffd036b1
      Jeff King 提交于
      We have always had is_git_directory(), for looking at a
      specific directory to see if it contains a git repo. In
      0179ca7a (clean: improve performance when removing lots of
      directories, 2015-06-15), we added is_git_repository() which
      checks for a non-bare repository by looking at its ".git"
      entry.
      
      However, the fix in 0179ca7a needs to be applied other
      places, too. Let's make this new helper globally available.
      We need to give it a better name, though, to avoid confusion
      with is_git_directory(). This patch does that, documents
      both functions with a comment to reduce confusion, and
      removes the clean-specific references in the comments.
      Based-on-a-patch-by: NAndreas Krey <a.krey@gmx.de>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ffd036b1
  4. 22 1月, 2016 2 次提交
  5. 21 1月, 2016 2 次提交
  6. 20 1月, 2016 2 次提交
    • J
      filter-branch: resolve $commit^{tree} in no-index case · 1dc413eb
      Jeff King 提交于
      Commit 348d4f2f (filter-branch: skip index read/write when
      possible, 2015-11-06) taught filter-branch to optimize out
      the final "git write-tree" when we know we haven't touched
      the tree with any of our filters. It does by simply putting
      the literal text "$commit^{tree}" into the "$tree" variable,
      avoiding a useless rev-parse call.
      
      However, when we pass this to git_commit_non_empty_tree(),
      it gets confused; it resolves "$commit^{tree}" itself, and
      compares our string to the 40-hex sha1, which obviously
      doesn't match. As a result, "--prune-empty" (or any custom
      filter using git_commit_non_empty_tree) will fail to drop
      an empty commit (when filter-branch is used without a tree
      or index filter).
      
      Let's resolve $tree to the 40-hex ourselves, so that
      git_commit_non_empty_tree can work. Unfortunately, this is a
      bit slower due to the extra process overhead:
      
        $ cd t/perf && ./run 348d4f2f HEAD p7000-filter-branch.sh
        [...]
        Test                  348d4f2f           HEAD
        --------------------------------------------------------------
        7000.2: noop filter   3.76(0.24+0.26)   4.54(0.28+0.24) +20.7%
      
      We could try to make git_commit_non_empty_tree more clever.
      However, the value of $tree here is technically
      user-visible. The user can provide arbitrary shell code at
      this stage, which could itself have a similar assumption to
      what is in git_commit_non_empty_tree. So the conservative
      choice to fix this regression is to take the 20% hit and
      give the pre-348d4f2f behavior. We still end up much faster
      than before the optimization:
      
        $ cd t/perf && ./run 348d4f2f^ HEAD p7000-filter-branch.sh
        [...]
        Test                  348d4f2f^          HEAD
        --------------------------------------------------------------
        7000.2: noop filter   9.51(4.32+0.40)   4.51(0.28+0.23) -52.6%
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1dc413eb
    • J
      test-lib: clarify and tighten SANITY · 719c3da2
      Junio C Hamano 提交于
      f400e51c (test-lib.sh: set prerequisite SANITY by testing what we
      really need, 2015-01-27) improved the way SANITY prerequisite was
      determined, but made the resulting code (incorrectly) imply that
      SANITY is all about effects of permission bits of the containing
      directory has on the files contained in it by the comment it added,
      its log message and the actual tests.
      
      State what SANITY is about more clearly in the comment, and test
      that a file whose permission bits says should be unreadble truly
      cannot be read.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      719c3da2
  7. 16 1月, 2016 1 次提交
    • J
      t0060: loosen overly strict expectations · 371471ce
      Johannes Schindelin 提交于
      The dirname() tests file were developed and tested on only the five
      platforms available to the developer at the time, namely: Linux (both 32
      and 64bit), Windows XP 32-bit (MSVC), MinGW 32-bit and Cygwin 32-bit.
      
      http://pubs.opengroup.org/onlinepubs/9699919799/functions/basename.html
      (i.e. the POSIX spec) says, in part:
      
      	If the string pointed to by path consists entirely of the '/'
      	character, basename() shall return a pointer to the string "/".
      	If the string pointed to by path is exactly "//", it is
      	implementation-defined whether "/" or "//" is returned.
      
      The thinking behind testing precise, OS-dependent output values was to
      document that different setups produce different values. However, as the
      test failures on MacOSX illustrated eloquently: hardcoding pretty much each
      and every setup's expectations is pretty fragile.
      
      This is not limited to the "//" vs "/" case, of course, other inputs are
      also allowed to produce multiple outputs by the POSIX specs.
      
      So let's just test for all allowed values and be done with it. This still
      documents that Git cannot rely on one particular output value in those
      cases, so the intention of the original tests is still met.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      371471ce
  8. 14 1月, 2016 1 次提交
    • J
      rebase: ignore failures from "gc --auto" · 8c24f5b0
      Jeff King 提交于
      After rebasing, we call "gc --auto" to clean up if we
      created a lot of loose objects. However, we do so inside an
      &&-chain. If "gc --auto" fails (e.g., because a previous
      background gc blocked us by leaving "gc.log" in place),
      then:
      
        1. We will fail to clean up the state directory, leaving
           the user stuck in the rebase forever (even "git am
           --abort" doesn't work, because it calls "gc --auto"!).
      
        2. In some cases, we may return a bogus exit code from
           rebase, indicating failure when everything except the
           auto-gc succeeded.
      
      We can fix this by ignoring the exit code of "gc --auto".
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8c24f5b0