1. 31 10月, 2009 2 次提交
  2. 14 10月, 2009 1 次提交
  3. 27 9月, 2009 1 次提交
    • N
      make 'git clone' ask the remote only for objects it cares about · 5bdc32d3
      Nicolas Pitre 提交于
      Current behavior of 'git clone' when not using --mirror is to fetch
      everything from the peer, and then filter out unwanted refs just before
      writing them out to the cloned repository.  This may become highly
      inefficient if the peer has an unusual ref namespace, or if it simply
      has "remotes" refs of its own, and those locally unwanted refs are
      connecting to a large set of objects which becomes unreferenced as soon
      as they are fetched.
      
      Let's filter out those unwanted refs from the peer _before_ asking it
      what refs we want to fetch instead, which is the most logical thing to
      do anyway.
      Signed-off-by: NNicolas Pitre <nico@fluxnic.net>
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      5bdc32d3
  4. 13 9月, 2009 1 次提交
    • C
      preserve mtime of local clone · f7835a25
      Clemens Buchacher 提交于
      A local clone without hardlinks copies all objects, including dangling
      ones, to the new repository. Since the mtimes are renewed, those
      dangling objects cannot be pruned by "git gc --prune", even if they
      would have been old enough for pruning in the original repository.
      
      Instead, preserve mtime during copy. "git gc --prune" will then work
      in the clone just like it did in the original.
      Signed-off-by: NClemens Buchacher <drizzd@aon.at>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f7835a25
  5. 03 9月, 2009 1 次提交
    • J
      clone: disconnect transport after fetching · 12d49966
      Jeff King 提交于
      The current code just leaves the transport in whatever state
      it was in after performing the fetch.  For a non-empty clone
      over the git protocol, the transport code already
      disconnects at the end of the fetch.
      
      But for an empty clone, we leave the connection hanging, and
      eventually close the socket when clone exits. This causes
      the remote upload-pack to complain "the remote end hung up
      unexpectedly". While this message is harmless to the clone
      itself, it is unnecessarily scary for a user to see and may
      pollute git-daemon logs.
      
      This patch just explicitly calls disconnect after we are
      done with the remote end, which sends a flush packet to
      upload-pack and cleanly disconnects, avoiding the error
      message.
      
      Other transports are unaffected or slightly improved:
      
       - for a non-empty repo over the git protocol, the second
         disconnect is a no-op (since we are no longer connected)
      
       - for "walker" transports (like HTTP or FTP), we actually
         free some used memory (which previously just sat until
         the clone process exits)
      
       - for "rsync", disconnect is always a no-op anyway
      Signed-off-by: NJeff King <peff@peff.net>
      Acked-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      12d49966
  6. 01 9月, 2009 1 次提交
  7. 27 8月, 2009 1 次提交
  8. 21 8月, 2009 1 次提交
    • J
      git clone: Add --recursive to automatically checkout (nested) submodules · e7fed18a
      Johan Herland 提交于
      Many projects using submodules expect all submodules to be checked out
      in order to build/work correctly. A common command sequence for
      developers on such projects is:
      
      	git clone url/to/project
      	cd project
      	git submodule update --init (--recursive)
      
      This patch introduces the --recursive option to git-clone. The new
      option causes git-clone to recursively clone and checkout all
      submodules of the cloned project. Hence, the above command sequence
      can be reduced to:
      
      	git clone --recursive url/to/project
      
      --recursive is ignored if no checkout is done by the git-clone.
      
      The patch also includes documentation and a selftest.
      Signed-off-by: NJohan Herland <johan@herland.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e7fed18a
  9. 28 6月, 2009 2 次提交
  10. 21 6月, 2009 1 次提交
    • L
      Fix various sparse warnings in the git source code · 2af202be
      Linus Torvalds 提交于
      There are a few remaining ones, but this fixes the trivial ones. It boils
      down to two main issues that sparse complains about:
      
       - warning: Using plain integer as NULL pointer
      
         Sparse doesn't like you using '0' instead of 'NULL'. For various good
         reasons, not the least of which is just the visual confusion. A NULL
         pointer is not an integer, and that whole "0 works as NULL" is a
         historical accident and not very pretty.
      
         A few of these remain: zlib is a total mess, and Z_NULL is just a 0.
         I didn't touch those.
      
       - warning: symbol 'xyz' was not declared. Should it be static?
      
         Sparse wants to see declarations for any functions you export. A lack
         of a declaration tends to mean that you should either add one, or you
         should mark the function 'static' to show that it's in file scope.
      
         A few of these remain: I only did the ones that should obviously just
         be made static.
      
      That 'wt_status_submodule_summary' one is debatable. It has a few related
      flags (like 'wt_status_use_color') which _are_ declared, and are used by
      builtin-commit.c. So maybe we'd like to export it at some point, but it's
      not declared now, and not used outside of that file, so 'static' it is in
      this patch.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2af202be
  11. 25 5月, 2009 1 次提交
  12. 17 5月, 2009 1 次提交
  13. 30 4月, 2009 1 次提交
  14. 01 4月, 2009 2 次提交
  15. 08 3月, 2009 2 次提交
  16. 04 3月, 2009 1 次提交
    • J
      Make git-clone respect branch.autosetuprebase · a9f2c136
      Junio C Hamano 提交于
      When git-clone creates an initial branch it was not checking the
      branch.autosetuprebase configuration option (which may exist in
      ~/.gitconfig).  Refactor the code used by "git branch" to create
      a new branch, and use it instead of the insufficiently duplicated code
      in builtin-clone.
      
      Changes are partly, and the test is mostly, based on the previous work by
      Pat Notz.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a9f2c136
  17. 03 3月, 2009 1 次提交
  18. 28 2月, 2009 1 次提交
    • J
      remote: let guess_remote_head() optionally return all matches · 4229f1fa
      Jay Soffian 提交于
      Determining HEAD is ambiguous since it is done by comparing SHA1s.
      
      In the case of multiple matches we return refs/heads/master if it
      matches, else we return the first match we encounter. builtin-remote
      needs all matches returned to it, so add a flag for it to request such.
      
      To be simple and consistent, the return value is now a copy (including
      peer_ref) of the matching refs.
      
      Originally contributed by Jeff King along with the prior commit as a
      single patch.
      Signed-off-by: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4229f1fa
  19. 26 2月, 2009 2 次提交
    • J
      remote: simplify guess_remote_head() · 6cb4e6cc
      Jay Soffian 提交于
      This function had complications which made it hard to extend.
      
      - It used to do two things: find the HEAD ref, and then find a
        matching ref, optionally returning the former via assignment to a
        passed-in pointer. Since finding HEAD is a one-liner, just have a
        caller do it themselves and pass it as an argument.
      
      - It used to manually search through the ref list for
        refs/heads/master; this can be a one-line call to
        find_ref_by_name.
      
      Originally contributed by Jeff King along with the next commit as a
      single patch.
      Signed-off-by: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6cb4e6cc
    • J
      move locate_head() to remote.c · 8ef51733
      Jay Soffian 提交于
      Move locate_head() to remote.c and rename it to guess_remote_head() to
      more accurately reflect what it does. This is in preparation for being
      able to call it from builtin-remote.c
      Signed-off-by: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8ef51733
  20. 13 2月, 2009 1 次提交
  21. 23 1月, 2009 1 次提交
  22. 22 1月, 2009 2 次提交
    • J
      refactor signal handling for cleanup functions · 57b235a4
      Jeff King 提交于
      The current code is very inconsistent about which signals
      are caught for doing cleanup of temporary files and lock
      files. Some callsites checked only SIGINT, while others
      checked a variety of death-dealing signals.
      
      This patch factors out those signals to a single function,
      and then calls it everywhere. For some sites, that means
      this is a simple clean up. For others, it is an improvement
      in that they will now properly clean themselves up after a
      larger variety of signals.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      57b235a4
    • J
      chain kill signals for cleanup functions · 4a16d072
      Jeff King 提交于
      If a piece of code wanted to do some cleanup before exiting
      (e.g., cleaning up a lockfile or a tempfile), our usual
      strategy was to install a signal handler that did something
      like this:
      
        do_cleanup(); /* actual work */
        signal(signo, SIG_DFL); /* restore previous behavior */
        raise(signo); /* deliver signal, killing ourselves */
      
      For a single handler, this works fine. However, if we want
      to clean up two _different_ things, we run into a problem.
      The most recently installed handler will run, but when it
      removes itself as a handler, it doesn't put back the first
      handler.
      
      This patch introduces sigchain, a tiny library for handling
      a stack of signal handlers. You sigchain_push each handler,
      and use sigchain_pop to restore whoever was before you in
      the stack.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4a16d072
  23. 12 1月, 2009 1 次提交
  24. 06 1月, 2009 1 次提交
  25. 26 11月, 2008 3 次提交
  26. 13 10月, 2008 1 次提交
  27. 10 10月, 2008 1 次提交
  28. 20 9月, 2008 1 次提交
  29. 10 9月, 2008 1 次提交
  30. 04 9月, 2008 1 次提交
  31. 02 9月, 2008 1 次提交
    • J
      Bring local clone's origin URL in line with that of a remote clone · 86521aca
      Johan Herland 提交于
      On a local clone, "git clone" would use the fully DWIMmed path as the origin
      URL in the resulting repo. This was slightly inconsistent with the case of a
      remote clone where the _given_ URL was used as the origin URL (because the
      DWIMming was done remotely, and was therefore not available to "git clone").
      
      This behaviour caused problems when cloning a local non-bare repo with
      relative submodule URLs, because these submodule URLs would then be resolved
      against the DWIMmed URL (e.g. "/repo/.git") instead of the given URL (e.g.
      "/repo").
      
      This patch teaches "git clone" to use the _given_ URL - instead of the
      DWIMmed path - as the origin URL. This causes relative submodule URLs to be
      resolved correctly, as long the _given_ URL indicates the correct directory
      against which the submodule URLs should be resolved.
      
      The patch also updates a testcase that contained the old-style origin URLs.
      Signed-off-by: NJohan Herland <johan@herland.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      86521aca
  32. 08 8月, 2008 1 次提交