1. 21 Sep, 2006 2 commits
    • Junio C Hamano's avatar
      Tell between packed, unpacked and symbolic refs. · 8da19775
      Junio C Hamano authored
      This adds a "int *flag" parameter to resolve_ref() and makes
      for_each_ref() family to call callback function with an extra
      "int flag" parameter.  They are used to give two bits of
      information (REF_ISSYMREF and REF_ISPACKED) about the ref.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
    • Junio C Hamano's avatar
      Add callback data to for_each_ref() family. · cb5d709f
      Junio C Hamano authored
      This is a long overdue fix to the API for for_each_ref() family
      of functions.  It allows the callers to specify a callback data
      pointer, so that the caller does not have to use static
      variables to communicate with the callback funciton.
      The updated for_each_ref() family takes a function of type
      	int (*fn)(const char *, const unsigned char *, void *)
      and a void pointer as parameters, and calls the function with
      the name of the ref and its SHA-1 with the caller-supplied void
      pointer as parameters.
      The commit updates two callers, builtin-name-rev.c and
      builtin-pack-refs.c as an example.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  2. 02 Sep, 2006 1 commit
    • Shawn Pearce's avatar
      Replace uses of strdup with xstrdup. · 9befac47
      Shawn Pearce authored
      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: default avatarShawn O. Pearce <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  3. 13 Jul, 2006 1 commit
  4. 09 Jul, 2006 1 commit
  5. 18 Jun, 2006 1 commit
    • Linus Torvalds's avatar
      Shrink "struct object" a bit · 885a86ab
      Linus Torvalds authored
      This shrinks "struct object" by a small amount, by getting rid of the
      "struct type *" pointer and replacing it with a 3-bit bitfield instead.
      In addition, we merge the bitfields and the "flags" field, which
      incidentally should also remove a useless 4-byte padding from the object
      when in 64-bit mode.
      Now, our "struct object" is still too damn large, but it's now less
      obviously bloated, and of the remaining fields, only the "util" (which is
      not used by most things) is clearly something that should be eventually
      This shrinks the "git-rev-list --all" memory use by about 2.5% on the
      kernel archive (and, perhaps more importantly, on the larger mozilla
      archive). That may not sound like much, but I suspect it's more on a
      64-bit platform.
      There are other remaining inefficiencies (the parent lists, for example,
      probably have horrible malloc overhead), but this was pretty obvious.
      Most of the patch is just changing the comparison of the "type" pointer
      from one of the constant string pointers to the appropriate new TYPE_xxx
      small integer constant.
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  6. 21 Dec, 2005 2 commits
  7. 09 Dec, 2005 1 commit
  8. 05 Dec, 2005 5 commits
  9. 17 Nov, 2005 1 commit
  10. 15 Nov, 2005 1 commit
    • Sergey Vlasov's avatar
      Rework object refs tracking to reduce memory usage · 4a4e6fd7
      Sergey Vlasov authored
      Store pointers to referenced objects in a variable sized array instead
      of linked list.  This cuts down memory usage of utilities which use
      object references; e.g., git-fsck-objects --full on the git.git
      repository consumes about 2 MB of memory tracked by Massif instead of
      7 MB before the change.  Object refs are still the biggest consumer of
      memory (57%), but the malloc overhead for a single block instead of a
      linked list is substantially smaller.
      Signed-off-by: default avatarSergey Vlasov <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  11. 03 Nov, 2005 1 commit
  12. 15 Oct, 2005 1 commit
    • Junio C Hamano's avatar
      Show peeled onion from upload-pack and server-info. · f6b42a81
      Junio C Hamano authored
      This updates git-ls-remote to show SHA1 names of objects that are
      referred by tags, in the "ref^{}" notation.
      This would make git-findtags (without -t flag) almost trivial.
          git-peek-remote . |
          sed -ne "s:^$target	"'refs/tags/\(.*\)^{}$:\1:p'
      Also Pasky could do:
          git-ls-remote --tags $remote |
          sed -ne 's:\(	refs/tags/.*\)^{}$:\1:p'
      to find out what object each of the remote tags refers to, and
      if he has one locally, run "git-fetch $remote tag $tagname" to
      automatically catch up with the upstream tags.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  13. 08 Oct, 2005 1 commit
  14. 15 Sep, 2005 2 commits
  15. 29 Aug, 2005 1 commit
    • Junio C Hamano's avatar
      Revert "Replace zero-length array decls with []." · 2c04662d
      Junio C Hamano authored
      This reverts 6c5f9baa commit, whose
      change breaks gcc-2.95.
      Not that I ignore portability to compilers that are properly C99, but
      keeping compilation with GCC working is more important, at least for
      now.  We would probably end up declaring with "name[1]" and teach the
      allocator to subtract one if we really aimed for portability, but that
      is left for later rounds.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  16. 24 Aug, 2005 1 commit
  17. 01 Aug, 2005 1 commit
  18. 29 Jul, 2005 1 commit
  19. 24 Jul, 2005 1 commit
    • Junio C Hamano's avatar
      [PATCH] Add update-server-info. · 8f3f9b09
      Junio C Hamano authored
      The git-update-server-info command prepares informational files
      to help clients discover the contents of a repository, and pull
      from it via a dumb transport protocols.  Currently, the
      following files are produced.
       - The $repo/info/refs file lists the name of heads and tags
         available in the $repo/refs/ directory, along with their
         SHA1.  This can be used by git-ls-remote command running on
         the client side.
       - The $repo/info/rev-cache file describes the commit ancestry
         reachable from references in the $repo/refs/ directory.  This
         file is in an append-only binary format to make the server
         side friendly to rsync mirroring scheme, and can be read by
         git-show-rev-cache command.
       - The $repo/objects/info/pack file lists the name of the packs
         available, the interdependencies among them, and the head
         commits and tags contained in them.  Along with the other two
         files, this is designed to help clients to make smart pull
      The git-receive-pack command is changed to invoke it at the end,
      so just after a push to a public repository finishes via "git
      push", the server info is automatically updated.
      In addition, building of the rev-cache file can be done by a
      standalone git-build-rev-cache command separately.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      Signed-off-by: default avatarLinus Torvalds <[email protected]>