1. 17 Jan, 2012 1 commit
    • Move path related functions from fileops to path · 1744fafe
      This takes all of the functions that look up simple data about
      paths (such as `git_futils_isdir`) and moves them over to path.h
      (becoming `git_path_isdir`).  This leaves fileops.h just with
      functions that actually manipulate the filesystem or look at
      the file contents in some way.
      
      As part of this, the dir.h header which is really just for win32
      support was moved into win32 (with some minor changes).
      Russell Belfer committed
  2. 12 Jan, 2012 1 commit
  3. 11 Jan, 2012 1 commit
    • Initial implementation of gitignore support · df743c7d
      Adds support for .gitignore files to git_status_foreach() and
      git_status_file().  This includes refactoring the gitattributes
      code to share logic where possible.  The GIT_STATUS_IGNORED flag
      will now be passed in for files that are ignored (provided they
      are not already in the index or the head of repo).
      Russell Belfer committed
  4. 29 Dec, 2011 1 commit
    • Add support for macros and cache flush API. · 73b51450
      Add support for git attribute macro definitions.  Also, add
      support for cache flush API to clear the attribute file content
      cache when needed.
      
      Additionally, improved the handling of global and system files,
      making common utility functions in fileops and converting config
      and attr to both use the common functions.
      
      Adds a bunch more tests and fixed some memory leaks.  Note that
      adding macros required me to use refcounted attribute assignment
      definitions, which complicated, but probably improved memory usage.
      Russell Belfer committed
  5. 08 Dec, 2011 1 commit
    • Use git_buf for path storage instead of stack-based buffers · 97769280
      This converts virtually all of the places that allocate GIT_PATH_MAX
      buffers on the stack for manipulating paths to use git_buf objects
      instead.  The patch is pretty careful not to touch the public API
      for libgit2, so there are a few places that still use GIT_PATH_MAX.
      
      This extends and changes some details of the git_buf implementation
      to add a couple of extra functions and to make error handling easier.
      
      This includes serious alterations to all the path.c functions, and
      several of the fileops.c ones, too.  Also, there are a number of new
      functions that parallel existing ones except that use a git_buf
      instead of a stack-based buffer (such as git_config_find_global_r
      that exists alongsize git_config_find_global).
      
      This also modifies the win32 version of p_realpath to allocate whatever
      buffer size is needed to accommodate the realpath instead of hardcoding
      a GIT_PATH_MAX limit, but that change needs to be tested still.
      Russell Belfer committed
  6. 21 Nov, 2011 1 commit
  7. 14 Oct, 2011 2 commits
    • fileops/repository: create (most) directories with 0777 permissions · ce8cd006
      To further match how Git behaves, this change makes most of the
      directories libgit2 creates in a git repo have a file mode of
      0777. Specifically:
      
      - Intermediate directories created with git_futils_mkpath2file() have
        0777 permissions. This affects odb_loose, reflog, and refs.
      
      - The top level folder for bare repos is created with 0777
        permissions.
      
      - The top level folder for non-bare repos is created with 0755
        permissions.
      
      - /objects/info/, /objects/pack/, /refs/heads/, and /refs/tags/ are
        created with 0777 permissions.
      
      Additionally, the following changes have been made:
      
      - fileops functions that create intermediate directories have grown a
        new dirmode parameter. The only exception to this is filebuf's
        lock_file(), which unconditionally creates intermediate directories
        with 0777 permissions when GIT_FILEBUF_FORCE is set.
      
      - The test runner now sets the umask to 0 before running any
        tests. This ensurses all file mode checks are consistent across
        systems.
      
      - t09-tree.c now does a directory permissions check. I've avoided
        adding this check to other tests that might reuse existing
        directories from the prefabricated test repos. Because they're
        checked into the repo, they have 0755 permissions.
      
      - Other assorted directories created by tests have 0777 permissions.
      Brodie Rao committed
    • fileops/posix: replace usage of "int mode" with "mode_t mode" · 33127043
      Note: Functions exported from fileops take const mode_t, while the
      underlying POSIX wrappers take mode_t.
      Brodie Rao committed
  8. 19 Sep, 2011 1 commit
    • Tabify everything · 87d9869f
      There were quite a few places were spaces were being used instead of
      tabs. Try to catch them all. This should hopefully not break anything.
      Except for `git blame`. Oh well.
      Vicent Marti committed
  9. 18 Sep, 2011 1 commit
    • Cleanup legal data · bb742ede
      1. The license header is technically not valid if it doesn't have a
      copyright signature.
      
      2. The COPYING file has been updated with the different licenses used in
      the project.
      
      3. The full GPLv2 header in each file annoys me.
      Vicent Marti committed
  10. 23 Jul, 2011 1 commit
    • Add git_futils_readbuffer_updated · c3da9f06
      This extends the git_fuitls_readbuffer function to only read in if the
      file's modification date is later than the given one. Some code paths
      want to check a file's modification date in order to decide whether
      they should read it or not. If they do want to read it, another stat
      call is done by futils. This function combines these two operations so
      we avoid one stat call each time we read a new or updated file.
      
      The git_futils_readbuffer functions is now a wrapper around the new
      function.
      
      Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
      Carlos Martín Nieto committed
  11. 06 Jul, 2011 5 commits
  12. 05 Jul, 2011 3 commits
    • fileops: Drop `git_fileops_prettify_path` · 5ad739e8
      The old `git_fileops_prettify_path` has been replaced with
      `git_path_prettify`. This is a much simpler method that uses the OS's
      `realpath` call to obtain the full path for directories and resolve
      symlinks.
      
      The `realpath` syscall is the original POSIX call in Unix system and
      an emulated version under Windows using the Windows API.
      Vicent Marti committed
    • fileops: Cleanup · f79026b4
      Cleaned up the structure of the whole OS-abstraction layer.
      
      fileops.c now contains a set of utility methods for file management used
      by the library. These are abstractions on top of the original POSIX
      calls.
      
      There's a new file called `posix.c` that contains
      emulations/reimplementations of all the POSIX calls the library uses.
      These are prefixed with `p_`. There's a specific posix file for each
      platform (win32 and unix).
      
      All the path-related methods have been moved from `utils.c` to `path.c`
      and have their own prefix.
      Vicent Marti committed
  13. 01 Jul, 2011 1 commit
  14. 29 Jun, 2011 1 commit
  15. 15 Jun, 2011 1 commit
  16. 10 Jun, 2011 1 commit
  17. 08 Jun, 2011 1 commit
    • windows: Fix Symlink issues · ae496955
      Handle Symlinks if they can be handled in Win32. This is not even
      compiled. Needs review.
      
      The lstat implementation is modified from core Git.
      The readlink implementation is modified from PHP.
      Vicent Marti committed
  18. 07 Jun, 2011 2 commits
  19. 06 Jun, 2011 1 commit
  20. 03 Jun, 2011 6 commits
  21. 23 May, 2011 1 commit
  22. 23 Mar, 2011 1 commit
    • Improve the ODB writing backend · f6f72d7e
      Temporary files when doing streaming writes are now stored inside the
      Objects folder, to prevent issues when moving files between
      disks/partitions.
      
      Add support for block writes to the ODB again (for those backends that
      cannot implement streaming).
      Vicent Marti committed
  23. 22 Mar, 2011 3 commits
  24. 20 Mar, 2011 1 commit
    • I broke your bindings · 72a3fe42
      Hey. Apologies in advance -- I broke your bindings.
      
      This is a major commit that includes a long-overdue redesign of the
      whole object-database structure. This is expected to be the last major
      external API redesign of the library until the first non-alpha release.
      
      Please get your bindings up to date with these changes. They will be
      included in the next minor release. Sorry again!
      
      Major features include:
      
      	- Real caching and refcounting on parsed objects
      	- Real caching and refcounting on objects read from the ODB
      	- Streaming writes & reads from the ODB
      	- Single-method writes for all object types
      	- The external API is now partially thread-safe
      
      The speed increases are significant in all aspects, specially when
      reading an object several times from the ODB (revwalking) and when
      writing big objects to the ODB.
      
      Here's a full changelog for the external API:
      
      blob.h
      ------
      
      	- Remove `git_blob_new`
      	- Remove `git_blob_set_rawcontent`
      	- Remove `git_blob_set_rawcontent_fromfile`
      	- Rename `git_blob_writefile` -> `git_blob_create_fromfile`
      	- Change `git_blob_create_fromfile`:
      		The `path` argument is now relative to the repository's working dir
      	- Add `git_blob_create_frombuffer`
      
      commit.h
      --------
      
      	- Remove `git_commit_new`
      	- Remove `git_commit_add_parent`
      	- Remove `git_commit_set_message`
      	- Remove `git_commit_set_committer`
      	- Remove `git_commit_set_author`
      	- Remove `git_commit_set_tree`
      
      	- Add `git_commit_create`
      	- Add `git_commit_create_v`
      	- Add `git_commit_create_o`
      	- Add `git_commit_create_ov`
      
      tag.h
      -----
      
      	- Remove `git_tag_new`
      	- Remove `git_tag_set_target`
      	- Remove `git_tag_set_name`
      	- Remove `git_tag_set_tagger`
      	- Remove `git_tag_set_message`
      
      	- Add `git_tag_create`
      	- Add `git_tag_create_o`
      
      tree.h
      ------
      
      	- Change `git_tree_entry_2object`:
      		New signature is `(git_object **object_out, git_repository *repo, git_tree_entry *entry)`
      
      	- Remove `git_tree_new`
      	- Remove `git_tree_add_entry`
      	- Remove `git_tree_remove_entry_byindex`
      	- Remove `git_tree_remove_entry_byname`
      	- Remove `git_tree_clearentries`
      	- Remove `git_tree_entry_set_id`
      	- Remove `git_tree_entry_set_name`
      	- Remove `git_tree_entry_set_attributes`
      
      object.h
      ------------
      
      	- Remove `git_object_new
      	- Remove `git_object_write`
      
      	- Change `git_object_close`:
      		This method is now *mandatory*. Not closing an object causes a
      		memory leak.
      
      odb.h
      -----
      
      	- Remove type `git_rawobj`
      	- Remove `git_rawobj_close`
      	- Rename `git_rawobj_hash` -> `git_odb_hash`
      	- Change `git_odb_hash`:
      		New signature is `(git_oid *id, const void *data, size_t len, git_otype type)`
      
      	- Add type `git_odb_object`
      	- Add `git_odb_object_close`
      
      	- Change `git_odb_read`:
      		New signature is `(git_odb_object **out, git_odb *db, const git_oid *id)`
      	- Change `git_odb_read_header`:
      		New signature is `(size_t *len_p, git_otype *type_p, git_odb *db, const git_oid *id)`
      	- Remove `git_odb_write`
      	- Add `git_odb_open_wstream`
      	- Add `git_odb_open_rstream`
      
      odb_backend.h
      -------------
      
      	- Change type `git_odb_backend`:
      		New internal signatures are as follows
      
      			int (* read)(void **, size_t *, git_otype *, struct git_odb_backend *, const git_oid *)
      			int (* read_header)(size_t *, git_otype *, struct git_odb_backend *, const git_oid *)
      			int (* writestream)(struct git_odb_stream **, struct git_odb_backend *, size_t, git_otype)
      			int (* readstream)( struct git_odb_stream **, struct git_odb_backend *, const git_oid *)
      
      	- Add type `git_odb_stream`
      	- Add enum `git_odb_streammode`
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  25. 05 Mar, 2011 1 commit