1. 02 12月, 2012 1 次提交
  2. 29 10月, 2012 1 次提交
  3. 15 9月, 2012 1 次提交
  4. 31 3月, 2012 1 次提交
  5. 27 3月, 2012 1 次提交
    • J
      clean up struct ref's nonfastforward field · e339aa92
      Jeff King 提交于
      Each ref structure contains a "nonfastforward" field which
      is set during push to show whether the ref rewound history.
      Originally this was a single bit, but it was changed in
      f25950f3 (push: Provide situational hints for non-fast-forward
      errors) to an enum differentiating a non-ff of the current
      branch versus another branch.
      
      However, we never actually set the member according to the
      enum values, nor did we ever read it expecting anything but
      a boolean value. But we did use the side effect of declaring
      the enum constants to store those values in a totally
      different integer variable. The code as-is isn't buggy, but
      the enum declaration inside "struct ref" is somewhat
      misleading.
      
      Let's convert nonfastforward back into a single bit, and
      then define the NON_FF_* constants closer to where they
      would be used (they are returned via the "int *nonfastforward"
      parameter to transport_push, so we can define them there).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e339aa92
  6. 23 2月, 2012 1 次提交
    • F
      push: add '--prune' option · 6ddba5e2
      Felipe Contreras 提交于
      When pushing groups of refs to a remote, there is no simple way to remove
      old refs that still exist at the remote that is no longer updated from us.
      This will allow us to remove such refs from the remote.
      
      With this change, running this command
      
       $ git push --prune remote refs/heads/*:refs/remotes/laptop/*
      
      removes refs/remotes/laptop/foo from the remote if we do not have branch
      "foo" locally anymore.
      Signed-off-by: NFelipe Contreras <felipe.contreras@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6ddba5e2
  7. 21 8月, 2011 1 次提交
  8. 20 5月, 2011 1 次提交
    • J
      refactor refs_from_alternate_cb to allow passing extra data · 114a6a88
      Jeff King 提交于
      The foreach_alt_odb function triggers a callback for each
      alternate object db we have, with room for a single void
      pointer as data. Currently, we always call refs_from_alternate_cb
      as the callback function, and then pass another callback (to
      receive each ref individually) as the void pointer.
      
      This has two problems:
      
        1. C technically forbids stuffing a function pointer into
           a "void *". In practice, this probably doesn't matter
           on any architectures git runs on, but it never hurts to
           follow the letter of the law.
      
        2. There is no room for an extra data pointer. Indeed, the
           alternate_ref_fn that refs_from_alternate_cb calls
           takes a void* for data, but we always pass it NULL.
      
      Instead, let's properly stuff our function pointer into a
      data struct, which also leaves room for an extra
      caller-supplied data pointer. And to keep things simple for
      existing callers, let's make a for_each_alternate_ref
      function that takes care of creating the extra struct.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      114a6a88
  9. 18 3月, 2011 1 次提交
    • J
      refs_from_alternate: helper to use refs from alternates · 36cfda15
      Junio C Hamano 提交于
      The receiving end of "git push" advertises the objects that the repository
      itself does not use, but are at the tips of refs in other repositories
      whose object databases are used as alternates for it. This helps it avoid
      having to receive (and the pusher having to send) objects that are already
      available to the receiving repository via the alternates mechanism.
      
      Tweak the helper function that implements this feature, and move it to
      transport.[ch] for future reuse by other programs.
      
      The additional test demonstrates how this optimization is helping "git push",
      and "git fetch" is ignorant about it.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      Acked-by: NShawn O. Pearce <spearce@spearce.org>
      36cfda15
  10. 14 10月, 2010 1 次提交
  11. 25 2月, 2010 4 次提交
  12. 18 2月, 2010 1 次提交
  13. 17 2月, 2010 1 次提交
    • T
      transport: add got_remote_refs flag · b0d66e15
      Tay Ray Chuan 提交于
      transport_get_remote_refs() in tranport.c checks transport->remote_refs
      to determine whether transport->get_refs_list() should be invoked.  The
      logic is "if it is NULL, we haven't run ls-remote to find out yet".
      
      However, transport->remote_refs could still be NULL while cloning from
      an empty repository.  This causes get_refs_list() to be run unnecessarily.
      
      Introduce a flag, transport->got_remote_refs, to more explicitly record
      if we have run transport->get_refs_list() already.
      Signed-off-by: NTay Ray Chuan <rctay89@gmail.com>
      Acked-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b0d66e15
  14. 17 1月, 2010 1 次提交
  15. 29 12月, 2009 1 次提交
  16. 28 12月, 2009 1 次提交
  17. 10 12月, 2009 2 次提交
  18. 18 11月, 2009 1 次提交
  19. 31 10月, 2009 1 次提交
  20. 04 9月, 2009 1 次提交
  21. 13 8月, 2009 1 次提交
  22. 06 8月, 2009 2 次提交
  23. 28 6月, 2009 1 次提交
    • L
      add --porcelain option to git-push · 1965ff74
      Larry D'Anna 提交于
      If --porcelain is used git-push will produce machine-readable output.  The
      output status line for each ref will be tab-separated and sent to stdout instead
      of stderr.  The full symbolic names of the refs will be given.  For example
      
      $ git push --dry-run --porcelain master :foobar 2>/dev/null \
        | perl -pe 's/\t/ TAB /g'
      
      = TAB refs/heads/master:refs/heads/master TAB [up to date]
      - TAB :refs/heads/foobar TAB [deleted]
      Signed-off-by: NLarry D'Anna <larry@elder-gods.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1965ff74
  24. 21 4月, 2009 1 次提交
    • A
      fetch: Strip usernames from url's before storing them · 47abd85b
      Andreas Ericsson 提交于
      When pulling from a remote, the full URL including username
      is by default added to the commit message. Since it adds
      very little value but could be used by malicious people to
      glean valid usernames (with matching hostnames), we're far
      better off just stripping the username before storing the
      remote URL locally.
      
      Note that this patch has no lasting visible effect when
      "git pull" does not create a merge commit. It simply
      alters what gets written to .git/FETCH_HEAD, which is used
      by "git merge" to automagically create its messages.
      Signed-off-by: NAndreas Ericsson <ae@op5.se>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      47abd85b
  25. 10 3月, 2009 1 次提交
  26. 10 10月, 2008 1 次提交
  27. 05 5月, 2008 1 次提交
  28. 05 3月, 2008 1 次提交
    • S
      Teach git-fetch to exploit server side automatic tag following · 41fa7d2e
      Shawn O. Pearce 提交于
      If the remote peer upload-pack process supports the include-tag
      protocol extension then we can avoid running a second fetch cycle
      on the client side by letting the server send us the annotated tags
      along with the objects it is packing for us.  In the following graph
      we can now fetch both "tag1" and "tag2" on the same connection that
      we fetched "master" from the remote when we only have L available
      on the local side:
      
               T - tag1          S - tag2
              /                 /
         L - o ------ o ------ B
          \                     \
           \                     \
            origin/master         master
      
      The objects for "tag1" are implicitly downloaded without our direct
      knowledge.  The existing "quickfetch" optimization within git-fetch
      discovers that tag1 is complete after the first connection and does
      not open a second connection.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      41fa7d2e
  29. 12 11月, 2007 1 次提交
  30. 10 11月, 2007 1 次提交
  31. 03 11月, 2007 1 次提交
    • D
      Miscellaneous const changes and utilities · 4577370e
      Daniel Barkalow 提交于
      The list of remote refs in struct transport should be const, because
      builtin-fetch will get confused if it changes.
      
      The url in git_connect should be const (and work on a copy) instead of
      requiring the caller to copy it.
      
      match_refs doesn't modify the refspecs it gets.
      
      get_fetch_map and get_remote_ref don't change the list they get.
      
      Allow transport get_refs_list methods to modify the struct transport.
      
      Add a function to copy a list of refs, when a function needs a mutable
      copy of a const list.
      
      Add a function to check the type of a ref, as per the code in connect.c
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4577370e
  32. 03 10月, 2007 1 次提交
  33. 19 9月, 2007 3 次提交
    • S
      Ensure builtin-fetch honors {fetch,transfer}.unpackLimit · 50ab5fd3
      Shawn O. Pearce 提交于
      The only way to configure the unpacking limit is currently through
      the .git/config (or ~/.gitconfig) mechanism as we have no existing
      command line option interface to control this threshold on a per
      invocation basis.  This was intentional by design as the storage
      policy of the repository should be a repository-wide decision and
      should not be subject to variations made on individual command
      executions.
      
      Earlier builtin-fetch was bypassing the unpacking limit chosen by
      the user through the configuration file as it did not reread the
      configuration options through fetch_pack_config if we called the
      internal fetch_pack() API directly.  We now ensure we always run the
      config file through fetch_pack_config at least once in this process,
      thereby setting our unpackLimit properly.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      50ab5fd3
    • S
      Refactor struct transport_ops inlined into struct transport · 824d5776
      Shawn O. Pearce 提交于
      Aside from reducing the code by 20 lines this refactoring removes
      a level of indirection when trying to access the operations of a
      given transport "instance", making the code clearer and easier to
      follow.
      
      It also has the nice effect of giving us the benefits of C99 style
      struct initialization (namely ".fetch = X") without requiring that
      level of language support from our compiler.  We don't need to worry
      about new operation methods being added as they will now be NULL'd
      out automatically by the xcalloc() we use to create the new struct
      transport we supply to the caller.
      
      This pattern already exists in struct walker, so we already have
      a precedent for it in Git.  We also don't really need to worry
      about any sort of performance decreases that may occur as a result
      of filling out 4-8 op pointers when we make a "struct transport".
      The extra few CPU cycles this requires over filling in the "struct
      transport_ops" is killed by the time it will take Git to actually
      *use* one of those functions, as most transport operations are
      going over the wire or will be copying object data locally between
      two directories.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      824d5776
    • S
      Remove unnecessary 'fetch' argument from transport_get API · e5f4e214
      Shawn O. Pearce 提交于
      We don't actually need to know at the time of transport_get if the
      caller wants to fetch, push, or do both on the returned object.
      It is easier to just delay the initialization of the HTTP walker
      until we know we will need it by providing a CURL specific fetch
      function in the curl_transport that makes sure the walker instance
      is initialized before use.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e5f4e214