1. 27 5月, 2015 4 次提交
    • J
      Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line' into maint · a2e5c79c
      Junio C Hamano 提交于
      "filter-branch" corrupted commit log message that ends with an
      incomplete line on platforms with some "sed" implementations that
      munge such a line.  Work it around by avoiding to use "sed".
      
      * jk/filter-branch-use-of-sed-on-incomplete-line:
        filter-branch: avoid passing commit message through sed
      a2e5c79c
    • J
      Merge branch 'jc/daemon-no-ipv6-for-2.4.1' into maint · 6fd58363
      Junio C Hamano 提交于
      "git daemon" fails to build from the source under NO_IPV6
      configuration (regression in 2.4).
      
      * jc/daemon-no-ipv6-for-2.4.1:
        daemon: unbreak NO_IPV6 build regression
      6fd58363
    • J
      Merge branch 'jk/stash-require-clean-index' into maint · cb9ec8e2
      Junio C Hamano 提交于
      "git stash pop/apply" forgot to make sure that not just the working
      tree is clean but also the index is clean. The latter is important
      as a stash application can conflict and the index will be used for
      conflict resolution.
      
      * jk/stash-require-clean-index:
        stash: require a clean index to apply
        t3903: avoid applying onto dirty index
        t3903: stop hard-coding commit sha1s
      cb9ec8e2
    • J
      Merge branch 'jk/git-no-more-argv0-path-munging' into maint · af6d7a62
      Junio C Hamano 提交于
      We have prepended $GIT_EXEC_PATH and the path "git" is installed in
      (typically "/usr/bin") to $PATH when invoking subprograms and hooks
      for almost eternity, but the original use case the latter tried to
      support was semi-bogus (i.e. install git to /opt/foo/git and run it
      without having /opt/foo on $PATH), and more importantly it has
      become less and less relevant as Git grew more mainstream (i.e. the
      users would _want_ to have it on their $PATH).  Stop prepending the
      path in which "git" is installed to users' $PATH, as that would
      interfere the command search order people depend on (e.g. they may
      not like versions of programs that are unrelated to Git in /usr/bin
      and want to override them by having different ones in /usr/local/bin
      and have the latter directory earlier in their $PATH).
      
      * jk/git-no-more-argv0-path-munging:
        stop putting argv[0] dirname at front of PATH
      af6d7a62
  2. 14 5月, 2015 9 次提交
  3. 12 5月, 2015 6 次提交
  4. 06 5月, 2015 1 次提交
  5. 01 5月, 2015 1 次提交
  6. 30 4月, 2015 1 次提交
    • J
      filter-branch: avoid passing commit message through sed · df062010
      Jeff King 提交于
      On some systems (like OS X), if sed encounters input without
      a trailing newline, it will silently add it. As a result,
      "git filter-branch" on such systems may silently rewrite
      commit messages that omit a trailing newline. Even though
      this is not something we generate ourselves with "git
      commit", it's better for filter-branch to preserve the
      original data as closely as possible.
      
      We're using sed here only to strip the header fields from
      the commit object. We can accomplish the same thing with a
      shell loop. Since shell "read" calls are slow (usually one
      syscall per byte), we use "cat" once we've skipped past the
      header. Depending on the size of your commit messages, this
      is probably faster (you pay the cost to fork, but then read
      the data in saner-sized chunks). This idea is shamelessly
      stolen from Junio.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      df062010
  7. 29 4月, 2015 5 次提交
  8. 28 4月, 2015 5 次提交
  9. 24 4月, 2015 5 次提交
  10. 23 4月, 2015 3 次提交
    • J
      Git 2.4.0-rc3 · 564705c7
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      564705c7
    • J
      stop putting argv[0] dirname at front of PATH · a0b4507e
      Jeff King 提交于
      When the "git" wrapper is invoked, we prepend the baked-in
      exec-path to our PATH, so that any sub-processes we exec
      will all find the git-foo commands that match the wrapper
      version.
      
      If you invoke git with an absolute path, like:
      
        /usr/bin/git foo
      
      we also prepend "/usr/bin" to the PATH. This was added long
      ago by by 231af832 (Teach the "git" command to handle some
      commands internally, 2006-02-26), with the intent that
      things would just work if you did something like:
      
        cd /opt
        tar xzf premade-git-package.tar.gz
        alias git=/opt/git/bin/git
      
      as we would then find all of the related external commands
      in /opt/git/bin. I.e., it made git runtime-relocatable,
      since at the time of 231af832, we installed all of the git
      commands into $(bindir). But these days, that is not enough.
      Since f28ac70f (Move all dashed-form commands to libexecdir,
      2007-11-28), we do not put commands into $(bindir), and you
      actually need to convert "/usr/bin" into "/usr/libexec". And
      not just for finding binaries; we want to find $(sharedir),
      etc, the same way.  The RUNTIME_PREFIX build knob does this
      the right way, by assuming a sane hierarchy rooted at
      "$prefix" when we run "$prefix/bin/git", and inferring
      "$prefix/libexec/git-core", etc.
      
      So this feature (prepending the argv[0] dirname to the PATH)
      is broken for providing a runtime prefix, and has been for
      many years. Does it do anything for other cases?
      
      For the "git" wrapper itself, as well as any commands
      shipped by "git", the answer is no. Those are already in
      git's exec-path, which is consulted first. For third-party
      commands which you've dropped into the same directory, it
      does include them. So if you do
      
        cd /opt
        tar xzf git-built-specifically-for-opt-git.tar.gz
        cp third-party/git-foo /opt/git/bin/git-foo
        alias git=/opt/git/bin/git
      
      it does mean that we will find the third-party "git-foo",
      even if you do not put /opt/git/bin into your $PATH. But
      the flipside of this is that we will bump the precedence of
      _other_ third-party tools that happen to be in the same
      directory as git. For example, consider this setup:
      
        1. Git is installed by the system in /usr/bin. There are
           other system utilities in /usr/bin. E.g., a system
           "vi".
      
        2. The user installs tools they prefer in /usr/local/bin.
           E.g., vim with a "vi" symlink. They set their PATH to
           /usr/local/bin:/usr/bin to prefer their custom tools.
      
        3. Running /usr/bin/git puts "/usr/bin" at the front of
           their PATH. When git invokes the editor on behalf of
           the user, they get the system vi, not their normal vim.
      
      There are other variants of this, including overriding
      system ruby and python (which is quite common using tools
      like "rvm" and "virtualenv", which use relocatable
      hierarchies and $PATH settings to get a consistent
      environment).
      
      Given that the main motivation for git placing the argv[0]
      dirname into the PATH has been broken for years, that the
      remaining cases are obscure and unlikely (and easily fixed
      by the user just setting up their $PATH sanely), and that
      the behavior is hurting real, reasonably common use cases,
      it's not worth continuing to do so.
      Signed-off-by: NJeff King <peff@peff.net>
      Reviewed-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a0b4507e
    • J
      stash: require a clean index to apply · ed178ef1
      Jeff King 提交于
      If you have staged contents in your index and run "stash
      apply", we may hit a conflict and put new entries into the
      index. Recovering to your original state is difficult at
      that point, because tools like "git reset --keep" will blow
      away anything staged.  We can make this safer by refusing to
      apply when there are staged changes.
      
      It's possible we could provide better tooling here, as "git
      stash apply" should be writing only conflicts to the index
      (so we know that any stage-0 entries are potentially
      precious). But it is the odd duck; most "mergy" commands
      will update the index for cleanly merged entries, and it is
      not worth updating our tooling to support this use case
      which is unlikely to be of interest (besides which, we would
      still need to block a dirty index for "stash apply --index",
      since that case _would_ be ambiguous).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ed178ef1