1. 01 11月, 2006 1 次提交
  2. 19 10月, 2006 1 次提交
  3. 16 10月, 2006 2 次提交
  4. 15 10月, 2006 2 次提交
  5. 23 9月, 2006 1 次提交
    • N
      many cleanups to sha1_file.c · 43057304
      Nicolas Pitre 提交于
      Those cleanups are mainly to set the table for the support of deltas
      with base objects referenced by offsets instead of sha1.  This means
      that many pack lookup functions are converted to take a pack/offset
      tuple instead of a sha1.
      
      This eliminates many struct pack_entry usages since this structure
      carried redundent information in many cases, and it increased stack
      footprint needlessly for a couple recursively called functions that used
      to declare a local copy of it for every recursion loop.
      
      In the process, packed_object_info_detail() has been reorganized as well
      so to look much saner and more amenable to deltas with offset support.
      
      Finally the appropriate adjustments have been made to functions that
      depend on the above changes.  But there is no functionality changes yet
      simply some code refactoring at this point.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      43057304
  6. 21 9月, 2006 1 次提交
  7. 10 9月, 2006 1 次提交
  8. 07 9月, 2006 1 次提交
    • J
      pack-objects --unpacked=<existing pack> option. · 106d710b
      Junio C Hamano 提交于
      Incremental repack without -a essentially boils down to:
      
      	rev-list --objects --unpacked --all |
              pack-objects $new_pack
      
      which picks up all loose objects that are still live and creates
      a new pack.
      
      This implements --unpacked=<existing pack> option to tell the
      revision walking machinery to pretend as if objects in such a
      pack are unpacked for the purpose of object listing.  With this,
      we could say:
      
      	rev-list --objects --unpacked=$active_pack --all |
      	pack-objects $new_pack
      
      instead, to mean "all live loose objects but pretend as if
      objects that are in this pack are also unpacked".  The newly
      created pack would be perfect for updating $active_pack by
      replacing it.
      
      Since pack-objects now knows how to do the rev-list's work
      itself internally, you can also write the above example by:
      
      	pack-objects --unpacked=$active_pack --all $new_pack </dev/null
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      106d710b
  9. 04 9月, 2006 1 次提交
    • J
      more lightweight revalidation while reusing deflated stream in packing · 72518e9c
      Junio C Hamano 提交于
      When copying from an existing pack and when copying from a loose
      object with new style header, the code makes sure that the piece
      we are going to copy out inflates well and inflate() consumes
      the data in full while doing so.
      
      The check to see if the xdelta really apply is quite expensive
      as you described, because you would need to have the image of
      the base object which can be represented as a delta against
      something else.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      72518e9c
  10. 03 9月, 2006 1 次提交
  11. 02 9月, 2006 2 次提交
    • S
      Replace uses of strdup with xstrdup. · 9befac47
      Shawn Pearce 提交于
      Like xmalloc and xrealloc xstrdup dies with a useful message if
      the native strdup() implementation returns NULL rather than a
      valid pointer.
      
      I just tried to use xstrdup in new code and found it to be missing.
      However I expected it to be present as xmalloc and xrealloc are
      already commonly used throughout the code.
      
      [jc: removed the part that deals with last_XXX, which I am
       finding more and more dubious these days.]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9befac47
    • J
      consolidate two copies of new style object header parsing code. · ad1ed5ee
      Junio C Hamano 提交于
      Also while we are at it, remove redundant typename[] array from
      unpack_sha1_header.  The only reason it is different from the
      type_names[] array in object.c module is that this code cares
      about the subset of object types that are valid in a loose
      object, so prepare a separate array of boolean that tells us
      which types are valid, and share the name translation with the
      others.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ad1ed5ee
  12. 01 9月, 2006 2 次提交
  13. 27 8月, 2006 6 次提交
  14. 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
  15. 22 8月, 2006 2 次提交
  16. 18 8月, 2006 1 次提交
  17. 16 8月, 2006 1 次提交
  18. 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
  19. 11 8月, 2006 1 次提交
  20. 26 7月, 2006 1 次提交
  21. 14 7月, 2006 1 次提交
    • L
      sha1_file: add the ability to parse objects in "pack file format" · 93821bd9
      Linus Torvalds 提交于
      The pack-file format is slightly different from the traditional git
      object format, in that it has a much denser binary header encoding.
      The traditional format uses an ASCII string with type and length
      information, which is somewhat wasteful.
      
      A new object format starts with uncompressed binary header
      followed by compressed payload -- this will allow us later to
      copy the payload straight to packfiles.
      
      Obviously they cannot be read by older versions of git, so for
      now new object files are created with the traditional format.
      core.legacyheaders configuration item, when set to false makes
      the code write in new format for people to experiment with.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      93821bd9
  22. 13 7月, 2006 1 次提交
    • S
      Make lazy mkdir more robust. · 756aaf4a
      Shawn Pearce 提交于
      Linus Torvalds <torvalds@osdl.org> wrote:
      
        It's entirely possible that we should just make that whole
      
      	  if (ret == ENOENT)
      
        go away. Yes, it's the right error code if a subdirectory is missing, and
        yes, POSIX requires it, and yes, WXP is probably just a horrible piece of
        sh*t, but on the other hand, I don't think git really has any serious
        reason to even care.
      756aaf4a
  23. 12 7月, 2006 1 次提交
  24. 10 7月, 2006 2 次提交
  25. 09 7月, 2006 1 次提交
    • P
      Make it possible to set up libgit directly (instead of from the environment) · 0270083d
      Petr Baudis 提交于
      This introduces a setup_git() function which is essentialy a (public)
      backend for setup_git_env() which lets anyone specify custom sources
      for the various paths instead of environment variables. Since the repositories
      may get switched on the fly, this also updates code that caches paths to
      invalidate them properly; I hope neither of those is a sweet spot.
      
      It is used by Git.xs' xs__call_gate() to set up per-repository data
      for libgit's consumption. No code actually takes advantage of it yet
      but get_object() will in the next patches.
      Signed-off-by: NPetr Baudis <pasky@suse.cz>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0270083d
  26. 04 7月, 2006 1 次提交
    • J
      Make zlib compression level configurable, and change default. · 12f6c308
      Joachim B Haga 提交于
      With the change in default, "git add ." on kernel dir is about
      twice as fast as before, with only minimal (0.5%) change in
      object size. The speed difference is even more noticeable
      when committing large files, which is now up to 8 times faster.
      
      The configurability is through setting core.compression = [-1..9]
      which maps to the zlib constants; -1 is the default, 0 is no
      compression, and 1..9 are various speed/size tradeoffs, 9
      being slowest.
      
      Signed-off-by: Joachim B Haga (cjhaga@fys.uio.no)
      Acked-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      12f6c308
  27. 28 6月, 2006 1 次提交
  28. 20 6月, 2006 1 次提交
  29. 10 6月, 2006 1 次提交
    • J
      shared repository - add a few missing calls to adjust_shared_perm(). · 138086a7
      Junio C Hamano 提交于
      There were a few calls to adjust_shared_perm() that were
      missing:
      
       - init-db creates refs, refs/heads, and refs/tags before
         reading from templates that could specify sharedrepository in
         the config file;
      
       - updating config file created it under user's umask without
         adjusting;
      
       - updating refs created it under user's umask without
         adjusting;
      
       - switching branches created .git/HEAD under user's umask
         without adjusting.
      
      This moves adjust_shared_perm() from sha1_file.c to path.c,
      since a few SIMPLE_PROGRAM need to call repository configuration
      functions which in turn need to call adjust_shared_perm().
      sha1_file.c needs to link with SHA1 computation library which
      is usually not linked to SIMPLE_PROGRAM.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      138086a7