1. 02 1月, 2008 4 次提交
    • J
      Optimize prefixcmp() · 99a6a97b
      Johannes Schindelin 提交于
      Certain codepaths (notably "git log --pretty=format...") use
      prefixcmp() extensively, with very short prefixes.  In those cases,
      calling strlen() is a wasteful operation, so avoid it.
      
      Initial patch by Marco Costalba.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      99a6a97b
    • J
      lock_any_ref_for_update(): reject wildcard return from check_ref_format · 5f7b202a
      Junio C Hamano 提交于
      Recent check_ref_format() returns -3 as well as -1 (general
      error) and -2 (less than two levels).  The caller was explicitly
      checking for -1, to allow "HEAD" but still needed to disallow
      bogus refs.
      
      This introduces symbolic constants for the return values from
      check_ref_format() to make them read better and more
      meaningful.  Normal ref creation codepath can still treat
      non-zero return values as errors.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5f7b202a
    • J
      git-reset: refuse to do hard reset in a bare repository · 49b9362f
      Jeff King 提交于
      It makes no sense since there is no working tree. A soft
      reset should be fine, though.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      49b9362f
    • J
      config: handle lack of newline at end of file better · 02e5ba4a
      Jeff King 提交于
      The config parsing routines use the static global
      'config_file' to store the FILE* pointing to the current
      config file being parsed. The function get_next_char()
      automatically converts an EOF on this file to a newline for
      the convenience of its callers, and it sets config_file to
      NULL to indicate that EOF was reached.
      
      This throws away useful information, though, since some
      routines want to call ftell on 'config_file' to find out
      exactly _where_ the routine ended. In the case of a key
      ending at EOF boundary, we ended up segfaulting in some
      cases (changing that key or adding another key in its
      section), or failing to provide the necessary newline
      (adding a new section).
      
      This patch adds a new flag to indicate EOF and uses that
      instead of setting config_file to NULL. It also makes sure
      to add newlines where necessary for truncated input. All
      three included tests fail without the patch.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      02e5ba4a
  2. 01 1月, 2008 3 次提交
  3. 31 12月, 2007 3 次提交
  4. 29 12月, 2007 2 次提交
    • J
      "git pull --tags": error out with a better message. · 441ed413
      Junio C Hamano 提交于
      When "git pull --tags" is run without any other arguments, the
      standard error message "You told me to fetch and merge stuff but
      there is nothing to merge!  You might want to fix your config"
      is given.
      
      While the error may be technically correct, fixing the config
      would not help, as "git pull --tags" itself tells "git fetch"
      not to use the configured refspecs.
      
      This commit makes "git pull --tags" to issue a different error
      message to avoid confusion.  This is merely an interim solution.
      
      In the longer term, it would be a better approach to change the
      semantics of --tags option to make "git fetch" and "git pull"
      to:
      
       (1) behave as if no --tags was given (so an explicit refspec on
           the command line overrides configured ones, or no explicit
           refspecs on the command line takes configured ones); but
      
       (2) no auto-following of tags is made even when using
           configured refspecs; and
      
       (3) fetch all tags as not-for-merge entries".
      
      Then we would not need to have this separate error message, as
      the ordinary merge will happen even with the --tags option.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      441ed413
    • M
      git-sh-setup: document git_editor() and get_author_ident_from_commit() · 3f4bc3e0
      Miklos Vajna 提交于
      These 2 functions were missing from the manpage.
      Signed-off-by: NMiklos Vajna <vmiklos@frugalware.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3f4bc3e0
  5. 28 12月, 2007 1 次提交
  6. 27 12月, 2007 10 次提交
  7. 24 12月, 2007 2 次提交
  8. 23 12月, 2007 10 次提交
  9. 22 12月, 2007 4 次提交
  10. 21 12月, 2007 1 次提交
    • L
      Re(-re)*fix trim_common_tail() · d2f82950
      Linus Torvalds 提交于
      The tar-ball and the git archive itself is fine, but yes, the diff from
      2.6.23 to 2.6.24-rc6 is bad. It's the "trim_common_tail()" optimization
      that has caused way too much pain.
      
      Very interesting breakage. The patch was actually "correct" in a (rather
      limited) technical sense, but the context at the end was missing because
      while the trim_common_tail() code made sure to keep enough common context
      to allow a valid diff to be generated, the diff machinery itself could
      decide that it could generate the diff differently than the "obvious"
      solution.
      
      Thee sad fact is that the git optimization (which is very important for
      "git blame", which needs no context), is only really valid for that one
      case where we really don't need any context.
      
      [jc: since this is shared with "git diff -U0" codepath, context recovery
      to the end of line needs to be done even for zero context case.]
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d2f82950