1. 26 10月, 2006 2 次提交
    • N
      make index-pack able to complete thin packs. · 636171cb
      Nicolas Pitre 提交于
      A new flag, --fix-thin, instructs git-index-pack to append any missing
      objects to a thin pack to make it self contained and indexable. Of course
      objects missing from the pack must be present elsewhere in the local
      repository.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      636171cb
    • N
      enable index-pack streaming capability · e42797f5
      Nicolas Pitre 提交于
      A new flag, --stdin, allows for a pack to be received over a stream.
      When this flag is provided, the pack content is written to either
      the named pack file or directly to the object repository under the
      same name as produced by git-repack.  The pack index is written as
      well with the corresponding base name, unless the index name is
      overriden with -o.
      
      With this patch, git-index-pack could be used instead of
      git-unpack-objects when fetching remote objects but only with
      non "thin" packs for now.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e42797f5
  2. 21 10月, 2006 1 次提交
    • N
      add the capability for index-pack to read from a stream · 2d477051
      Nicolas Pitre 提交于
      This patch only adds the streaming capability to index-pack.  Although
      the code is different it has the exact same functionality as before to
      make sure nothing broke.
      
      This is in preparation for receiving packs over the net, parse them on
      the fly, fix them up if they are "thin" packs, and keep the resulting
      pack instead of exploding it into loose objects.  But such functionality
      should come separately.
      
      One immediate advantage of this patch is that index-pack can now deal
      with packs up to 4GB in size even on 32-bit architectures since the pack
      is not entirely mmap()'d all at once anymore.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2d477051
  3. 19 10月, 2006 1 次提交
    • N
      index-pack: compare only the first 20-bytes of the key. · 3c552873
      Nicolas Pitre 提交于
      The "union delta_base" is a strange beast.  It is a 20-byte
      binary blob key to search a binary searchable deltas[] array,
      each element of which uses it to represent its base object with
      either a full 20-byte SHA-1 or an offset in the pack.  Which
      representation is used is determined by another field of the
      deltas[] array element, obj->type, so there is no room for
      confusion, as long as we make sure we compare the keys for the
      same type only with appropriate length.  The code compared the
      full union with memcmp().
      
      When storing the in-pack offset, the union was first cleared
      before storing an unsigned long, so comparison worked fine.
      
      On 64-bit architectures, however, the union typically is 24-byte
      long; the code did not clear the remaining 4-byte alignment
      padding when storing a full 20-byte SHA-1 representation.  Using
      memcmp() to compare the whole union was wrong.
      
      This fixes the comparison to look at the first 20-bytes of the
      union, regardless of the architecture.  As long as ulong is
      smaller than 20-bytes this works fine.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      3c552873
  4. 27 9月, 2006 2 次提交
    • N
      teach git-index-pack about deltas with offset to base · 53dda6ff
      Nicolas Pitre 提交于
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      53dda6ff
    • N
      introduce delta objects with offset to base · eb32d236
      Nicolas Pitre 提交于
      This adds a new object, namely OBJ_OFS_DELTA, renames OBJ_DELTA to
      OBJ_REF_DELTA to better make the distinction between those two delta
      objects, and adds support for the handling of those new delta objects
      in sha1_file.c only.
      
      The OBJ_OFS_DELTA contains a relative offset from the delta object's
      position in a pack instead of the 20-byte SHA1 reference to identify
      the base object.  Since the base is likely to be not so far away, the
      relative offset is more likely to have a smaller encoding on average
      than an absolute offset.  And for those delta objects the base must
      always be stored first because there is no way to know the distance of
      later objects when streaming a pack.  Hence this relative offset is
      always meant to be negative.
      
      The offset encoding is slightly denser than the one used for object
      size -- credits to <linux@horizon.com> (whoever this is) for bringing
      it to my attention.
      
      This allows for pack size reduction between 3.2% (Linux-2.6) to over 5%
      (linux-historic).  Runtime pack access should be faster too since delta
      replay does skip a search in the pack index for each delta in a chain.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      eb32d236
  5. 24 8月, 2006 1 次提交
    • S
      Convert memcpy(a,b,20) to hashcpy(a,b). · e702496e
      Shawn Pearce 提交于
      This abstracts away the size of the hash values when copying them
      from memory location to memory location, much as the introduction
      of hashcmp abstracted away hash value comparsion.
      
      A few call sites were using char* rather than unsigned char* so
      I added the cast rather than open hashcpy to be void*.  This is a
      reasonable tradeoff as most call sites already use unsigned char*
      and the existing hashcmp is also declared to be unsigned char*.
      
      [jc: Splitted the patch to "master" part, to be followed by a
       patch for merge-recursive.c which is not in "master" yet.
      
       Fixed the cast in the latter hunk to combine-diff.c which was
       wrong in the original.
      
       Also converted ones left-over in combine-diff.c, diff-lib.c and
       upload-pack.c ]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e702496e
  6. 18 8月, 2006 1 次提交
  7. 12 8月, 2006 1 次提交
    • R
      drop length argument of has_extension · 5bb1cda5
      Rene Scharfe 提交于
      As Fredrik points out the current interface of has_extension() is
      potentially confusing.  Its parameters include both a nul-terminated
      string and a length-limited string.
      
      This patch drops the length argument, requiring two nul-terminated
      strings; all callsites are updated.  I checked that all of them indeed
      provide nul-terminated strings.  Filenames need to be nul-terminated
      anyway if they are to be passed to open() etc.  The performance penalty
      of the additional strlen() is negligible compared to the system calls
      which inevitably surround has_extension() calls.
      
      Additionally, change has_extension() to use size_t inside instead of
      int, as that is the exact type strlen() returns and memcmp() expects.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5bb1cda5
  8. 11 8月, 2006 1 次提交
  9. 04 4月, 2006 1 次提交
  10. 10 2月, 2006 1 次提交
    • N
      remove delta-against-self bit · d60fc1c8
      Nicolas Pitre 提交于
      After experimenting with code to add the ability to encode a delta
      against part of the deltified file, it turns out that resulting packs
      are _bigger_ than when this ability is not used.  The raw delta output
      might be smaller, but it doesn't compress as well using gzip with a
      negative net saving on average.
      
      Said bit would in fact be more useful to allow for encoding the copying
      of chunks larger than 64KB providing more savings with large files.
      This will correspond to packs version 3.
      
      While the current code still produces packs version 2, it is made future
      proof so pack versions 2 and 3 are accepted.  Any pack version 2 are
      compatible with version 3 since the redefined bit was never used before.
      When enough time has passed, code to use that bit to produce version 3
      packs could be added.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d60fc1c8
  11. 27 12月, 2005 1 次提交
  12. 22 12月, 2005 1 次提交
  13. 13 10月, 2005 2 次提交
    • J
      Fix packname hash generation. · 84c8d8ae
      Junio C Hamano 提交于
      This changes the generation of hash packfiles have in their names, from
      "hash of object names as fed to us" to "hash of object names in the
      resulting pack, in the order they appear in the index file".  The new
      "git-index-pack" command is taught to output the computed hash value
      to its standard output.
      
      With this, we can store downloaded pack in a temporary file without
      knowing its final name, run git-index-pack to generate idx for it
      while finding out its final name, and then rename the pack and idx to
      their final names.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      84c8d8ae
    • S
      Add git-index-pack utility · 9cf6d335
      Sergey Vlasov 提交于
      git-index-pack builds a pack index file for an existing packed
      archive.  With this utility a packed archive which was transferred
      without the corresponding pack index can be added to objects/pack/
      without repacking.
      Signed-off-by: NSergey Vlasov <vsu@altlinux.ru>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9cf6d335