1. 19 9月, 2013 3 次提交
    • J
      Merge branch 'jc/transport-do-not-use-connect-twice-in-fetch' into maint · 1e93c28f
      Junio C Hamano 提交于
      The auto-tag-following code in "git fetch" tries to reuse the same
      transport twice when the serving end does not cooperate and does
      not give tags that point to commits that are asked for as part of
      the primary transfer.  Unfortunately, Git-aware transport helper
      interface is not designed to be used more than once, hence this
      does not work over smart-http transfer.
      
      * jc/transport-do-not-use-connect-twice-in-fetch:
        builtin/fetch.c: Fix a sparse warning
        fetch: work around "transport-take-over" hack
        fetch: refactor code that fetches leftover tags
        fetch: refactor code that prepares a transport
        fetch: rename file-scope global "transport" to "gtransport"
        t5802: add test for connect helper
      1e93c28f
    • J
      Merge branch 'sp/clip-read-write-to-8mb' into maint · 4b510c38
      Junio C Hamano 提交于
      Send a large request to read(2)/write(2) as a smaller but still
      reasonably large chunks, which would improve the latency when the
      operation needs to be killed and incidentally works around broken
      64-bit systems that cannot take a 2GB write or read in one go.
      
      * sp/clip-read-write-to-8mb:
        Revert "compat/clipped-write.c: large write(2) fails on Mac OS X/XNU"
        xread, xwrite: limit size of IO to 8MB
      4b510c38
    • J
      Merge branch 'jk/mailmap-incomplete-line' into maint · 19230ab8
      Junio C Hamano 提交于
      * jk/mailmap-incomplete-line:
        mailmap: handle mailmap blobs without trailing newlines
      19230ab8
  2. 18 9月, 2013 1 次提交
  3. 12 9月, 2013 1 次提交
  4. 09 9月, 2013 1 次提交
  5. 06 9月, 2013 5 次提交
  6. 04 9月, 2013 3 次提交
  7. 31 8月, 2013 1 次提交
  8. 30 8月, 2013 1 次提交
  9. 29 8月, 2013 2 次提交
    • R
      builtin/fetch.c: Fix a sparse warning · 0f73f8bd
      Ramsay Jones 提交于
      Sparse issues an "'prepare_transport' was not declared. Should it
      be static?" warning. In order to suppress the warning, since this
      symbol only requires file scope, we simply add the static modifier
      to it's declaration.
      Signed-off-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0f73f8bd
    • J
      mailmap: handle mailmap blobs without trailing newlines · f972a165
      Jeff King 提交于
      The read_mailmap_buf function reads each line of the mailmap
      using strchrnul, like:
      
          const char *end = strchrnul(buf, '\n');
          unsigned long linelen = end - buf + 1;
      
      But that's off-by-one when we actually hit the NUL byte; our
      line does not have a terminator, and so is only "end - buf"
      bytes long. As a result, when we subtract the linelen from
      the total len, we end up with (unsigned long)-1 bytes left
      in the buffer, and we start reading random junk from memory.
      
      We could fix it with:
      
          unsigned long linelen = end - buf + !!*end;
      
      but let's take a step back for a moment. It's questionable
      in the first place for a function that takes a buffer and
      length to be using strchrnul. But it works because we only
      have one caller (and are only likely to ever have this one),
      which is handing us data from read_sha1_file. Which means
      that it's always NUL-terminated.
      
      Instead of tightening the assumptions to make the
      buffer/length pair work for a caller that doesn't actually
      exist, let's let loosen the assumptions to what the real
      caller has: a modifiable, NUL-terminated string.
      
      This makes the code simpler and shorter (because we don't
      have to correlate strchrnul with the length calculation),
      correct (because the code with the off-by-one just goes
      away), and more efficient (we can drop the extra allocation
      we needed to create NUL-terminated strings for each line,
      and just terminate in place).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f972a165
  10. 27 8月, 2013 1 次提交
    • J
      config: do not use C function names as struct members · 49d6cfa5
      Jeff King 提交于
      According to C99, section 7.1.4:
      
        Any function declared in a header may be additionally
        implemented as a function-like macro defined in the
        header.
      
      Therefore calling our struct member function pointer "fgetc"
      may run afoul of unwanted macro expansion when we call:
      
        char c = cf->fgetc(cf);
      
      This turned out to be a problem on uclibc, which defines
      fgetc as a macro and causes compilation failure.
      
      The standard suggests fixing this in a few ways:
      
        1. Using extra parentheses to inhibit the function-like
           macro expansion. E.g., "(cf->fgetc)(cf)". This is
           undesirable as it's ugly, and each call site needs to
           remember to use it (and on systems without the macro,
           forgetting will compile just fine).
      
        2. Using #undef (because a conforming implementation must
           also be providing fgetc as a function). This is
           undesirable because presumably the implementation was
           using the macro for a performance benefit, and we are
           dropping that optimization.
      
      Instead, we can simply use non-colliding names.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      49d6cfa5
  11. 26 8月, 2013 1 次提交
    • N
      fetch-pack: do not remove .git/shallow file when --depth is not specified · 6da8bdcb
      Nguyễn Thái Ngọc Duy 提交于
      fetch_pack() can remove .git/shallow file when a shallow repository
      becomes a full one again. This behavior is triggered incorrectly when
      tags are also fetched because fetch_pack() will be called twice. At
      the first fetch_pack() call:
      
       - shallow_lock is set up
       - alternate_shallow_file points to shallow_lock.filename, which is
         "shallow.lock"
       - commit_lock_file is called, which sets shallow_lock.filename to "".
         alternate_shallow_file also becomes "" because it points to the
         same memory.
      
      At the second call, setup_alternate_shallow() is not called and
      alternate_shallow_file remains "". It's mistaken as unshallow case and
      .git/shallow is removed. The end result is a broken repository.
      
      Fix this by always initializing alternate_shallow_file when
      fetch_pack() is called. As an extra measure, check if args->depth > 0
      before commit/rollback shallow file.
      Reported-by: NKacper Kornet <kornet@camk.edu.pl>
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6da8bdcb
  12. 24 8月, 2013 1 次提交
  13. 22 8月, 2013 1 次提交
  14. 21 8月, 2013 2 次提交
    • S
      Revert "compat/clipped-write.c: large write(2) fails on Mac OS X/XNU" · a487916d
      Steffen Prohaska 提交于
      This reverts commit 6c642a87.
      
      The previous commit introduced a size limit on IO chunks on all
      platforms.  The compat clipped_write() is not needed anymore.
      Signed-off-by: NSteffen Prohaska <prohaska@zib.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a487916d
    • S
      xread, xwrite: limit size of IO to 8MB · 0b6806b9
      Steffen Prohaska 提交于
      Checking out 2GB or more through an external filter (see test) fails
      on Mac OS X 10.8.4 (12E55) for a 64-bit executable with:
      
          error: read from external filter cat failed
          error: cannot feed the input to external filter cat
          error: cat died of signal 13
          error: external filter cat failed 141
          error: external filter cat failed
      
      The reason is that read() immediately returns with EINVAL when asked
      to read more than 2GB.  According to POSIX [1], if the value of
      nbyte passed to read() is greater than SSIZE_MAX, the result is
      implementation-defined.  The write function has the same restriction
      [2].  Since OS X still supports running 32-bit executables, the
      32-bit limit (SSIZE_MAX = INT_MAX = 2GB - 1) seems to be also
      imposed on 64-bit executables under certain conditions.  For write,
      the problem has been addressed earlier [6c642a].
      
      Address the problem for read() and write() differently, by limiting
      size of IO chunks unconditionally on all platforms in xread() and
      xwrite().  Large chunks only cause problems, like causing latencies
      when killing the process, even if OS X was not buggy.  Doing IO in
      reasonably sized smaller chunks should have no negative impact on
      performance.
      
      The compat wrapper clipped_write() introduced earlier [6c642a] is
      not needed anymore.  It will be reverted in a separate commit.  The
      new test catches read and write problems.
      
      Note that 'git add' exits with 0 even if it prints filtering errors
      to stderr.  The test, therefore, checks stderr.  'git add' should
      probably be changed (sometime in another commit) to exit with
      nonzero if filtering fails.  The test could then be changed to use
      test_must_fail.
      
      Thanks to the following people for suggestions and testing:
      
          Johannes Sixt <j6t@kdbg.org>
          John Keeping <john@keeping.me.uk>
          Jonathan Nieder <jrnieder@gmail.com>
          Kyle J. McKay <mackyle@gmail.com>
          Linus Torvalds <torvalds@linux-foundation.org>
          Torsten Bögershausen <tboegi@web.de>
      
      [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html
      [2] http://pubs.opengroup.org/onlinepubs/009695399/functions/write.html
      
      [6c642a] commit 6c642a87
          compate/clipped-write.c: large write(2) fails on Mac OS X/XNU
      Signed-off-by: NSteffen Prohaska <prohaska@zib.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0b6806b9
  15. 20 8月, 2013 1 次提交
  16. 15 8月, 2013 2 次提交
    • J
      Revert "Add new @ shortcut for HEAD" · 2c2b6646
      Junio C Hamano 提交于
      This reverts commit cdfd9483, as it
      does not just apply to "@" (and forms with modifiers like @{u}
      applied to it), but also affects e.g. "refs/heads/@/foo", which it
      shouldn't.
      
      The basic idea of giving a short-hand might be good, and the topic
      can be retried later, but let's revert to avoid affecting existing
      use cases for now for the upcoming release.
      2c2b6646
    • J
      Revert "git stash: avoid data loss when "git stash save" kills a directory" · c1ebd90c
      Junio C Hamano 提交于
      This reverts commit a7365313, as it
      has been reported that "ls-files --killed" is too time-consuming in
      a deep directory with too many untracked crufts (e.g. $HOME/.git
      tracking only a few files).
      
      We'd need to revisit it later but "ls-files --killed" needs to be
      optimized before it happens.
      c1ebd90c
  17. 14 8月, 2013 6 次提交
  18. 11 8月, 2013 2 次提交
  19. 10 8月, 2013 5 次提交