1. 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
  2. 20 7月, 2008 3 次提交
  3. 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
  4. 18 7月, 2008 3 次提交
  5. 17 7月, 2008 12 次提交
  6. 16 7月, 2008 2 次提交
  7. 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
  8. 14 7月, 2008 6 次提交
  9. 12 7月, 2008 4 次提交
    • J
      t0004: fix timing bug · 329636b4
      Junio C Hamano 提交于
      The test created an initial commit, made .git/objects unwritable and then
      exercised various codepaths to create loose commit, tree and blob objects
      to make sure the commands notice failures from these attempts.
      
      However, the initial commit was not preceded with test_tick, which made
      its object name depend on the timestamp.  The names of all the later tree
      and blob objects the test tried to create were static.  If the initial
      commit's object name happened to begin with the same two hexdigits as the
      tree or blob objects the test later attempted to create, the fan-out
      directory in which these tree or blob would be created is already created
      when the initial commit was made, and the object creation succeeds, and
      commands being tested should not notice any failure --- in short, the test
      was bogus.
      
      This makes the fan-out directories also unwritable, and adds test_tick
      before the commit object creation to make the test repeatable.
      
      The contents of the file to create a blob from "a" to "60" is to force the
      name of the blob object to begin with "1b", which shares the fan-out
      directory with the initial commit that is created with the test.  This was
      useful when diagnosing the breakage of this test.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      329636b4
    • J
      Add pretty format %aN which gives the author name, respecting .mailmap · e0cbc397
      Johannes Schindelin 提交于
      The pretty format %an does not respect .mailmap, but gives the exact
      author name recorded in the commit.  Sometimes it is more desirable,
      however, to look if the email has another name mapped to it in .mailmap.
      
      This commit adds %aN (and %cN for the committer name) to do exactly that.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e0cbc397
    • L
      b4958181
    • P
      Fix backwards-incompatible handling of core.sharedRepository · 8c6202d8
      Petr Baudis 提交于
      06cbe855 (Make core.sharedRepository more generic, 2008-04-16) broke the
      traditional setting of core.sharedRepository to true, which was to make
      the repository group writable: with umask 022, it would clear the
      permission bits for 'other'. (umask 002 did not exhibit this behaviour
      since pre-chmod() check in adjust_shared_perm() fails in that case.)
      
      The call to adjust_shared_perm() should only loosen the permission.
      If the user has umask like 022 or 002 that allow others to read, the
      resulting files should be made readable and writable by group, without
      restricting the readability by others.
      
      This patch fixes the adjust_shared_perm() mode tweak based on Junio's
      suggestion and adds the appropriate tests to t/t1301-shared-repo.sh.
      
      Cc: Heikki Orsila <heikki.orsila@iki.fi>
      Signed-off-by: NPetr Baudis <pasky@suse.cz>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8c6202d8
  10. 10 7月, 2008 1 次提交
    • S
      Correct pack memory leak causing git gc to try to exceed ulimit · eac12e2d
      Shawn O. Pearce 提交于
      When recursing to unpack a delta base we must unuse_pack() so that
      the pack window for the current object does not remain pinned in
      memory while the delta base is itself being unpacked and materialized
      for our use.
      
      On a long delta chain of 50 objects we may need to access 6 different
      windows from a very large (>3G) pack file in order to obtain all
      of the delta base content.  If the process ulimit permits us to
      map/allocate only 1.5G we must release windows during this recursion
      to ensure we stay within the ulimit and transition memory from pack
      cache to standard malloc, or other mmap needs.
      
      Inserting an unuse_pack() call prior to the recursion allows us to
      avoid pinning the current window, making it available for garbage
      collection if memory runs low.
      
      This has been broken since at least before 1.5.1-rc1, and very
      likely earlier than that.  Its fixed now.  :)
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      eac12e2d
  11. 09 7月, 2008 2 次提交