1. 13 9月, 2012 4 次提交
    • J
      Merge branch 'jc/dotdot-is-parent-directory' into maint-1.7.11 · eaff724b
      Junio C Hamano 提交于
      "git log .." errored out saying it is both rev range and a path when
      there is no disambiguating "--" is on the command line.  Update the
      command line parser to interpret ".." as a path in such a case.
      
      * jc/dotdot-is-parent-directory:
        specifying ranges: we did not mean to make ".." an empty set
      eaff724b
    • J
      Merge branch 'jc/maint-doc-checkout-b-always-takes-branch-name' into maint-1.7.11 · 1b8bc86b
      Junio C Hamano 提交于
      The synopsis said "checkout [-B branch]" to make it clear the
      branch name is a parameter to the option, but the heading for the
      option description was "-B::", not "-B branch::", making the
      documentation misleading.
      
      * jc/maint-doc-checkout-b-always-takes-branch-name:
        doc: "git checkout -b/-B/--orphan" always takes a branch name
      1b8bc86b
    • J
      Merge branch 'jk/maint-http-half-auth-push' into maint-1.7.11 · 7d9483c2
      Junio C Hamano 提交于
      Pushing to smart HTTP server with recent Git fails without having
      the username in the URL to force authentication, if the server is
      configured to allow GET anonymously, while requiring authentication
      for POST.
      
      * jk/maint-http-half-auth-push:
        http: prompt for credentials on failed POST
        http: factor out http error code handling
        t: test http access to "half-auth" repositories
        t: test basic smart-http authentication
        t/lib-httpd: recognize */smart/* repos as smart-http
        t/lib-httpd: only route auth/dumb to dumb repos
        t5550: factor out http auth setup
        t5550: put auth-required repo in auth/dumb
      7d9483c2
    • J
      Merge branch 'kk/maint-for-each-ref-multi-sort' into maint-1.7.11 · 92c830dd
      Junio C Hamano 提交于
      "git for-each-ref" did not honor multiple "--sort=<key>" arguments
      correctly.
      
      * kk/maint-for-each-ref-multi-sort:
        for-each-ref: Fix sort with multiple keys
        t6300: test sort with multiple keys
      92c830dd
  2. 12 9月, 2012 16 次提交
  3. 11 9月, 2012 8 次提交
  4. 28 8月, 2012 8 次提交
    • J
      http: prompt for credentials on failed POST · b81401c1
      Jeff King 提交于
      All of the smart-http GET requests go through the http_get_*
      functions, which will prompt for credentials and retry if we
      see an HTTP 401.
      
      POST requests, however, do not go through any central point.
      Moreover, it is difficult to retry in the general case; we
      cannot assume the request body fits in memory or is even
      seekable, and we don't know how much of it was consumed
      during the attempt.
      
      Most of the time, this is not a big deal; for both fetching
      and pushing, we make a GET request before doing any POSTs,
      so typically we figure out the credentials during the first
      request, then reuse them during the POST. However, some
      servers may allow a client to get the list of refs from
      receive-pack without authentication, and then require
      authentication when the client actually tries to POST the
      pack.
      
      This is not ideal, as the client may do a non-trivial amount
      of work to generate the pack (e.g., delta-compressing
      objects). However, for a long time it has been the
      recommended example configuration in git-http-backend(1) for
      setting up a repository with anonymous fetch and
      authenticated push. This setup has always been broken
      without putting a username into the URL. Prior to commit
      986bbc08, it did work with a username in the URL, because git
      would prompt for credentials before making any requests at
      all. However, post-986bbc08, it is totally broken. Since it
      has been advertised in the manpage for some time, we should
      make sure it works.
      
      Unfortunately, it is not as easy as simply calling post_rpc
      again when it fails, due to the input issue mentioned above.
      However, we can still make this specific case work by
      retrying in two specific instances:
      
        1. If the request is large (bigger than LARGE_PACKET_MAX),
           we will first send a probe request with a single flush
           packet. Since this request is static, we can freely
           retry it.
      
        2. If the request is small and we are not using gzip, then
           we have the whole thing in-core, and we can freely
           retry.
      
      That means we will not retry in some instances, including:
      
        1. If we are using gzip. However, we only do so when
           calling git-upload-pack, so it does not apply to
           pushes.
      
        2. If we have a large request, the probe succeeds, but
           then the real POST wants authentication. This is an
           extremely unlikely configuration and not worth worrying
           about.
      
      While it might be nice to cover those instances, doing so
      would be significantly more complex for very little
      real-world gain. In the long run, we will be much better off
      when curl learns to internally handle authentication as a
      callback, and we can cleanly handle all cases that way.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b81401c1
    • J
      http: factor out http error code handling · 88097030
      Jeff King 提交于
      Most of our http requests go through the http_request()
      interface, which does some nice post-processing on the
      results. In particular, it handles prompting for missing
      credentials as well as approving and rejecting valid or
      invalid credentials. Unfortunately, it only handles GET
      requests. Making it handle POSTs would be quite complex, so
      let's pull result handling code into its own function so
      that it can be reused from the POST code paths.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      88097030
    • J
      t: test http access to "half-auth" repositories · 4c71009d
      Jeff King 提交于
      Some sites set up http access to repositories such that
      fetching is anonymous and unauthenticated, but pushing is
      authenticated. While there are multiple ways to do this, the
      technique advertised in the git-http-backend manpage is to
      block access to locations matching "/git-receive-pack$".
      
      Let's emulate that advice in our test setup, which makes it
      clear that this advice does not actually work.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4c71009d
    • J
      t: test basic smart-http authentication · 6ac2b3ae
      Jeff King 提交于
      We do not currently test authentication over smart-http at
      all. In theory, it should work exactly as it does for dumb
      http (which we do test). It does indeed work for these
      simple tests, but this patch lays the groundwork for more
      complex tests in future patches.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6ac2b3ae
    • J
      t/lib-httpd: recognize */smart/* repos as smart-http · 666aae9a
      Jeff King 提交于
      We do not currently test authentication for smart-http repos
      at all. Part of the infrastructure to do this is recognizing
      that auth/smart is indeed a smart-http repo.
      
      The current apache config recognizes only "^/smart/*" as
      smart-http. Let's instead treat anything with /smart/ in the
      URL as smart-http. This is obviously a stupid thing to do
      for a real production site, but for our test suite we know
      that our repositories will not have this magic string in the
      name.
      
      Note that we will route /foo/smart/bar.git directly to
      git-http-backend/bar.git; in other words, everything before
      the "/smart/" is irrelevant to finding the repo on disk (but
      may impact apache config, for example by triggering auth
      checks).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      666aae9a
    • J
      t/lib-httpd: only route auth/dumb to dumb repos · 05b57710
      Jeff King 提交于
      Our test apache config points all of auth/ directly to the
      on-disk repositories via an Alias directive. This works fine
      because everything authenticated is currently in auth/dumb,
      which is a subset.  However, this would conflict with a
      ScriptAlias for auth/smart (which will come in future
      patches), so let's narrow the Alias.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      05b57710
    • J
      t5550: factor out http auth setup · e837936c
      Jeff King 提交于
      The t5550 script sets up a nice askpass helper for
      simulating user input and checking what git prompted for.
      Let's make it available to other http scripts by migrating
      it to lib-httpd.
      
      We can use this immediately in t5540 to make our tests more
      robust (previously, we did not check at all that hitting the
      password-protected repo actually involved a password).
      Unfortunately, we end up failing the test because the
      current code erroneously prompts twice (once for
      git-remote-http, and then again when the former spawns
      git-http-push).
      
      More importantly, though, it will let us easily add
      smart-http authentication tests in t5541 and t5551; we
      currently do not test smart-http authentication at all.
      
      As part of making it generic, let's always look for and
      store auxiliary askpass files at the top-level trash
      directory; this makes it compatible with t5540, which runs
      some tests from sub-repositories. We can abstract away the
      ugliness with a short helper function.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e837936c
    • J
      t5550: put auth-required repo in auth/dumb · 726800a8
      Jeff King 提交于
      In most of our tests, we put repos to be accessed by dumb
      protocols in /dumb, and repos to be accessed by smart
      protocols in /smart.  In our test apache setup, the whole
      /auth hierarchy requires authentication. However, we don't
      bother to split it by smart and dumb here because we are not
      currently testing smart-http authentication at all.
      
      That will change in future patches, so let's be explicit
      that we are interested in testing dumb access here. This
      also happens to match what t5540 does for the push tests.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      726800a8
  5. 27 8月, 2012 1 次提交
  6. 25 8月, 2012 3 次提交