Commits on May 25, 2012
  1. @gitster

    Git 1.7.11-rc0

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed May 25, 2012
  2. @gitster

    Merge branch 'sp/sh-windows-pwd'

    * sp/sh-windows-pwd:
      git-sh-setup: define workaround wrappers before they are used
    gitster committed May 25, 2012
  3. @gitster

    Merge branch 'mh/test-keep-prove-cache'

    By Michael Haggerty
    * mh/test-keep-prove-cache:
      t/Makefile: retain cache t/.prove across prove runs
    gitster committed May 25, 2012
  4. @gitster

    Merge branch 'rs/dir-strbuf-read-recursive-fix'

    Simplification for the codepath to read directories recursively.
    
    By René Scharfe
    * rs/dir-strbuf-read-recursive-fix:
      dir: simplify fill_directory()
      dir: respect string length argument of read_directory_recursive()
    gitster committed May 25, 2012
  5. @gitster

    Merge branch 'fc/git-complete-helper-fix'

    Resurrects old behaviour of _git/_gitk for external users.
    gitster committed May 25, 2012
  6. @gitster

    Merge branch 'ap/checkout-no-progress-for-non-tty'

    The progress indicator for a large "git checkout" was sent to stderr
    even if it is not a terminal.
    gitster committed May 25, 2012
  7. @gitster

    Merge branch 'jk/format-person-part-buffer-limit'

    Avoid buffer overflow in format_person_part() function
    gitster committed May 25, 2012
  8. @gitster

    Merge branch 'jk/pretty-commit-header-incomplete-line'

    Fixes error codepath when a malformed commit object has a header line
    chomped in the middle.
    gitster committed May 25, 2012
  9. @gitster

    Merge branch 'jk/ident-split-fix'

    An author/committer name that is a single character was mishandled as an
    invalid name by mistake.
    gitster committed May 25, 2012
  10. @gitster

    Merge branch 'rs/xdiff-fast-hash-fix'

    Fixes compilation issue on 32-bit in an earlier series.
    gitster committed May 25, 2012
  11. @gitster

    Merge branch 'mh/ref-api'

    Fixes a performance regression in the earlier series.
    gitster committed May 25, 2012
  12. @gitster

    Merge branch 'rs/maint-grep-F'

    "git grep -e '$pattern'", unlike the case where the patterns are read from
    a file, did not treat individual lines in the given pattern argument as
    separate regular expressions as it should.
    gitster committed May 25, 2012
  13. @gitster

    Sync with 1.7.10.3

    gitster committed May 25, 2012
  14. @gitster

    Git 1.7.10.3

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed May 25, 2012
  15. @gitster

    Merge branch 'hv/submodule-alt-odb' into maint

    When a submodule repository uses alternate object store mechanism, some
    commands that were started from the superproject did not notice it and
    failed with "No such object" errors.  The subcommands of "git submodule"
    command that recursed into the submodule in a separate process were OK;
    only the ones that cheated and peeked directly into the submodule's
    repository from the primary process were affected.
    
    By Heiko Voigt
    * hv/submodule-alt-odb:
      teach add_submodule_odb() to look for alternates
    gitster committed May 25, 2012
  16. @gitster

    Merge branch 'bp/diff-no-index-strbuf-fix' into maint

    The directory path used in "git diff --no-index", when it recurses
    down, was broken with a recent update after v1.7.10.1 release.
    
    By Bobby Powers
    * bp/diff-no-index-strbuf-fix:
      diff --no-index: don't leak buffers in queue_diff
      diff --no-index: reset temporary buffer lengths on directory iteration
    gitster committed May 25, 2012
  17. @torvalds @gitster

    fmt-merge-message: add empty line between tag and signature verification

    When adding the information from a tag, put an empty line between the
    message of the tag and the commented-out signature verification
    information.
    
    At least for the kernel workflow, I often end up re-formatting the message
    that people send me in the tag data. In that situation, putting the tag
    message and the tag signature verification back-to-back then means that
    normal editor "reflow parapgraph" command will get confused and think that
    the signature is a continuation of the last message paragraph.
    
    So I always end up having to first add an empty line, and then go back and
    reflow the last paragraph. Let's just do it in git directly.
    
    The extra vertical space also makes the verification visually stand out
    more from the user-supplied message, so it looks a bit more readable to me
    too, but that may be just an odd personal preference.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    torvalds committed with gitster May 25, 2012
  18. @jrn @gitster

    config doc: remove confusion about relative GIT_DIR from FILES section

    From the FILES section of the git-config(1) manual:
    
    	$GIT_DIR/config::
    		Repository specific configuration file. (The filename is
    		of course relative to the repository root, not the working
    		directory.)
    
    That's confusing because $GIT_DIR really is relative to the working
    directory.
    
    	$ GIT_DIR=.git GIT_EDITOR='pwd; echo editing'
    	$ export GIT_DIR GIT_EDITOR
    	$ git config --edit --local
    	/home/jrn/src/git/Documentation
    	editing .git/config
    
    It turns out that the comment is a remnant from older days when the
    heading said ".git/config" (which is indeed relative to the top of the
    worktree).
    
    It was only when the heading was changed to refer more precisely to
    <git dir>/config (see v1.5.3.2~18, AsciiDoc tweak to avoid leading
    dot, 2007-09-14) that the parenthesis stopped making sense.  Remove
    it.
    
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jrn committed with gitster May 25, 2012
  19. @gitster

    Sync with maint

    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
    gitster committed May 24, 2012
  20. @gitster

    Update draft release notes to 1.7.10.3

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed May 24, 2012
  21. @gitster

    Merge branch 'jk/maint-status-porcelain-z-b' into maint

    "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
    gitster committed May 24, 2012
