1. 17 11月, 2016 1 次提交
  2. 23 10月, 2016 1 次提交
  3. 22 10月, 2016 2 次提交
    • J
      transport: allow summary-width to be computed dynamically · 11fd66de
      Junio C Hamano 提交于
      Now we have identified three callchains that have a set of refs that
      they want to show their <old, new> object names in an aligned output,
      we can replace their reference to the constant TRANSPORT_SUMMARY_WIDTH
      with a helper function call to transport_summary_width() that takes
      the set of ref as a parameter.  This step does not yet iterate over
      the refs and compute, which is left as an exercise to the readers.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      11fd66de
    • J
      transport: pass summary_width down the callchain · 7101e10c
      Junio C Hamano 提交于
      The callchain that originates at transport_print_push_status()
      eventually hits a single leaf function, print_ref_status(), that is
      used to show from what old object to what new object a ref got
      updated, and the width of the part that shows old and new object
      names used a constant TRANSPORT_SUMMARY_WIDTH.
      
      Teach the callchain to pass the width down from the top instead.
      This allows a future enhancement to compute the necessary display
      width before calling down this callchain.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7101e10c
  4. 11 10月, 2016 1 次提交
    • J
      alternates: use a separate scratch space · 597f9134
      Jeff King 提交于
      The alternate_object_database struct uses a single buffer
      both for storing the path to the alternate, and as a scratch
      buffer for forming object names. This is efficient (since
      otherwise we'd end up storing the path twice), but it makes
      life hard for callers who just want to know the path to the
      alternate. They have to remember to stop reading after
      "alt->name - alt->base" bytes, and to subtract one for the
      trailing '/'.
      
      It would be much simpler if they could simply access a
      NUL-terminated path string. We could encapsulate this in a
      function which puts a NUL in the scratch buffer and returns
      the string, but that opens up questions about the lifetime
      of the result. The first time another caller uses the
      alternate, the scratch buffer may get other data tacked onto
      it.
      
      Let's instead just store the root path separately from the
      scratch buffer. There aren't enough alternates being stored
      for the duplicated data to matter for performance, and this
      keeps things simple and safe for the callers.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      597f9134
  5. 09 9月, 2016 1 次提交
  6. 07 8月, 2016 1 次提交
  7. 27 7月, 2016 1 次提交
  8. 15 7月, 2016 2 次提交
    • S
      push: accept push options · f6a4e61f
      Stefan Beller 提交于
      This implements everything that is required on the client side to make use
      of push options from the porcelain push command.
      Signed-off-by: NStefan Beller <sbeller@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f6a4e61f
    • J
      push: anonymize URL in status output · 882d49ca
      Jeff King 提交于
      Commit 47abd85b (fetch: Strip usernames from url's before
      storing them, 2009-04-17) taught fetch to anonymize URLs.
      The primary purpose there was to avoid sticking passwords in
      merge-commit messages, but as a side effect, we also avoid
      printing them to stderr.
      
      The push side does not have the merge-commit problem, but it
      probably should avoid printing them to stderr. We can reuse
      the same anonymizing function.
      
      Note that for this to come up, the credentials would have to
      appear either on the command line or in a git config file,
      neither of which is particularly secure. So people _should_
      be switching to using credential helpers instead, which
      makes this problem go away. But that's no excuse not to
      improve the situation for people who for whatever reason end
      up using credentials embedded in the URL.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      882d49ca
  9. 18 6月, 2016 1 次提交
  10. 14 6月, 2016 3 次提交
  11. 10 3月, 2016 1 次提交
  12. 23 2月, 2016 2 次提交
  13. 13 2月, 2016 1 次提交
  14. 02 2月, 2016 1 次提交
  15. 29 1月, 2016 1 次提交
    • E
      pass transport verbosity down to git_connect · f3ee9ca5
      Eric Wong 提交于
      While working in connect.c to perform non-blocking connections,
      I noticed calling "git fetch -v" was not causing the progress
      messages inside git_tcp_connect_sock to be emitted as I
      expected.
      
      Looking at history, it seems connect_setup has never been called
      with the verbose parameter.  Since transport already has a
      "verbose" field, use that field instead of another parameter
      in connect_setup.
      Signed-off-by: NEric Wong <normalperson@yhbt.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f3ee9ca5
  16. 20 11月, 2015 1 次提交
  17. 16 11月, 2015 1 次提交
  18. 06 10月, 2015 1 次提交
    • J
      transport: use strbufs for status table "quickref" strings · bd22d4ff
      Jeff King 提交于
      We generate range strings like "1234abcd...5678efab" for use
      in the the fetch and push status tables. We use fixed-size
      buffers along with strcat to do so. These aren't buggy, as
      our manual size computation is correct, but there's nothing
      checking that this is so.  Let's switch them to strbufs
      instead, which are obviously correct, and make it easier to
      audit the code base for problematic calls to strcat().
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bd22d4ff
  19. 26 9月, 2015 1 次提交
  20. 24 9月, 2015 1 次提交
    • J
      transport: add a protocol-whitelist environment variable · a5adaced
      Jeff King 提交于
      If we are cloning an untrusted remote repository into a
      sandbox, we may also want to fetch remote submodules in
      order to get the complete view as intended by the other
      side. However, that opens us up to attacks where a malicious
      user gets us to clone something they would not otherwise
      have access to (this is not necessarily a problem by itself,
      but we may then act on the cloned contents in a way that
      exposes them to the attacker).
      
      Ideally such a setup would sandbox git entirely away from
      high-value items, but this is not always practical or easy
      to set up (e.g., OS network controls may block multiple
      protocols, and we would want to enable some but not others).
      
      We can help this case by providing a way to restrict
      particular protocols. We use a whitelist in the environment.
      This is more annoying to set up than a blacklist, but
      defaults to safety if the set of protocols git supports
      grows). If no whitelist is specified, we continue to default
      to allowing all protocols (this is an "unsafe" default, but
      since the minority of users will want this sandboxing
      effect, it is the only sensible one).
      
      A note on the tests: ideally these would all be in a single
      test file, but the git-daemon and httpd test infrastructure
      is an all-or-nothing proposition rather than a test-by-test
      prerequisite. By putting them all together, we would be
      unable to test the file-local code on machines without
      apache.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a5adaced
  21. 26 8月, 2015 1 次提交
  22. 25 8月, 2015 1 次提交
    • J
      write_file(): drop "fatal" parameter · 12d6ce1d
      Junio C Hamano 提交于
      All callers except three passed 1 for the "fatal" parameter to ask
      this function to die upon error, but to a casual reader of the code,
      it was not all obvious what that 1 meant.  Instead, split the
      function into two based on a common write_file_v() that takes the
      flag, introduce write_file_gently() as a new way to attempt creating
      a file without dying on error, and make three callers to call it.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      12d6ce1d
  23. 20 8月, 2015 2 次提交
  24. 26 5月, 2015 3 次提交
  25. 20 3月, 2015 1 次提交
  26. 11 3月, 2015 1 次提交
  27. 08 1月, 2015 2 次提交
    • R
      push.c: add an --atomic argument · d0e8e09c
      Ronnie Sahlberg 提交于
      Add a command line argument to the git push command to request atomic
      pushes.
      Signed-off-by: NRonnie Sahlberg <sahlberg@google.com>
      Signed-off-by: NStefan Beller <sbeller@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d0e8e09c
    • R
      send-pack.c: add --atomic command line argument · 4ff17f10
      Ronnie Sahlberg 提交于
      This adds support to send-pack to negotiate and use atomic pushes
      iff the server supports it. Atomic pushes are activated by a new command
      line flag --atomic.
      
      In order to do this we also need to change the semantics for send_pack()
      slightly. The existing send_pack() function actually doesn't send all the
      refs back to the server when multiple refs are involved, for example
      when using --all. Several of the failure modes for pushes can already be
      detected locally in the send_pack client based on the information from the
      initial server side list of all the refs as generated by receive-pack.
      Any such refs that we thus know would fail to push are thus pruned from
      the list of refs we send to the server to update.
      
      For atomic pushes, we have to deal thus with both failures that are detected
      locally as well as failures that are reported back from the server. In order
      to do so we treat all local failures as push failures too.
      
      We introduce a new status code REF_STATUS_ATOMIC_PUSH_FAILED so we can
      flag all refs that we would normally have tried to push to the server
      but we did not due to local failures. This is to improve the error message
      back to the end user to flag that "these refs failed to update since the
      atomic push operation failed."
      Signed-off-by: NRonnie Sahlberg <sahlberg@google.com>
      Signed-off-by: NStefan Beller <sbeller@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4ff17f10
  28. 30 12月, 2014 1 次提交
  29. 02 12月, 2014 1 次提交
  30. 22 10月, 2014 1 次提交
  31. 16 10月, 2014 1 次提交