1. 21 7月, 2018 1 次提交
  2. 03 4月, 2018 1 次提交
  3. 16 3月, 2018 1 次提交
    • B
      serve: introduce git-serve · ed10cb95
      Brandon Williams 提交于
      Introduce git-serve, the base server for protocol version 2.
      
      Protocol version 2 is intended to be a replacement for Git's current
      wire protocol.  The intention is that it will be a simpler, less
      wasteful protocol which can evolve over time.
      
      Protocol version 2 improves upon version 1 by eliminating the initial
      ref advertisement.  In its place a server will export a list of
      capabilities and commands which it supports in a capability
      advertisement.  A client can then request that a particular command be
      executed by providing a number of capabilities and command specific
      parameters.  At the completion of a command, a client can request that
      another command be executed or can terminate the connection by sending a
      flush packet.
      Signed-off-by: NBrandon Williams <bmwill@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ed10cb95
  4. 15 3月, 2018 1 次提交
  5. 04 8月, 2017 3 次提交
    • M
      git.c: provide setup_auto_pager() · 033fe3d9
      Martin Ågren 提交于
      The previous patch introduced a way for builtins to declare that they
      will take responsibility for handling the `pager.foo`-config item. (See
      the commit message of that patch for why that could be useful.)
      
      Provide setup_auto_pager(), which builtins can call in order to handle
      `pager.<cmd>`, including possibly starting the pager. Make this function
      don't do anything if a pager has already been started, as indicated by
      use_pager or pager_in_use().
      
      Whenever this function is called from a builtin, git.c will already have
      called commit_pager_choice(). Since commit_pager_choice() treats the
      special value -1 as "punt" or "not yet decided", it is not a problem
      that we might end up calling commit_pager_choice() once in git.c and
      once (or more) in the builtin. Make the new function use -1 in the same
      way and document it as "punt".
      
      Don't add any users of setup_auto_pager just yet, one will follow in
      a later patch.
      Suggested-by: NJeff King <peff@peff.net>
      Signed-off-by: NMartin Ågren <martin.agren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      033fe3d9
    • M
      git.c: let builtins opt for handling `pager.foo` themselves · c409824c
      Martin Ågren 提交于
      Before launching a builtin git foo and unless mechanisms with precedence
      are in use, we check for and handle the `pager.foo` config. This is done
      without considering exactly how git foo is being used, and indeed, git.c
      cannot (and should not) know what the arguments to git foo are supposed
      to achieve.
      
      In practice this means that, e.g., `git -c pager.tag tag -a new-tag`
      results in errors such as "Vim: Warning: Output is not to a terminal"
      and a garbled terminal. Someone who makes use of both `git tag -a` and
      `git tag -l` will probably not set `pager.tag`, so that `git tag -a`
      will actually work, at the cost of not paging output of `git tag -l`.
      
      To allow individual builtins to make more informed decisions about when
      to respect `pager.foo`, introduce a flag DELAY_PAGER_CONFIG. If the flag
      is set, do not check `pager.foo`.
      
      Do not check for DELAY_PAGER_CONFIG in `execv_dashed_external()`. That
      call site is arguably wrong, although in a way that is not yet visible,
      and will be changed in a slightly different direction in a later patch.
      
      Don't add any users of DELAY_PAGER_CONFIG just yet, one will follow in a
      later patch.
      Suggested-by: NJeff King <peff@peff.net>
      Signed-off-by: NMartin Ågren <martin.agren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c409824c
    • M
      builtin.h: take over documentation from api-builtin.txt · ec14d4ec
      Martin Ågren 提交于
      Delete Documentation/technical/api-builtin.txt and move its content
      into builtin.h. Format it as a comment. Remove a '+' which was needed
      when the information was formatted for AsciiDoc. Similarly, change
      "::" to ":".
      
      Document SUPPORT_SUPER_PREFIX, thereby bringing the documentation up to
      date with the available flags.
      
      While at it, correct '3 more things to do' to '4 more things to do'.
      Signed-off-by: NMartin Ågren <martin.agren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ec14d4ec
  6. 24 5月, 2017 1 次提交
  7. 10 2月, 2017 1 次提交
    • J
      rebase--helper: add a builtin helper for interactive rebases · 4557f1ad
      Johannes Schindelin 提交于
      Git's interactive rebase is still implemented as a shell script, despite
      its complexity. This implies that it suffers from the portability point
      of view, from lack of expressibility, and of course also from
      performance. The latter issue is particularly serious on Windows, where
      we pay a hefty price for relying so much on POSIX.
      
      Unfortunately, being such a huge shell script also means that we missed
      the train when it would have been relatively easy to port it to C, and
      instead piled feature upon feature onto that poor script that originally
      never intended to be more than a slightly pimped cherry-pick in a loop.
      
      To open the road toward better performance (in addition to all the other
      benefits of C over shell scripts), let's just start *somewhere*.
      
      The approach taken here is to add a builtin helper that at first intends
      to take care of the parts of the interactive rebase that are most
      affected by the performance penalties mentioned above.
      
      In particular, after we spent all those efforts on preparing the sequencer
      to process rebase -i's git-rebase-todo scripts, we implement the `git
      rebase -i --continue` functionality as a new builtin, git-rebase--helper.
      
      Once that is in place, we can work gradually on tackling the rest of the
      technical debt.
      
      Note that the rebase--helper needs to learn about the transient
      --ff/--no-ff options of git-rebase, as the corresponding flag is not
      persisted to, and re-read from, the state directory.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4557f1ad
  8. 18 1月, 2017 1 次提交
  9. 08 9月, 2016 1 次提交
  10. 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
  11. 05 8月, 2015 1 次提交
    • 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
  12. 29 6月, 2015 1 次提交
  13. 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
  14. 14 10月, 2014 1 次提交
  15. 24 6月, 2014 1 次提交
  16. 07 1月, 2014 1 次提交
  17. 13 11月, 2013 1 次提交
  18. 18 9月, 2013 1 次提交
    • S
      repack: rewrite the shell script in C · a1bbc6c0
      Stefan Beller 提交于
      The motivation of this patch is to get closer to a goal of being
      able to have a core subset of git functionality built in to git.
      That would mean
      
       * people on Windows could get a copy of at least the core parts
         of Git without having to install a Unix-style shell
      
       * people using git in on servers with chrooted environments
         do not need to worry about standard tools lacking for shell
         scripts.
      
      This patch is meant to be mostly a literal translation of the
      git-repack script; the intent is that later patches would start using
      more library facilities, but this patch is meant to be as close to a
      no-op as possible so it doesn't do that kind of thing.
      Signed-off-by: NStefan Beller <stefanbeller@googlemail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a1bbc6c0
  19. 14 7月, 2013 1 次提交
    • E
      builtin: add git-check-mailmap command · 226ad348
      Eric Sunshine 提交于
      Introduce command check-mailmap, similar to check-attr and check-ignore,
      which allows direct testing of .mailmap configuration.
      
      As plumbing accessible to scripts and other porcelain, check-mailmap
      publishes the stable, well-tested .mailmap functionality employed by
      built-in Git commands.  Consequently, script authors need not
      re-implement .mailmap functionality manually, thus avoiding potential
      quirks and behavioral differences.
      Signed-off-by: NEric Sunshine <sunshine@sunshineco.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      226ad348
  20. 13 6月, 2013 2 次提交
    • J
      Move copy_note_for_rewrite + friends from builtin/notes.c to notes-utils.c · 49c24704
      Johan Herland 提交于
      This is a pure code movement of the machinery for copying notes to
      rewritten objects. This code was located in builtin/notes.c for
      historical reasons. In order to make it available to builtin/commit.c
      it was declared in builtin.h. This was more of an accident of history
      than a concious design, and we now want to make this machinery more
      widely available.
      
      Hence, this patch moves the code into the new notes-utils.[hc] files
      which are included into libgit.a. Except for adjusting #includes
      accordingly, this patch merely moves the relevant functions verbatim
      into the new files.
      
      Cc: Thomas Rast <trast@inf.ethz.ch>
      Signed-off-by: NJohan Herland <johan@herland.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      49c24704
    • J
      finish_copy_notes_for_rewrite(): Let caller provide commit message · 80a14665
      Johan Herland 提交于
      When copying notes for a rewritten object, the resulting notes commit
      would have the following hardcoded commit message:
      
        Notes added by 'git notes copy'
      
      This is obviously bogus when the notes rewriting is performed by
      'git commit --amend'.
      
      Therefore, let the caller specify an appropriate notes commit message
      instead of hardcoding it. The above message is used for 'git notes copy',
      but when calling finish_copy_notes_for_rewrite() from builtin/commit.c,
      we use the following message instead:
      
        Notes added by 'git commit --amend'
      
      Cc: Thomas Rast <trast@inf.ethz.ch>
      Signed-off-by: NJohan Herland <johan@herland.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      80a14665
  21. 29 5月, 2013 1 次提交
  22. 07 1月, 2013 1 次提交
  23. 29 12月, 2012 1 次提交
    • J
      merge --no-edit: do not credit people involved in the side branch · 9bcbb1c2
      Junio C Hamano 提交于
      The credit lines "By" and "Via" to credit authors and committers for
      their contributions on the side branch are meant as a hint to the
      integrator to decide whom to mention in the log message text.  After
      the integrator saves the message in the editor, they are meant to go
      away and that is why they are commented out.
      
      When a merge is recorded without editing the generated message,
      however, its contents do not go through the normal stripspace()
      and these lines are left in the merge.
      
      Stop producing them when we know the merge is going to be recorded
      without editing, i.e. when --no-edit is given.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9bcbb1c2
  24. 29 10月, 2012 1 次提交
  25. 16 9月, 2012 1 次提交
  26. 30 7月, 2012 1 次提交
    • J
      diff: do not use null sha1 as a sentinel value · e5450100
      Jeff King 提交于
      The diff code represents paths using the diff_filespec
      struct. This struct has a sha1 to represent the sha1 of the
      content at that path, as well as a sha1_valid member which
      indicates whether its sha1 field is actually useful. If
      sha1_valid is not true, then the filespec represents a
      working tree file (e.g., for the no-index case, or for when
      the index is not up-to-date).
      
      The diff_filespec is only used internally, though. At the
      interfaces to the diff subsystem, callers feed the sha1
      directly, and we create a diff_filespec from it. It's at
      that point that we look at the sha1 and decide whether it is
      valid or not; callers may pass the null sha1 as a sentinel
      value to indicate that it is not.
      
      We should not typically see the null sha1 coming from any
      other source (e.g., in the index itself, or from a tree).
      However, a corrupt tree might have a null sha1, which would
      cause "diff --patch" to accidentally diff the working tree
      version of a file instead of treating it as a blob.
      
      This patch extends the edges of the diff interface to accept
      a "sha1_valid" flag whenever we accept a sha1, and to use
      that flag when creating a filespec. In some cases, this
      means passing the flag through several layers, making the
      code change larger than would be desirable.
      
      One alternative would be to simply die() upon seeing
      corrupted trees with null sha1s. However, this fix more
      directly addresses the problem (while bogus sha1s in a tree
      are probably a bad thing, it is really the sentinel
      confusion sending us down the wrong code path that is what
      makes it devastating). And it means that git is more capable
      of examining and debugging these corrupted trees. For
      example, you can still "diff --raw" such a tree to find out
      when the bogus entry was introduced; you just cannot do a
      "--patch" diff (just as you could not with any other
      corrupted tree, as we do not have any content to diff).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e5450100
  27. 26 6月, 2012 1 次提交
  28. 16 6月, 2012 2 次提交
    • J
      fix pager.diff with diff --no-index · 1af3d977
      Jeff King 提交于
      git-diff does not rely on the git wrapper to setup its
      pager; instead, it sets it up on its own after seeing
      whether --quiet or --exit-code has been specified.  After
      diff_no_index was split off from cmd_diff, commit b3fde6cc
      (git diff --no-index: default to page like other diff
      frontends, 2008-05-26) duplicated the one-liner from
      cmd_diff to turn on the pager.
      
      Later, commit 8f0359f0 (Allow pager of diff command be
      enabled/disabled, 2008-07-21) taught the the version in
      cmd_diff to respect the pager.diff config, but the version
      in diff_no_index was left behind. This meant that
      
        git -c pager.diff=0 diff a b
      
      would not use a pager, but
      
        git -c pager.diff=0 diff --no-index a b
      
      would.  Let's fix it by factoring out a common function.
      
      While we're there, let's update the antiquated comment,
      which claims that the pager interferes with propagating the
      exit code; this has not been the case since ea27a18c (spawn
      pager via run_command interface, 2008-07-22).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1af3d977
    • L
      builtin.h: remove unused cmd_<foo> declarations · 0feb7c66
      Luka Perkov 提交于
      These were left in builtin.h after they were converted into
      stand-alone programs or removed after experiments finished.
      Signed-off-by: NLuka Perkov <lists@lukaperkov.net>
      Helped-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0feb7c66
  29. 04 6月, 2012 1 次提交
  30. 28 4月, 2012 1 次提交
    • N
      Add column layout skeleton and git-column · 7e29b825
      Nguyễn Thái Ngọc Duy 提交于
      A column option string consists of many token separated by either
      a space or a  comma. A token belongs to one of three groups:
      
       - enabling: always, never and auto
       - layout mode: currently plain (which does not layout at all)
       - other future tuning flags
      
      git-column can be used to pipe output to from a command that wants
      column layout, but not to mess with its own output code. Simpler output
      code can be changed to use column layout code directly.
      
      Thanks-to: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7e29b825
  31. 22 11月, 2011 1 次提交
  32. 08 11月, 2011 1 次提交
  33. 15 7月, 2011 1 次提交
  34. 01 7月, 2011 1 次提交
    • J
      git skew: a tool to find how big a clock skew exists in the history · 188c35e3
      Jeff King 提交于
      > As you probably guessed from the specificity of the number, I wrote a
      > short program to actually traverse and find the worst skew. It takes
      > about 5 seconds to run (unsurprisingly, since it is doing the same full
      > traversal that we end up doing in the above numbers). So we could
      > "autoskew" by setting up the configuration on clone, and then
      > periodically updating it as part of "git gc".
      
      This patch doesn't implement auto-detection of skew, but is the program
      I used to calculate, and would provide the basis for such
      auto-detection. It would be interesting to see average skew numbers for
      popular repositories. You can run it as "git skew --all".
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      188c35e3
  35. 14 2月, 2011 1 次提交
  36. 18 11月, 2010 1 次提交