1. 02 8月, 2008 5 次提交
    • S
      Propagate -u/--upload-pack option of "git clone" to transport. · 31f4e768
      Steve Haslam 提交于
      The -u option to override the remote system's path to git-upload-pack was
      being ignored by "git clone"; caused by a missing call to
      transport_set_option to set TRANS_OPT_UPLOADPACK. Presumably this crept in
      when git-clone was converted from shell to C.
      Signed-off-by: NSteve Haslam <shaslam@lastminute.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      31f4e768
    • A
      Documentation: fix diff.external example · bbff8aaa
      Anders Melchiorsen 提交于
      The diff.external examples pass a flag to gnu-diff, but GNU diff
      does not follow the GIT_EXTERNAL_DIFF interface.
      Signed-off-by: NAnders Melchiorsen <mail@cup.kalibalik.dk>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bbff8aaa
    • J
      make sure parsed wildcard refspec ends with slash · b2a56276
      Junio C Hamano 提交于
      A wildcard refspec is internally parsed into a refspec structure with src
      and dst strings.  Many parts of the code assumed that these do not include
      the trailing "/*" when matching the wildcard pattern with an actual ref we
      see at the remote.  What this meant was that we needed to make sure not
      just that the prefix matched, and also that a slash followed the part that
      matched.
      
      But a codepath that scans the result from ls-remote and finds matching
      refs forgot to check the "matching part must be followed by a slash" rule.
      This resulted in "refs/heads/b1" from the remote side to mistakenly match
      the source side of "refs/heads/b/*:refs/remotes/b/*" refspec.
      
      Worse, the refspec crafted internally by "git-clone", and a hardcoded
      preparsed refspec that is used to implement "git-fetch --tags", violated
      this "parsed widcard refspec does not end with slash" rule; simply adding
      the "matching part must be followed by a slash" rule then would have
      broken codepaths that use these refspecs.
      
      This commit changes the rule to require a trailing slash to parsed
      wildcard refspecs.  IOW, "refs/heads/b/*:refs/remotes/b/*" is parsed as
      src = "refs/heads/b/" and dst = "refs/remotes/b/".  This allows us to
      simplify the matching logic because we only need to do a prefixcmp() to
      notice "refs/heads/b/one" matches and "refs/heads/b1" does not.
      Acked-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b2a56276
    • J
      init: handle empty "template" parameter · d65d2b2f
      Jeff King 提交于
      If a user passes "--template=", then our template parameter
      is blank. Unfortunately, copy_templates() assumes it has at
      least one character, and does all sorts of bad things like
      reading from template[-1] and then proceeding to link all of
      '/' into the .git directory.
      
      This patch just checks for that condition in copy_templates
      and aborts. As a side effect, this means that --template=
      now has the meaning "don't copy any templates."
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d65d2b2f
    • S
      builtin-revert.c: typofix · 1e5f7add
      Stephan Beyer 提交于
      Signed-off-by: NStephan Beyer <s-beyer@gmx.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1e5f7add
  2. 26 7月, 2008 4 次提交
  3. 24 7月, 2008 1 次提交
  4. 21 7月, 2008 1 次提交
    • J
      fix usage string for git grep · 2d9c5725
      Jonathan Nieder 提交于
      Without this patch, git-grep gives confusing usage information:
      
      	$ git grep --confused
      	usage: git grep <option>* <rev>* [-e] <pattern> [<path>...]
      	$ git grep HEAD pattern
      	fatal: ambiguous argument 'pattern': unknown revision or path no
      	t in the working tree.
      	Use '--' to separate paths from revisions
      
      So put <pattern> before the <rev>s, in accordance with actual correct
      usage.  While we're changing the usage string, we might as well include
      the "--" separating revisions and paths, too.
      Signed-off-by: NJonathan Nieder <jrnieder@uchicago.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2d9c5725
  5. 20 7月, 2008 3 次提交
  6. 19 7月, 2008 1 次提交
    • J
      Merge branch 'sp/maint-index-pack' into maint · fcf74dbf
      Junio C Hamano 提交于
      * sp/maint-index-pack:
        index-pack: Honor core.deltaBaseCacheLimit when resolving deltas
        index-pack: Track the object_entry that creates each base_data
        index-pack: Chain the struct base_data on the stack for traversal
        index-pack: Refactor base arguments of resolve_delta into a struct
      fcf74dbf
  7. 18 7月, 2008 3 次提交
  8. 17 7月, 2008 12 次提交
  9. 16 7月, 2008 2 次提交
  10. 15 7月, 2008 5 次提交
    • S
      index-pack: Honor core.deltaBaseCacheLimit when resolving deltas · 92392b4a
      Shawn O. Pearce 提交于
      If we are trying to resolve deltas for a long delta chain composed
      of multi-megabyte objects we can easily run into requiring 500M+
      of memory to hold each object in the chain on the call stack while
      we recurse into the dependent objects and resolve them.
      
      We now use a simple delta cache that discards objects near the
      bottom of the call stack first, as they are the most least recently
      used objects in this current delta chain.  If we recurse out of a
      chain we may find the base object is no longer available, as it was
      free'd to keep memory under the deltaBaseCacheLimit.  In such cases
      we must unpack the base object again, which will require recursing
      back to the root of the top of the delta chain as we released that
      root first.
      
      The astute reader will probably realize that we can still exceed
      the delta base cache limit, but this happens only if the most
      recent base plus the delta plus the inflated dependent sum up to
      more than the base cache limit.  Due to the way patch_delta is
      currently implemented we cannot operate in less memory anyway.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      92392b4a
    • S
      index-pack: Track the object_entry that creates each base_data · 03993e13
      Shawn O. Pearce 提交于
      If we free the data stored within a base_data we need the struct
      object_entry to get the data back again for use with another dependent
      delta.  Storing the object_entry* in base_data makes it simple to call
      get_data_from_pack() to recover the compressed information.
      
      This however means that we must add the missing base object to the end of
      our packfile prior to calling resolve_delta() on each of the dependent
      deltas.  Adding the base first ensures we can read the base back from the
      pack we are indexing, as if it had been included by the remote side.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      03993e13
    • S
      index-pack: Chain the struct base_data on the stack for traversal · 4a438cab
      Shawn O. Pearce 提交于
      We need to release earlier inflated base objects when memory gets
      low, which means we need to be able to walk up or down the stack
      to locate the objects we want to release, and free their data.
      
      The new link/unlink routines allow inserting and removing the struct
      base_data during recursion inside resolve_delta, and the global
      base_cache gives us the head of the chain (bottom of the stack)
      so we can traverse it.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4a438cab
    • S
      index-pack: Refactor base arguments of resolve_delta into a struct · f41aebd4
      Shawn O. Pearce 提交于
      We need to discard base objects which are not recently used if our
      memory gets low, such as when we are unpacking a long delta chain
      of a very large object.
      
      To support tracking the available base objects we combine the
      pointer and size into a struct.  Future changes would allow the
      data pointer to be free'd and marked NULL if memory gets low.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f41aebd4
    • S
      bash completion: Resolve git show ref:path<tab> losing ref: portion · db8a9ff0
      Shawn O. Pearce 提交于
      Linus reported that the bash completion for git show often dropped
      the ref portion of the argument (stuff before the :) when trying
      to complete a file name of a file in another branch or tag.
      
      Björn Steinbrink tracked it down to the gvfs completion script
      which comes standard on many Fedora Core based systems.  That is
      removing : from COMP_WORDBREAKS, making readline treat the entire
      argument (including the ref) as the name that must be completed.
      When the git completion routines supplied a completion of just the
      filename, readline replaced everything.
      
      Since Git users often need to use "ref:path" or "ref:ref" sort of
      arguments, and expect completion support on both sides of the :
      we really want the : in COMP_WORDBREAKS to provide a good user
      experience.  This is also the default that ships with bash as it
      can be useful in other contexts, such as rcp/scp.
      
      We now try to add : back to COMP_WORDBREAKS if it has been removed
      by a script that loaded before us.  However if this doesn't work
      (as the : is stripped after we load) we fallback in the completion
      routines to include "ref:" as part of the prefix for completions,
      allowing readine to fully insert the argument the user wanted.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      db8a9ff0
  11. 14 7月, 2008 3 次提交