Commits on May 24, 2012
  1. @mhagger @gitster

    Avoid sorting if references are added to ref_cache in order

    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: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    mhagger committed with gitster May 24, 2012
  2. @apenwarr @gitster

    checkout: no progress messages if !isatty(2).

    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: Avery Pennarun <apenwarr@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    apenwarr committed with gitster May 24, 2012
  3. @peff @gitster

    osxkeychain: pull make config from top-level directory

    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: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff committed with gitster May 23, 2012
Commits on May 23, 2012
  1. @gitster

    Update draft release notes to 1.7.11

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed May 23, 2012
  2. @gitster

    Merge branch 'rs/archive-tree-in-tip-simplify'

    By René Scharfe
    * rs/archive-tree-in-tip-simplify:
      archive-tar: keep const in checksum calculation
      archive: simplify refname handling
    gitster committed May 23, 2012
  3. @gitster

    Merge branch 'js/rev-parse-doc-fix'

    By Jon Seymour
    * js/rev-parse-doc-fix:
      rev-parse doc: --git-dir does not always show a relative path
    gitster committed May 23, 2012
  4. @gitster

    Merge branch 'js/rebase-i-p-test-fix'

    By Johannes Sixt
    * js/rebase-i-p-test-fix:
      Fix t3411.3 to actually rebase something
    gitster committed May 23, 2012
  5. @gitster

    Merge branch 'bp/diff-no-index-strbuf-fix'

    Fix regressions to "git diff --no-index" when it recurses down.
    
    By Bobby Powers
    * bp/diff-no-index-strbuf-fix:
      diff --no-index: don't leak buffers in queue_diff
      diff --no-index: reset temporary buffer lengths on directory iteration
    gitster committed May 23, 2012
  6. @gitster

    Merge branch 'hv/submodule-alt-odb'

    When peeking into object stores of submodules, the code forgot that they
    might borrow objects from alternate object stores on their own.
    
    By Heiko Voigt
    * hv/submodule-alt-odb:
      teach add_submodule_odb() to look for alternates
    gitster committed May 23, 2012
  7. @gitster

    xdiff: import new 32-bit version of count_masked_bytes()

    Import the latest 32-bit implementation of count_masked_bytes() from
    Linux (arch/x86/include/asm/word-at-a-time.h).  It's shorter and avoids
    overflows and negative numbers.
    
    This fixes test failures on 32-bit, where negative partial results had
    been shifted right using the "wrong" method (logical shift right instead
    of arithmetic short right).  The compiler is free to chose the method,
    so it was only wrong in the sense that it didn't work as intended by us.
    
    Reported-by: Øyvind A. Holm <sunny@sunbase.org>
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    René Scharfe committed with gitster May 22, 2012
  8. @gitster

    xdiff: avoid more compiler warnings with XDL_FAST_HASH on 32-bit mach…

    …ines
    
    Hide literals that can cause compiler warnings for 32-bit architectures in
    expressions that evaluate to small numbers there.  Some compilers warn that
    0x0001020304050608 won't fit into a 32-bit long, others that shifting right
    by 56 bits clears a 32-bit value completely.
    
    The correct values are calculated in the 64-bit case, which is all that matters
    in this if-branch.
    
    Reported-by: Øyvind A. Holm <sunny@sunbase.org>
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Acked-by: Thomas Rast <trast@student.ethz.ch>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    René Scharfe committed with gitster May 22, 2012
Commits on May 22, 2012
  1. @gitster

    xdiff: avoid compiler warnings with XDL_FAST_HASH on 32-bit machines

    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: Øyvind A. Holm <sunny@sunbase.org>
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    René Scharfe committed with gitster May 22, 2012
  2. @peff @gitster

    avoid segfault when reading header of malformed commits

    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: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff committed with gitster May 22, 2012
  3. @peff @gitster

    pretty: avoid buffer overflow in format_person_part

    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: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff committed with gitster May 22, 2012