summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Merge pull request #1858 from linquize/win32-template-dirVicent Martí2013-09-176-19/+62
|\ \ \ \ | | | | | | | | | | Configurable template dir for Win32
| * | | | Can load default template directoryLinquize2013-09-183-5/+24
| | | | |
| * | | | Can git_libgit2_opts() with GIT_OPT_GET_TEMPLATE_PATH and ↵Linquize2013-09-181-0/+13
| | | | | | | | | | | | | | | | | | | | GIT_OPT_SET_TEMPLATE_PATH
| * | | | Can guess win32 git template dirLinquize2013-09-172-2/+13
| | | | |
| * | | | Refactor git_win32__find_system_dirs() to extract "etc\\" as subpath parameterLinquize2013-09-173-12/+12
| | | | |
* | | | | Bug fixes and cleanupsRussell Belfer2013-09-175-28/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This contains a few bug fixes and some header and API cleanups. The main API change is that filters should now use GIT_PASSTHROUGH to indicate that they wish to skip processing a file instead of GIT_ENOTFOUND. The bug fixes include a possible out-of-range buffer access in the ident filter, a filter ordering problem I introduced into the custom filter tests on Windows, and a filter buf NUL termination issue that was coming up on Linux.
* | | | | More filtering tests including orderRussell Belfer2013-09-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds more tests of filters, including the ident filter when mixed with custom filters. I was able to combine with the reverse filter and demonstrate that the order of filter application with the default priority constants matches the order of core Git. Also, this fixes two issues in the ident filter: preventing ident expansion on binary files and avoiding a NULL dereference when dollar sign characters are found without Id.
* | | | | Some tests with ident and crlf filtersRussell Belfer2013-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the filter order to match core Git, too. This test demonstrates an interesting behavior of core Git (which is totally reasonable and which libgit2 matches, although mostly by coincidence). If you use the ident filter and commit a file with a garbage ident in it, like '$Id: this is just garbage$' and then immediately do a 'git checkout-index' with the new file, Git will not consider the file out of date and will not overwrite the file with an updated $Id$. Libgit2 has the same behavior. If you remove the file and then do a checkout-index, it will be replaced with a filtered version that has injected the OID correctly.
* | | | | Add clar helpers for testing file equalityRussell Belfer2013-09-171-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are a couple of new clar helpers for testing that a file has expected contents that I extracted from the checkout code. Actually wrote this as part of an abandoned earlier attempt at a new filters API, but it will be useful now for some of the tests I'm going to write.
* | | | | Fix win32 warningsRussell Belfer2013-09-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I wish MSVC understood that "const char **" is not a const ptr, but it a non-const pointer to an array of const ptrs. Does that seem like too much to ask.
* | | | | Port tests from PR 1683Russell Belfer2013-09-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ports over some of the tests from https://github.com/libgit2/libgit2/pull/1683 by @yorah and @ethomson
* | | | | Move binary check to CRLF filter itselfRussell Belfer2013-09-172-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checkout should not reject binary files from filters, as a filter may actually wish to operate on binary files. The CRLF filter should reject binary files itself if it wishes to. Moreover, the CRLF filter requires this logic so that users can emulate the checkout data in their odb -> workdir filtering. Conflicts: src/checkout.c src/crlf.c
* | | | | Merge git_buf and git_bufferRussell Belfer2013-09-1712-219/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the git_buf struct that was used internally into an externally available structure and eliminates the git_buffer. As part of that, some of the special cases that arose with the externally used git_buffer were blended into the git_buf, such as being careful about git_buf objects that may have a NULL ptr and allowing for bufs with a valid ptr and size but zero asize as a way of referring to externally owned data.
* | | | | Add ident filterRussell Belfer2013-09-179-16/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the ident filter (that knows how to replace $Id$) and tweaks the filter APIs and code so that git_filter_source objects actually have the updated OID of the object being filtered when it is a known value.
* | | | | Add functions to manipulate filter listsRussell Belfer2013-09-173-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the git2/sys/filter API with functions to look up a filter and add it manually to a filter list. This requires some trickery because the regular attribute lookups and checks are bypassed when this happens, but in the right hands, it will allow a user to have granular control over applying filters.
* | | | | Update filter registry codeRussell Belfer2013-09-172-58/+122
| | | | | | | | | | | | | | | | | | | | | | | | | This updates the git filter registry to be a little cleaner and plugs some memory leaks.
* | | | | Add simple global shutdown hooksRussell Belfer2013-09-1710-45/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increasingly there are a number of components that want to do some cleanup at global shutdown time (at least if there are not going to be memory leaks). This creates a very simple system of shutdown hooks that will be invoked by git_threads_shutdown. Right now, the maximum number of hooks is hardcoded, but since adding a hook is not a public API, it should be fine and I thought it was better to start off with really simple code.
* | | | | Fix longstanding valgrind warningRussell Belfer2013-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | There was a possible circumstance that could result in reading past the end of a buffer. This check fixes that.
* | | | | Hook up filter initialize callbackRussell Belfer2013-09-171-2/+32
| | | | | | | | | | | | | | | | | | | | I knew I forgot something
* | | | | Extend public filter api with filter listsRussell Belfer2013-09-179-205/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the git_filter_list into the public API so that users can create, apply, and dispose of filter lists. This allows more granular application of filters to user data outside of libgit2 internals. This also converts all the internal usage of filters to the public APIs along with a few small tweaks to make it easier to use the public git_buffer stuff alongside the internal git_buf.
* | | | | Add attributes to filters and fix registryRussell Belfer2013-09-173-62/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The filter registry as implemented was too primitive to actually work once multiple filters were coming into play. This expands the implementation of the registry to handle multiple prioritized filters correctly. Additionally, this adds an "attributes" field to a filter that makes it really really easy to implement filters that are based on one or more attribute values. The lookup and even simple value checking can all happen automatically without custom filter code. Lastly, with the registry improvements, this fills out the filter lifecycle callbacks, with initialize and shutdown callbacks that will be called before the filter is first used and after it is last invoked. This allows for system-wide initialization and cleanup by the filter.
* | | | | Make git_filter_source opaqueRussell Belfer2013-09-172-5/+37
| | | | |
* | | | | Create public filter object and use itRussell Belfer2013-09-1711-237/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This creates include/sys/filter.h with a basic definition of a git_filter and then converts the internal code to use it. There are related internal objects (git_filter_list) that we will want to publish at some point, but this is a first step.
* | | | | Start of filter API + git_blob_filtered_contentRussell Belfer2013-09-176-30/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This begins the process of exposing git_filter objects to the public API. This includes: * new public type and API for `git_buffer` through which an allocated buffer can be passed to the user * new API `git_blob_filtered_content` * make the git_filter type and GIT_FILTER_TO_... constants public
* | | | | Merge pull request #1833 from libgit2/cmn/config-includeVicent Martí2013-09-171-112/+208
|\ \ \ \ \ | |/ / / / |/| | | | Support config includes
| * | | | config: handle realloc issues from larger depthsCarlos Martín Nieto2013-09-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the include depth increases, the chance of a realloc increases. This means that whenever we run git_array_alloc() or call config_parse(), we need to remember what our reader's index is so we can look it up again.
| * | | | config: return an error when reaching the maximum include depthCarlos Martín Nieto2013-09-071-3/+4
| | | | |
| * | | | config: fix variable overridingCarlos Martín Nieto2013-09-071-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | When two or more variables of the same name exist and the user asks for a scalar, we must return the latest value assign to it.
| * | | | config: refresh included filesCarlos Martín Nieto2013-09-071-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to refresh the variables from the included files if they are changed, so loop over all included files and re-parse the files if any of them has changed.
| * | | | config: keep a list of included filesCarlos Martín Nieto2013-09-071-47/+58
| | | | | | | | | | | | | | | | | | | | | | | | | When refreshing we need to refresh if any of the files have been touched, so we need to keep the list.
| * | | | config: add support for include directivesCarlos Martín Nieto2013-09-071-5/+52
| | | | | | | | | | | | | | | | | | | | | | | | | Relative, absolute and home-relative paths are supported. The recursion limit it set at 10, just like in git.
| * | | | config: decouple the backend from the reader at the low levelCarlos Martín Nieto2013-09-051-84/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support config includes, we must differentiate between the backend's main file and the file we are currently parsing. This lays the groundwork for includes, keeping the current behaviours.
* | | | | Fix failure in win32_find_git_in_registry() when UAC is turned onLinquize2013-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Demand read only access to registry key instead of full access. This might happen in Windows Vista and later.
* | | | | Fix failure in win32_find_git_in_registry()Linquize2013-09-171-1/+1
| |/ / / |/| | | | | | | | | | | The buffer size 0 was definitely not enough so it failed
* | | | Merge pull request #1856 from libgit2/cmn/no-orphansVicent Martí2013-09-178-10/+10
|\ \ \ \ | | | | | | | | | | No such thing as an orphan branch
| * | | | No such thing as an orphan branchCarlos Martín Nieto2013-09-178-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately git-core uses the term "unborn branch" and "orphan branch" interchangeably. However, "orphan" is only really there for the checkout command, which has the `--orphan` option so it doesn't actually create the branch. Branches never have parents, so the distinction of a branch with no parents is odd to begin with. Crucially, the error messages deal with unborn branches, so let's use that.
* | | | | Merge pull request #1851 from tiennou/libssh2-errorsVicent Martí2013-09-171-14/+22
|\ \ \ \ \ | |/ / / / |/| | | | Provide libssh2 error message
| * | | | Whitespace.Etienne Samson2013-09-161-1/+1
| | | | |
| * | | | Add a wrapper to provide the libssh2 error messageEtienne Samson2013-09-161-13/+21
| | | | |
* | | | | clone: Anal as fuckVicent Marti2013-09-161-2/+1
|/ / / /
* | | | git_clone supports optional init_optionsLinquize2013-09-161-3/+11
| | | |
* | | | Fix memory leak in git_tree_walk on error or when stopping the walk from the ↵wilke2013-09-131-1/+2
| | | | | | | | | | | | | | | | supplied callback
* | | | Prevent git_tree_walk 'skip entry' callback return code from leaking through ↵wilke2013-09-131-1/+3
| | | | | | | | | | | | | | | | as the return value of git_tree_walk
* | | | Merge pull request #1839 from isaac/ssh-repository-invalidVicent Martí2013-09-111-0/+1
|\ \ \ \ | | | | | | | | | | SSH: Clone fails with errors: ERROR: Repository invalid & Early EOF
| * | | | Test for repo before removing leading colonIsaac Kearse2013-09-101-1/+1
| | | | |
| * | | | Trim leading colon from ssh repository pathIsaac Kearse2013-09-081-0/+1
| | |/ / | |/| |
* | | | errors: Fix format of some error messagesnulltoken2013-09-113-3/+3
| | | |
* | | | Merge pull request #1838 from libgit2/cmn/first-parentRussell Belfer2013-09-102-5/+20
|\ \ \ \ | | | | | | | | | | revwalk: allow simplifying by first-parent
| * | | | revwalk: allow simplifying by first-parentCarlos Martín Nieto2013-09-092-5/+20
| |/ / / | | | | | | | | | | | | | | | | When enabled, only the first parent of each commit will be queued, enabling a simple way of using first-parent simplification.
* | | | odb: Teach loose backend to return EAMBIGUOUSnulltoken2013-09-101-2/+6
| | | |