1. 30 5月, 2012 1 次提交
    • J
      submodules: print "registered for path" message only once · c1c259e2
      Jens Lehmann 提交于
      Since 2cd9de3e (submodule add: always initialize .git/config entry) the
      message "Submodule '\$name' (\$url) registered for path '\$sm_path'" is
      printed every time cmd_init() is called, e.g. each time "git submodule
      update" is used with the --init option.
      
      This was not intended and leads to bogus output which can confuse users
      and build systems. Apart from that the $url variable was not set after the
      first run which did the actual initialization and only "()" was printed
      in subsequent runs where "($url)" was meant to inform the user about the
      upstream repo.
      
      Fix that by moving the say command in question into the if block where the
      url is initialized, restoring the behavior that was in place before the
      2cd9de3e commit. While at it also remove the comment which still describes
      the logic used before 2cd9de3e and add a comment about how things work now.
      Reported-by: NNicolas Viennot and Sid Nair <nicolas@viennot.com>
      Reported-by: NHeiko Voigt <hvoigt@hvoigt.net>
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c1c259e2
  2. 26 5月, 2012 18 次提交
  3. 25 5月, 2012 6 次提交
    • J
      Sync with maint · 5bc2dc29
      Junio C Hamano 提交于
      By Jeff King (1) and Junio C Hamano (1)
      * maint:
        Update draft release notes to 1.7.10.3
        osxkeychain: pull make config from top-level directory
      5bc2dc29
    • J
      Update draft release notes to 1.7.10.3 · c4649188
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c4649188
    • J
      Merge branch 'jk/maint-status-porcelain-z-b' into maint · a8bd582d
      Junio C Hamano 提交于
      "git status --porcelain" ignored "--branch" option by mistake.  The output
      for "git status --branch -z" was also incorrect and did not terminate the
      record for the current branch name with NUL as asked.
      
      By Jeff King
      * jk/maint-status-porcelain-z-b:
        status: respect "-b" for porcelain format
        status: fix null termination with "-b"
        status: refactor null_termination option
        commit: refactor option parsing
      a8bd582d
    • M
      Avoid sorting if references are added to ref_cache in order · 654ad400
      Michael Haggerty 提交于
      The old code allowed many references to be efficiently added to a
      single directory, because it just appended the references to the
      containing directory unsorted without doing any searching (and
      therefore without requiring any intermediate sorting).  But the old
      code was inefficient when a large number of subdirectories were added
      to a directory, because the directory always had to be searched to see
      if the new subdirectory already existed, and this search required the
      directory to be sorted first.  The same was repeated for every new
      subdirectory, so the time scaled like O(N^2), where N is the number of
      subdirectories within a single directory.
      
      In practice, references are often added to the ref_cache in
      lexicographic order, for example when reading the packed-refs file.
      So build some intelligence into add_entry_to_dir() to optimize for the
      case of references and/or subdirectories being added in lexicographic
      order: if the existing entries were already sorted, and the new entry
      comes after the last existing entry, then adjust ref_dir::sorted to
      reflect the fact that the ref_dir is still sorted.
      
      Thanks to Peff for pointing out the performance regression that
      inspired this change.
      Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      654ad400
    • A
      checkout: no progress messages if !isatty(2). · e9fc64c6
      Avery Pennarun 提交于
      If stderr isn't a tty, we shouldn't be printing incremental progress
      messages.  In particular, this affects 'git checkout -f . >&logfile'
      unless you provided -q.  And git-new-workdir has no way to provide -q.
      
      It would probably be better to have progress.c check isatty(2) all the time,
      but that wouldn't allow things like 'git push --progress' to force progress
      reporting to on, so I won't try to solve the general case right now.
      
      Actual fix suggested by Jeff King.
      Signed-off-by: NAvery Pennarun <apenwarr@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e9fc64c6
    • J
      osxkeychain: pull make config from top-level directory · 17a9ac7d
      Jeff King 提交于
      The default compiler and cflags were mostly "works for me"
      when I built the original version. We need to be much less
      careful here than usual, because we know we are building
      only on OS X.  But it's only polite to at least respect the
      CFLAGS and CC definitions that the user may have provided
      earlier.
      
      While we're at it, let's update our definitions and rules to
      be more like the top-level Makefile; default our CFLAGS to
      include -O2, and make sure we use CFLAGS and LDFLAGS when
      linking.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      17a9ac7d
  4. 24 5月, 2012 8 次提交
  5. 23 5月, 2012 4 次提交
    • R
      xdiff: avoid compiler warnings with XDL_FAST_HASH on 32-bit machines · 9322ce21
      René Scharfe 提交于
      Import macro REPEAT_BYTE from Linux (arch/x86/include/asm/word-at-a-time.h)
      to avoid 64-bit integer literals, which cause some 32-bit compilers to
      print warnings.
      Reported-by: NØyvind A. Holm <sunny@sunbase.org>
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9322ce21
    • J
      avoid segfault when reading header of malformed commits · a9c7a8a8
      Jeff King 提交于
      If a commit object has a header line at the end of the
      buffer that is missing its newline (or if it appears so
      because the content on the header line contains a stray
      NUL), then git will segfault.
      
      Interestingly, this case is explicitly handled and we do
      correctly scan the final line for the header we are looking
      for. But if we don't find it, we will dereference NULL while
      trying to look at the next line.
      
      Git will never generate such a commit, but it's good to be
      defensive. We could die() in such a case, but since it's
      easy enough to handle it gracefully, let's just issue a
      warning and continue (so you could still view such a commit
      with "git show", though you might be missing headers after
      the NUL).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a9c7a8a8
    • J
      pretty: avoid buffer overflow in format_person_part · c9b4e9e5
      Jeff King 提交于
      When we parse the name and email from a commit to
      pretty-print them, we usually can just put the result
      directly into our strbuf result. However, if we are going to
      use the mailmap, then we must first copy them into a
      NUL-terminated buffer to feed to the mailmap machinery.
      
      We did so by using strlcpy into a static buffer, but we used
      it wrong. We fed it the length of the substring we wanted to
      copy, but never checked that that length was less than the
      size of the destination buffer.
      
      The simplest fix is to just use snprintf to copy the
      substring properly while still respecting the destination
      buffer's size. It might seem like replacing the static
      buffer with a strbuf would help, but we need to feed a
      static buffer to the mailmap machinery anyway, so there's
      not much benefit to handling arbitrary sizes.
      
      A more ideal solution would be for mailmap to grow an
      interface that:
      
        1. Takes a pointer and length combination, instead of
           assuming a NUL-terminated string.
      
        2. Returns a pointer to the mailmap's allocated string,
           rather than copying it into the buffer.
      
      Then we could avoid the need for an extra buffer entirely.
      However, doing this would involve a lot of refactoring of
      mailmap and of string_list (which mailmap uses to store the
      map itself). For now, let's do the simplest thing to fix the
      bug.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c9b4e9e5
    • J
      fix off-by-one error in split_ident_line · d9955fd6
      Jeff King 提交于
      Commit 4b340cfa split the logic to parse an ident line out of
      pretty.c's format_person_part. But in doing so, it
      accidentally introduced an off-by-one error that caused it
      to think that single-character names were invalid.
      
      This manifested itself as the "%an" format failing to show
      anything at all for a single-character name.
      Reported-by: NBrian Turner <bturner@atlassian.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d9955fd6
  6. 22 5月, 2012 1 次提交
  7. 21 5月, 2012 2 次提交