1. 09 Feb, 2011 3 commits
    • Internal changes on the backend system · d4b5a4e2
      The priority value for different backends has been removed from the
      public `git_odb_backend` struct. We handle that internally. The priority
      value is specified on the `git_odb_add_alternate`.
      
      This is convenient because it allows us to poll a backend twice with
      different priorities without having to instantiate it twice.
      
      We also differentiate between main backends and alternates; alternates have
      lower priority and cannot be written to.
      
      These changes come with some unit tests to make sure that the backend
      sorting is consistent.
      
      The libgit2 version has been bumped to 0.4.0.
      
      This commit changes the external API:
      
      CHANGED:
      	struct git_odb_backend
      		No longer has a `priority` attribute; priority for the backend
      		in managed internally by the library.
      
      	git_odb_add_backend(git_odb *odb, git_odb_backend *backend, int priority)
      		Now takes an additional priority parameter, the priority that
      		will be given to the backend.
      
      ADDED:
      	git_odb_add_alternate(git_odb *odb, git_odb_backend *backend, int priority)
      		Add a backend as an alternate. Alternate backends have always
      		lower priority than main backends, and writing is disabled on
      		them.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Honor alternate entries in the ODB · 5a800efc
      The alternates file is now parsed, and the alternate ODB folders are
      added as separate backends. This allows the library to efficiently query
      the alternate folders.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Use the new git__joinpath to build paths in methods · 995f9c34
      The `git__joinpath` function has been changed to use a statically
      allocated buffer; we assume the buffer to be 4096 bytes, because fuck
      you.
      
      The new method also supports an arbritrary number of paths to join,
      which may come in handy in the future.
      
      Some methods which were manually joining paths with `strcpy` now use the
      new function, namely those in `index.c` and `refs.c`.
      
      Based on Emeric Fermas' original patch, which was using the old
      `git__joinpath` because I'm stupid. Thanks!
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  2. 08 Feb, 2011 2 commits
  3. 07 Feb, 2011 13 commits
  4. 06 Feb, 2011 2 commits
  5. 05 Feb, 2011 12 commits
  6. 03 Feb, 2011 1 commit
    • Use Git's own tree entry sorting algorithm · 35786cb7
      If plain strcmp is used, as this code did before, the final sorting may
      end up different from what git-add would do (for example, 'boost'
      appearing before 'boost-build.jam', because Git sorts as if it were
      spelled 'boost/').
      
      If the sorting is incorrect like this, Git 1.7.4 insists that unmodified
      files have been modified.  For example, my test repository has these
      four entries:
      
      drwxr-xr-x  199 johnw  wheel   6766 Feb  2 17:21 boost
      -rw-r--r--    1 johnw  wheel    849 Feb  2 17:22 boost-build.jam
      -rw-r--r--    1 johnw  wheel    989 Feb  2 17:21 boost.css
      -rw-r--r--    1 johnw  wheel   6308 Feb  2 17:21 boost.png
      
      Here is the output from git-ls-tree for these files, in a commit tree
      created using git-add and git-commit:
      
      100644 blob 8b8775433aef73e9e12609610ae2e35cf1e7ec2c    boost-build.jam
      100644 blob 986c4050fa96d825a1311c8e871cdcc9a3e0d2c3    boost.css
      100644 blob b4d51fcd5c9149fd77f5ca6ed2b6b1b70e8fe24f    boost.png
      040000 tree 46537eeaa4d577010f19b1c9e940cae9a670ff5c    boost
      
      Here is the output for the same commit produced using libgit2:
      
      040000 tree c27c0fd1436f28a6ba99acd0a6c17d178ed58288	boost
      100644 blob 8b8775433aef73e9e12609610ae2e35cf1e7ec2c	boost-build.jam
      100644 blob 986c4050fa96d825a1311c8e871cdcc9a3e0d2c3	boost.css
      100644 blob b4d51fcd5c9149fd77f5ca6ed2b6b1b70e8fe24f	boost.png
      
      Due to this reordering, git-status claims the three blobs are always
      modified, no matter what I do using git-read-tree or git-reset or
      git-checkout to update the index.
      John Wiegley committed
  7. 02 Feb, 2011 5 commits
  8. 01 Feb, 2011 2 commits