1. 11 5月, 2016 1 次提交
    • J
      ci: validate "linkgit:" in documentation · ab81411c
      Junio C Hamano 提交于
      It is easy to add incorrect "linkgit:<page>[<section>]" references
      to our documentation suite.  Catch these common classes of errors:
      
       * Referring to Documentation/<page>.txt that does not exist.
      
       * Referring to a <page> outside the Git suite.  In general, <page>
         must begin with "git".
      
       * Listing the manual <section> incorrectly.  The first line of the
         Documentation/<page>.txt must end with "(<section>)".
      
      with a new script "ci/lint-gitlink", and drive it from "make check-docs".
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ab81411c
  2. 28 4月, 2016 1 次提交
  3. 20 4月, 2016 1 次提交
  4. 16 4月, 2016 2 次提交
  5. 09 4月, 2016 1 次提交
  6. 07 4月, 2016 1 次提交
    • J
      Makefile: stop pretending to support rpmbuild · ab214331
      Junio C Hamano 提交于
      Nobody in the active development community seems to watch breakages
      in the rpmbuild target.  As most major RPM based distros use their
      own specfile when packaging us, they aren't looking after us as
      their pristine upstream tree, either.  At this point, it is turning
      to be a disservice to the users to pretend that our tree natively
      supports "make rpmbuild" target when we do not properly maintain it.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ab214331
  7. 05 4月, 2016 1 次提交
    • J
      Makefile: fix misdirected redirections · d55de70a
      Junio C Hamano 提交于
      In general "echo 2>&1 $msg" to redirect a possible error message
      that comes from 'echo' itself into the same standard output stream
      $msg is getting written to does not make any sense; it is not like
      we are expecting to see any errors out of 'echo' in these statements,
      and even if it were the case, there is no reason to prevent the
      error messages from being sent to the standard error stream.
      
      These are clearly meant to send the argument given to echo to the
      standard error stream as error messages.  Correctly redirect by
      saying "send what is written to the standard output to the standard
      error", i.e. "1>&2" aka ">&2".
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d55de70a
  8. 11 3月, 2016 1 次提交
    • J
      sane_grep: pass "-a" if grep accepts it · 71b40103
      Junio C Hamano 提交于
      Newer versions of GNU grep is reported to be pickier when we feed a
      non-ASCII input and break some Porcelain scripts.  As we know we do
      not feed random binary file to our own sane_grep wrapper, allow us
      to always pass "-a" by setting SANE_TEXT_GREP=-a Makefile variable
      to work it around.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      71b40103
  9. 26 2月, 2016 1 次提交
  10. 28 1月, 2016 1 次提交
    • J
      mingw: fix t5601-clone.sh · 3064d5a3
      Johannes Schindelin 提交于
      Since baaf2337 (connect: improve check for plink to reduce false
      positives, 2015-04-26), t5601 writes out a `plink.exe` for testing that
      is actually a shell script. So the assumption that the `.exe` extension
      implies that the file is *not* a shell script is now wrong.
      
      Since there was no love for the idea of allowing `.exe` files to be
      shell scripts on Windows, let's go the other way round: *make*
      `plink.exe` a real `.exe`.
      
      This fixes t5601-clone.sh in Git for Windows' SDK.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3064d5a3
  11. 17 12月, 2015 1 次提交
  12. 20 11月, 2015 1 次提交
    • M
      refs: split filesystem-based refs code into a new file · 7bd9bcf3
      Michael Haggerty 提交于
      As another step in the move to pluggable reference backends, move the
      code that is specific to the filesystem-based reference backend (i.e.,
      the current system of storing references as loose and packed files) into
      a separate file, refs/files-backend.c.
      
      Aside from a tiny bit of file header boilerplate, this commit only moves
      a subset of the code verbatim from refs.c to the new file, as can easily
      be verified using patience diff:
      
          git diff --patience $commit^:refs.c $commit:refs.c
          git diff --patience $commit^:refs.c $commit:refs/files-backend.c
      Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJeff King <peff@peff.net>
      7bd9bcf3
  13. 06 11月, 2015 1 次提交
  14. 22 10月, 2015 3 次提交
  15. 06 10月, 2015 1 次提交
  16. 03 10月, 2015 1 次提交
  17. 11 9月, 2015 3 次提交
  18. 04 9月, 2015 1 次提交
    • S
      submodule: rewrite `module_list` shell function in C · 74703a1e
      Stefan Beller 提交于
      Most of the submodule operations work on a set of submodules.
      Calculating and using this set is usually done via:
      
             module_list "$@" | {
                 while read mode sha1 stage sm_path
                 do
                      # the actual operation
                 done
             }
      
      Currently the function `module_list` is implemented in the
      git-submodule.sh as a shell script wrapping a perl script.
      The rewrite is in C, such that it is faster and can later be
      easily adapted when other functions are rewritten in C.
      
      git-submodule.sh, similar to the builtin commands, will navigate
      to the top-most directory of the repository and keep the
      subdirectory as a variable. As the helper is called from
      within the git-submodule.sh script, we are already navigated
      to the root level, but the path arguments are still relative
      to the subdirectory we were in when calling git-submodule.sh.
      That's why there is a `--prefix` option pointing to an alternative
      path which to anchor relative path arguments.
      Signed-off-by: NStefan Beller <sbeller@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      74703a1e
  19. 26 8月, 2015 1 次提交
    • E
      generate-cmdlist: re-implement as shell script · 82aec45b
      Eric Sunshine 提交于
      527ec398 (generate-cmdlist: parse common group commands, 2015-05-21)
      replaced generate-cmdlist.sh with a more functional Perl version,
      generate-cmdlist.perl. The Perl version gleans named tags from a new
      "common groups" section in command-list.txt and recognizes those
      tags in "command list" section entries in place of the old 'common'
      tag. This allows git-help to, not only recognize, but also group
      common commands.
      
      Although the tests require Perl, 527ec398 creates an unconditional
      dependence upon Perl in the build system itself, which can not be
      overridden with NO_PERL. Such a dependency may be undesirable; for
      instance, the 'git-lite' package in the FreeBSD ports tree is
      intended as a minimal Git installation (which may, for example, be
      useful on servers needing only local clone and update capability),
      which, historically, has not depended upon Perl[1].
      
      Therefore, revive generate-cmdlist.sh and extend it to recognize
      "common groups" and its named tags. Retire generate-cmdlist.perl.
      
      [1]: http://thread.gmane.org/gmane.comp.version-control.git/275905/focus=276132Signed-off-by: NEric Sunshine <sunshine@sunshineco.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      82aec45b
  20. 20 8月, 2015 1 次提交
    • H
      submodule: implement a config API for lookup of .gitmodules values · 959b5455
      Heiko Voigt 提交于
      In a superproject some commands need to interact with submodules. They
      need to query values from the .gitmodules file either from the worktree
      of from certain revisions. At the moment this is quite hard since a
      caller would need to read the .gitmodules file from the history and then
      parse the values. We want to provide an API for this so we have one
      place to get values from .gitmodules from any revision (including the
      worktree).
      
      The API is realized as a cache which allows us to lazily read
      .gitmodules configurations by commit into a runtime cache which can then
      be used to easily lookup values from it. Currently only the values for
      path or name are stored but it can be extended for any value needed.
      
      It is expected that .gitmodules files do not change often between
      commits. Thats why we lookup the .gitmodules sha1 from a commit and then
      either lookup an already parsed configuration or parse and cache an
      unknown one for each sha1. The cache is lazily build on demand for each
      requested commit.
      
      This cache can be used for all purposes which need knowledge about
      submodule configurations. Example use cases are:
      
       * Recursive submodule checkout needs to lookup a submodule name from
         its path when a submodule first appears. This needs be done before
         this configuration exists in the worktree.
      
       * The implementation of submodule support for 'git archive' needs to
         lookup the submodule name to generate the archive when given a
         revision that is not checked out.
      
       * 'git fetch' when given the --recurse-submodules=on-demand option (or
         configuration) needs to lookup submodule names by path from the
         database rather than reading from the worktree. For new submodule it
         needs to lookup the name from its path to allow cloning new
         submodules into the .git folder so they can be checked out without
         any network interaction when the user does a checkout of that
         revision.
      Signed-off-by: NHeiko Voigt <hvoigt@hvoigt.net>
      Signed-off-by: NStefan Beller <sbeller@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      959b5455
  21. 11 8月, 2015 1 次提交
  22. 05 8月, 2015 2 次提交
    • P
      builtin-am: remove redirection to git-am.sh · 783d7e86
      Paul Tan 提交于
      At the beginning of the rewrite of git-am.sh to C, in order to not break
      existing test scripts that depended on a functional git-am, a
      redirection to git-am.sh was introduced that would activate if the
      environment variable _GIT_USE_BUILTIN_AM was not defined.
      
      Now that all of git-am.sh's functionality has been re-implemented in
      builtin/am.c, remove this redirection, and retire git-am.sh into
      contrib/examples/.
      Signed-off-by: NPaul Tan <pyokagan@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      783d7e86
    • P
      builtin-am: implement skeletal builtin am · 73c2779f
      Paul Tan 提交于
      For the purpose of rewriting git-am.sh into a C builtin, implement a
      skeletal builtin/am.c that redirects to $GIT_EXEC_PATH/git-am if the
      environment variable _GIT_USE_BUILTIN_AM is not defined. Since in the
      Makefile git-am.sh takes precedence over builtin/am.c,
      $GIT_EXEC_PATH/git-am will contain the shell script git-am.sh, and thus
      this allows us to fall back on the functional git-am.sh when running the
      test suite for tests that depend on a working git-am implementation.
      
      Since git-am.sh cannot handle any environment modifications by
      setup_git_directory(), "am" is declared with no setup flags in git.c. On
      the other hand, to re-implement git-am.sh in builtin/am.c, we need to
      run all the git dir and work tree setup logic that git.c typically does
      for us. As such, we work around this temporarily by copying the logic in
      git.c's run_builtin(), which is roughly:
      
      	prefix = setup_git_directory();
      	trace_repo_setup(prefix);
      	setup_work_tree();
      
      This redirection should be removed when all the features of git-am.sh
      have been re-implemented in builtin/am.c.
      Helped-by: NJunio C Hamano <gitster@pobox.com>
      Signed-off-by: NPaul Tan <pyokagan@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      73c2779f
  23. 04 8月, 2015 1 次提交
  24. 02 7月, 2015 1 次提交
  25. 29 6月, 2015 1 次提交
  26. 19 6月, 2015 1 次提交
    • P
      pull: remove redirection to git-pull.sh · b1456605
      Paul Tan 提交于
      At the beginning of the rewrite of git-pull.sh to C, we introduced a
      redirection to git-pull.sh if the environment variable
      _GIT_USE_BUILTIN_PULL was not defined in order to not break test scripts
      that relied on a functional git-pull.
      
      Now that all of git-pull's functionality has been re-implemented in
      builtin/pull.c, remove this redirection, and retire the old git-pull.sh
      into contrib/examples/.
      Signed-off-by: NPaul Tan <pyokagan@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b1456605
  27. 16 6月, 2015 1 次提交
    • P
      pull: implement skeletal builtin pull · 1e1ea69f
      Paul Tan 提交于
      For the purpose of rewriting git-pull.sh into a C builtin, implement a
      skeletal builtin/pull.c that redirects to $GIT_EXEC_PATH/git-pull.sh if
      the environment variable _GIT_USE_BUILTIN_PULL is not defined. This
      allows us to fall back on the functional git-pull.sh when running the
      test suite for tests that depend on a working git-pull implementation.
      
      This redirection should be removed when all the features of git-pull.sh
      have been re-implemented in builtin/pull.c.
      Helped-by: NJunio C Hamano <gitster@pobox.com>
      Signed-off-by: NPaul Tan <pyokagan@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1e1ea69f
  28. 30 5月, 2015 3 次提交
    • J
      Makefile: silence perl/PM.stamp recipe · 7c37a5dc
      Jeff King 提交于
      Every time we run "make", we update perl/PM.stamp, which
      contains a list of all of the perl module files (if it's
      updated, we need to rebuild perl/perl.mak, since the
      Makefile will not otherwise know about the new files).
      
      This means that every time "make" is run, we see:
      
            GEN perl/PM.stamp
      
      in the output, even though it is not likely to have changed.
      Let's make this recipe completely silent, as we do for other
      auto-generated dependency files (e.g., GIT-CFLAGS).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7c37a5dc
    • J
      Makefile: avoid timestamp updates to GIT-BUILD-OPTIONS · a2d25ef0
      Jeff King 提交于
      We force the GIT-BUILD-OPTIONS recipe to run every time
      "make" is invoked. We must do this to catch new options
      which may have come from the command-line or environment.
      
      However, we actually update the file's timestamp each time
      the recipe is run, whether anything changed or not. As a
      result, any files which depend on it (for example, all of
      the perl scripts, which need to know whether NO_PERL was
      set) will be re-built every time.
      
      Let's do our usual trick of writing to a tempfile, then
      doing a "cmp || mv" to update the file only when something
      changed.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a2d25ef0
    • J
      Makefile: drop dependency between git-instaweb and gitweb · e25c7cc1
      Jeff King 提交于
      The rule for "git-instaweb" depends on "gitweb". This makes
      no sense, because:
      
        1. git-instaweb has no build-time dependency on gitweb; it
           is a run-time dependency
      
        2. gitweb is a directory that we want to recursively make
           in. As a result, its recipe is marked .PHONY, which
           causes "make" to rebuild git-instaweb every time it is
           run.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e25c7cc1
  29. 22 5月, 2015 2 次提交
  30. 08 5月, 2015 1 次提交
  31. 16 4月, 2015 1 次提交
    • J
      strbuf_getwholeline: use getdelim if it is available · 0cc30e0e
      Jeff King 提交于
      We spend a lot of time in strbuf_getwholeline in a tight
      loop reading characters from a stdio handle into a buffer.
      The libc getdelim() function can do this for us with less
      overhead. It's in POSIX.1-2008, and was a GNU extension
      before that. Therefore we can't rely on it, but can fall
      back to the existing getc loop when it is not available.
      
      The HAVE_GETDELIM knob is turned on automatically for Linux,
      where we have glibc. We don't need to set any new
      feature-test macros, because we already define _GNU_SOURCE.
      Other systems that implement getdelim may need to other
      macros (probably _POSIX_C_SOURCE >= 200809L), but we can
      address that along with setting the Makefile knob after
      testing the feature on those systems.
      
      Running "git rev-parse refs/heads/does-not-exist" on a repo
      with an extremely large (1.6GB) packed-refs file went from
      (best-of-5):
      
        real    0m8.601s
        user    0m8.084s
        sys     0m0.524s
      
      to:
      
        real    0m6.768s
        user    0m6.340s
        sys     0m0.432s
      
      for a wall-clock speedup of 21%.
      
      Based on a patch from Rasmus Villemoes <rv@rasmusvillemoes.dk>.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0cc30e0e