1. 17 10月, 2011 2 次提交
  2. 11 10月, 2011 3 次提交
  3. 06 10月, 2011 16 次提交
  4. 01 10月, 2011 1 次提交
  5. 27 9月, 2011 1 次提交
    • J
      Don't sort ref_list too early · b4f223c6
      Julian Phillips 提交于
      get_ref_dir is called recursively for subdirectories, which means that
      we were calling sort_ref_list for each directory of refs instead of
      once for all the refs.  This is a massive wast of processing, so now
      just call sort_ref_list on the result of the top-level get_ref_dir, so
      that the sort is only done once.
      
      In the common case of only a few different directories of refs the
      difference isn't very noticable, but it becomes very noticeable when
      you have a large number of direcotries containing refs (e.g. as
      created by Gerrit).
      
      Reported by Martin Fick.
      Signed-off-by: NJulian Phillips <julian@quantumfyre.co.uk>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b4f223c6
  6. 12 9月, 2011 1 次提交
  7. 28 8月, 2011 1 次提交
  8. 23 8月, 2011 1 次提交
  9. 15 8月, 2011 6 次提交
  10. 07 7月, 2011 2 次提交
    • J
      ref namespaces: infrastructure · a1bea2c1
      Josh Triplett 提交于
      Add support for dividing the refs of a single repository into multiple
      namespaces, each of which can have its own branches, tags, and HEAD.
      Git can expose each namespace as an independent repository to pull from
      and push to, while sharing the object store, and exposing all the refs
      to operations such as git-gc.
      
      Storing multiple repositories as namespaces of a single repository
      avoids storing duplicate copies of the same objects, such as when
      storing multiple branches of the same source.  The alternates mechanism
      provides similar support for avoiding duplicates, but alternates do not
      prevent duplication between new objects added to the repositories
      without ongoing maintenance, while namespaces do.
      
      To specify a namespace, set the GIT_NAMESPACE environment variable to
      the namespace.  For each ref namespace, git stores the corresponding
      refs in a directory under refs/namespaces/.  For example,
      GIT_NAMESPACE=foo will store refs under refs/namespaces/foo/.  You can
      also specify namespaces via the --namespace option to git.
      
      Note that namespaces which include a / will expand to a hierarchy of
      namespaces; for example, GIT_NAMESPACE=foo/bar will store refs under
      refs/namespaces/foo/refs/namespaces/bar/.  This makes paths in
      GIT_NAMESPACE behave hierarchically, so that cloning with
      GIT_NAMESPACE=foo/bar produces the same result as cloning with
      GIT_NAMESPACE=foo and cloning from that repo with GIT_NAMESPACE=bar.  It
      also avoids ambiguity with strange namespace paths such as
      foo/refs/heads/, which could otherwise generate directory/file conflicts
      within the refs directory.
      
      Add the infrastructure for ref namespaces: handle the GIT_NAMESPACE
      environment variable and --namespace option, and support iterating over
      refs in a namespace.
      Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NJamey Sharp <jamey@minilop.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a1bea2c1
    • J
      Fix prefix handling in ref iteration functions · b3cfc406
      Josh Triplett 提交于
      The do_for_each_ref iteration function accepts a prefix and a trim, and
      checks for the prefix on each ref before passing in that ref; it also
      supports trimming off part of the ref before passing it.  However,
      do_for_each_ref used trim as the length of the prefix to check, ignoring
      the actual length of the prefix.  Switch to using prefixcmp, checking
      the entire length of the prefix string, to properly support a trim value
      different than the length of the prefix.
      
      Several callers passed a prefix of "refs/" to filter out everything
      outside of refs/, but a trim of 0 to avoid trimming off the "refs/"; the
      trim of 0 meant that the filter of "refs/" no longer applied.  Change
      these callers to pass an empty prefix instead, to avoid changing the
      existing behavior.  Various callers count on this lack of filtering,
      such as receive-pack which uses add_extra_ref to add alternates as refs
      named ".have"; adding filtering would break that, causing
      t5501-fetch-push-alternates.sh to fail.  That lack of filtering doesn't
      currently have any other effect, since the loose ref functions can never
      supply refs outside of "refs/", and packed-refs will not normally
      include such refs unless manually edited.
      Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NJamey Sharp <jamey@minilop.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b3cfc406
  11. 17 6月, 2011 1 次提交
  12. 06 6月, 2011 1 次提交
    • J
      checkout -b <name>: correctly detect existing branch · c17b2294
      Junio C Hamano 提交于
      When create a new branch, we fed "refs/heads/<proposed name>" as a string
      to get_sha1() and expected it to fail when a branch already exists.
      
      The right way to check if a ref exists is to check with resolve_ref().
      
      A naïve solution that might appear attractive but does not work is to
      forbid slashes in get_describe_name() but that will not work. A describe
      name is is in the form of "ANYTHING-g<short sha1>", and that ANYTHING part
      comes from a original tag name used in the repository the user ran the
      describe command. A sick user could have a confusing hierarchical tag
      whose name is "refs/heads/foobar" (stored as refs/tags/refs/heads/foobar")
      to generate a describe name "refs/heads/foobar-6-g02ac9837", and we should
      be able to use that name to refer to the object whose name is 02ac9837.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c17b2294
  13. 08 7月, 2010 3 次提交
  14. 13 6月, 2010 1 次提交