1. 05 4月, 2009 2 次提交
  2. 29 1月, 2009 2 次提交
    • J
      git: use run_command() to execute dashed externals · d8e96fd8
      Jeff King 提交于
      We used to simply try calling execvp(); if it succeeded, then we were done
      and the new program was running. If it didn't, then we knew that it wasn't
      a valid command.
      
      Unfortunately, this interacted badly with the new pager handling. Now that
      git remains the parent process and the pager is spawned, git has to hang
      around until the pager is finished. We install an atexit handler to do
      this, but that handler never gets called if we successfully run execvp.
      
      You could see this behavior by running any dashed external using a pager
      (e.g., "git -p stash list"). The command finishes running, but the pager
      is still going. In the case of less, it then gets an error reading from
      the terminal and exits, potentially leaving the terminal in a broken state
      (and not showing the output).
      
      This patch just uses run_command() to try running the dashed external. The
      parent git process then waits for the external process to complete and
      then handles the pager cleanup as it would for an internal command.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d8e96fd8
    • J
      git: s/run_command/run_builtin/ · f172f334
      Jeff King 提交于
      There is a static function called run_command which
      conflicts with the library function in run-command.c; this
      isn't a problem currently, but prevents including
      run-command.h in git.c.
      
      This patch just renames the static function to something
      more specific and non-conflicting.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f172f334
  3. 26 1月, 2009 2 次提交
  4. 06 1月, 2009 2 次提交
  5. 03 1月, 2009 1 次提交
  6. 05 12月, 2008 1 次提交
  7. 03 12月, 2008 1 次提交
  8. 13 10月, 2008 1 次提交
  9. 24 9月, 2008 1 次提交
  10. 10 9月, 2008 2 次提交
  11. 01 9月, 2008 1 次提交
    • J
      git wrapper: DWIM mistyped commands · 8af84dad
      Johannes Schindelin 提交于
      This patch introduces a modified Damerau-Levenshtein algorithm into
      Git's code base, and uses it with the following penalties to show some
      similar commands when an unknown command was encountered:
      
      	swap = 0, insertion = 1, substitution = 2, deletion = 4
      
      A typical output would now look like this:
      
      	$ git sm
      	git: 'sm' is not a git-command. See 'git --help'.
      
      	Did you mean one of these?
      		am
      		rm
      
      The cut-off is at similarity rating 6, which was empirically determined
      to give sensible results.
      
      As a convenience, if there is only one candidate, Git continues under
      the assumption that the user mistyped it.  Example:
      
      	$ git reabse
      	WARNING: You called a Git program named 'reabse', which does
      	not exist.
      	Continuing under the assumption that you meant 'rebase'
      	[...]
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NAlex Riesen <raa.lkml@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8af84dad
  12. 29 8月, 2008 1 次提交
    • N
      diff*: fix worktree setup · 4f38f6b5
      Nguyễn Thái Ngọc Duy 提交于
      This fixes "git diff", "git diff-files" and "git diff-index" to work
      correctly under worktree setup. Because diff* family works in many modes
      and not all of them require worktree, Junio made a nice summary
      (with a little modification from me):
      
       * diff-files is about comparing with work tree, so it obviously needs a
        work tree;
      
       * diff-index also does, except "diff-index --cached" or "diff --cached TREE"
      
       * no-index is about random files outside git context, so it obviously
         doesn't need any work tree;
      
       * comparing two (or more) trees doesn't;
      
       * comparing two blobs doesn't;
      
       * comparing a blob with a random file doesn't;
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4f38f6b5
  13. 26 8月, 2008 1 次提交
    • J
      Revert "Build-in "git-shell"" · 1e7abc59
      Junio C Hamano 提交于
      This reverts commit daa0cc9a.
      It was a stupid idea to do this; when run as a log-in shell,
      it is spawned with argv[0] set to "-git-shell", so the usual
      name-based dispatch would not work to begin with.
      1e7abc59
  14. 20 8月, 2008 1 次提交
  15. 26 7月, 2008 1 次提交
  16. 22 7月, 2008 1 次提交
  17. 08 7月, 2008 1 次提交
  18. 06 7月, 2008 1 次提交
    • J
      Allow per-command pager config · 4e10738a
      Jeff King 提交于
      There is great debate over whether some commands should set
      up a pager automatically. This patch allows individuals to
      set their own pager preferences for each command, overriding
      the default. For example, to disable the pager for git
      status:
      
        git config pager.status false
      
      If "--pager" or "--no-pager" is specified on the command
      line, it takes precedence over the config option.
      
      There are two caveats:
      
        - you can turn on the pager for plumbing commands.
          Combined with "core.pager = always", this will probably
          break a lot of things. Don't do it.
      
        - This only works for builtin commands. The reason is
          somewhat complex:
      
          Calling git_config before we do setup_git_directory
          has bad side effects, because it wants to know where
          the git_dir is to find ".git/config". Unfortunately,
          we cannot call setup_git_directory indiscriminately,
          because some builtins (like "init") break if we do.
      
          For builtins, this is OK, since we can just wait until
          after we call setup_git_directory. But for aliases, we
          don't know until we expand (recursively) which command
          we're doing. This should not be a huge problem for
          aliases, which can simply use "--pager" or "--no-pager"
          in the alias as appropriate.
      
          For external commands, however, we don't know we even
          have an external command until we exec it, and by then
          it is too late to check the config.
      
          An alternative approach would be to have a config mode
          where we don't bother looking at .git/config, but only
          at the user and system config files. This would make the
          behavior consistent across builtins, aliases, and
          external commands, at the cost of not allowing per-repo
          pager config for at all.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4e10738a
  19. 01 7月, 2008 1 次提交
  20. 24 6月, 2008 1 次提交
  21. 23 6月, 2008 1 次提交
  22. 10 6月, 2008 1 次提交
    • R
      Ignore .gitattributes in bare repositories · 2d35d556
      René Scharfe 提交于
      Attributes can be specified at three different places: the internal
      table of default values, the file $GIT_DIR/info/attributes and files
      named .gitattributes in the work tree.  Since bare repositories don't
      have a work tree, git should ignore any .gitattributes files there.
      
      This patch makes git do that, so the only way left for a user to specify
      attributes in a bare repository is the file info/attributes (in addition
      to changing the defaults and recompiling).
      
      In addition, git-check-attr is now allowed to run without a work tree.
      Like any user of the code in attr.c, it ignores the .gitattributes files
      when run in a bare repository.  It can still read from info/attributes.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2d35d556
  23. 07 6月, 2008 1 次提交
  24. 24 5月, 2008 1 次提交
    • J
      diff-files: do not play --no-index games · 6304c29d
      Junio C Hamano 提交于
      Being able to say "git diff A B" outside a git repository and getting a
      colourful version of "diff -u A B" may be nice, but such a cute hack
      should not give bogus results to scripts that want to give two paths,
      either or both of which happen to have been removed from the work tree,
      to "git diff-files".
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6304c29d
  25. 05 5月, 2008 1 次提交
  26. 30 4月, 2008 1 次提交
  27. 02 4月, 2008 1 次提交
    • J
      Accept git aliases outside a git repository · e85dc0a3
      Junio C Hamano 提交于
      af05d679 (Always set *nongit_ok in setup_git_directory_gently(),
      2008-03-25) had a change from the patch originally submitted that resulted
      in disabling aliases outside a git repository.
      
      It turns out that some people used "alias.fubar = diff --color-words" in
      $HOME/.gitconfig to use non-index diff (or any command that do not need
      git repository) outside git repositories, and this change broke them,
      so this resurrects the support for such usage.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e85dc0a3
  28. 27 3月, 2008 1 次提交
  29. 15 3月, 2008 1 次提交
  30. 01 3月, 2008 1 次提交
  31. 25 2月, 2008 1 次提交
  32. 24 2月, 2008 1 次提交
    • J
      Add merge-subtree back · 1736855c
      Junio C Hamano 提交于
      An earlier commit e1b3a2ca (Build-in merge-recursive) made the
      subtree merge strategy backend unavailable.  This resurrects
      it.
      
      A new test t6029 currently only tests the strategy is available,
      but it should be enhanced to check the real "subtree" case.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1736855c
  33. 17 2月, 2008 1 次提交
    • D
      Build in checkout · 782c2d65
      Daniel Barkalow 提交于
      The only differences in behavior should be:
      
       - git checkout -m with non-trivial merging won't print out
         merge-recursive messages (see the change in t7201-co.sh)
      
       - git checkout -- paths... will give a sensible error message if
         HEAD is invalid as a commit.
      
       - some intermediate states which were written to disk in the shell
         version (in particular, index states) are only kept in memory in
         this version, and therefore these can no longer be revealed by
         later write operations becoming impossible.
      
       - when we change branches, we discard MERGE_MSG, SQUASH_MSG, and
         rr-cache/MERGE_RR, like reset always has.
      
      I'm not 100% sure I got the merge recursive setup exactly right; the
      base for a non-trivial merge in the shell code doesn't seem
      theoretically justified to me, but I tried to match it anyway, and the
      tests all pass this way.
      
      Other than these items, the results should be identical to the shell
      version, so far as I can tell.
      
      [jc: squashed lock-file fix from Dscho in]
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      782c2d65
  34. 12 2月, 2008 1 次提交
  35. 10 2月, 2008 1 次提交
    • D
      Build-in merge-recursive · e1b3a2ca
      Daniel Barkalow 提交于
      This makes write_tree_from_memory(), which writes the active cache as
      a tree and returns the struct tree for it, available to other code. It
      also makes available merge_trees(), which does the internal merge of
      two trees with a known base, and merge_recursive(), which does the
      recursive internal merge of two commits with a list of common
      ancestors.
      
      The first two of these will be used by checkout -m, and the third is
      presumably useful in general, although the implementation of checkout
      -m which entirely matches the behavior of the shell version does not
      use it (since it ignores the difference of ancestry between the old
      branch and the new branch).
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      e1b3a2ca