1. 30 Dec, 2008 4 commits
    • Add some routines for SHA1 hash computation · 007e0753
      [sp: Changed signature for output to use git_oid, and added
           a test case to verify an allocated git_hash_ctx can be
           reinitialized and reused.]
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Ramsay Jones committed
    • Fix a bug in gitfo_read_file() · 42fd40db
      In particular, when asked to read an empty file, this function
      calls malloc() with a zero size allocation request. Standard C
      says that the behaviour of malloc() in this case is implementation
      defined.
      
      [C99, 7.20.3 says "... If the size of the space requested is zero,
      the behavior is implementation-defined: either a null pointer is
      returned, or the behavior is as if the size were some nonzero
      value, except that the returned pointer shall not be used to
      access an object."]
      
      Finesse the issue by over-allocating by one byte. Setting the extra
      byte to '\0' may also provide a useful sentinel for text files.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Ramsay Jones committed
    • Add pkg-config support. · d7fbfe15
      The libgit2.pc is generated on make install and installed, to allow
      using the lib through the pkg-config helper.
      
      Signed-off-by: Steve Frécinaux <code@istique.net>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Steve Frécinaux committed
    • Add make install and uninstall targets. · 5ddbd5ed
      It accepts a prefix= parameter (default: /usr/local).
      
      Signed-off-by: Steve Frécinaux <code@istique.net>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Steve Frécinaux committed
  2. 19 Dec, 2008 2 commits
    • Implement git_odb__read_loose() · 3d3552e8
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Ramsay Jones committed
    • Add a file reading routine along with an io buffer type · 75d58430
      In particular, the gitfo_read_file() routine can be used to slurp
      the complete file contents into an gitfo_buf structure. The buffer
      content will be allocated by malloc() and may be released by the
      gitfo_free_buf() routine. The io buffer type can be initialised
      on the stack with the GITFO_BUF_INIT macro.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Ramsay Jones committed
  3. 18 Dec, 2008 2 commits
  4. 10 Dec, 2008 1 commit
  5. 09 Dec, 2008 4 commits
  6. 02 Dec, 2008 15 commits
  7. 22 Nov, 2008 12 commits
    • Make using CFLAGS a bit simpler · ab3f234e
      This patch introduces the $(ALL_CFLAGS) variable, which holds
      $(BASIC_CFLAGS) as well as userdefined $(CFLAGS) and then
      consistently uses that variable where both were used anyway.
      
      Since we're in the area, we optimize the sparse running a
      bit, getting rid of the shell and just letting sparse iterate
      over the files.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • Add $(CONFIG_H) as a build-dependency for sparse · 6013ffa6
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • Make src/git/config.h a macro in Makefile · 21648b45
      This makes it far more convenient to reference as a dependency
      for other targets.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • Remove license top-comment from public header files · c6ebb4a9
      Since it's being added when we install the headers anyway,
      we might as well get rid of it. If anything, we should point
      coders to the COPYING file in the project's root directory
      instead of duplicating the same (large-ish) text everywhere.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • Add an embryo of a TLS-aware error handling system · ae234862
      This adds the per-thread global variable git_errno to the
      system, which callers can examine to get information about
      an error.
      
      Two helper functions are added to reduce LoC-count for the
      library code itself.
      
      Also, some exceptions are made for running sparse on GIT_TLS
      definitions, since it doesn't grok thread-local variables at
      all.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • Add util.h - utility macros · 3a2aabdc
      ARRAY_SIZE() et al go in util.h, included from common.h
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • Add internal common.h file · 76a8c447
      This one pulls in compiler compatibility macros, some
      common header files, and also the public common.h header.
      
      C source files are modified to use the private common.h
      in favour of the public one.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • Add cc-compat.h - C compiler compat macros for internal use · f501265f
      Holds things such as FLEX_ARRAY and whatnot.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • Rename git_revpool_* functions gitrp_* · c215be41
      Otherwise their prototypes don't match their declarations.
      
      Detected by 'sparse', which is obviously good to run
      before each commit.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • Add a 'sparse' make target · 3e1d42b7
      Given the confusion on git@vger, we'd better not name
      this target "check" or (worse) "test", but it's still
      useful to have. As "sparse", noone should have problems
      understanding what it does.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • s/COPYING/.HEADER/ for install-headers target · ff7c7576
      We don't want to prepend the entire license; Only the
      file header part of it.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
    • Get rid of GIT__PRIVATE macro · 4f0adcd0
      Using it in the first place means something's wrong.
      This patch replaces it with an internal header which
      carries the previously "protected" code instead.
      
      Internal source-files simply include "commit.h" and
      they're done. The internal header includes the public
      one to make sure we always use the proper prototype.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed