summaryrefslogtreecommitdiff
path: root/include/git2
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #664 from arrbee/attrs-from-indexdevelopment-mergeVicent Martí2012-05-051-11/+155
|\ | | | | Support git attrs from index (and bare repo)
| * Fix memory leaks and use after freeRussell Belfer2012-05-041-3/+3
| |
| * Support reading attributes from indexRussell Belfer2012-05-031-11/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on the operation, we need to consider gitattributes in both the work dir and the index. This adds a parameter to all of the gitattributes related functions that allows user control of attribute reading behavior (i.e. prefer workdir, prefer index, only use index). This fix also covers allowing us to check attributes (and hence do diff and status) on bare repositories. This was a somewhat larger change that I hoped because it had to change the cache key used for gitattributes files.
* | notes: add git_note_default_ref()Michael Schubert2012-05-031-0/+10
|/ | | | | Add git_note_default_ref to allow easy retrieval of the currently set default notes reference.
* Remove old and unused error codesVicent Martí2012-05-022-108/+8
|
* Merge branch 'new-error-handling' into developmentVicent Martí2012-05-0214-33/+512
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
| * Fix usage of "new" for fieldname in public headerRussell Belfer2012-05-021-16/+16
| | | | | | | | | | | | | | | | This should restore the ability to include libgit2 headers in C++ projects. Cherry picked 2de60205dfea2c4a422b2108a5e8605f97c2e895 from development into new-error-handling.
| * Merge remote-tracking branch 'carlosmn/remaining-errors' into new-error-handlingVicent Martí2012-05-011-0/+2
| |\ | | | | | | | | | | | | Conflicts: src/refspec.c
| | * error handling: move the missing parts over to the new error handlingCarlos Martín Nieto2012-04-261-0/+2
| | |
| * | diff: provide more context to the consumer of the callbacksnulltoken2012-04-301-20/+17
| | | | | | | | | | | | Update the callback to provide some information related to the file change being processed and the range of the hunk, when applicable.
| * | remote: add more doc on git_remote_freeMichael Schubert2012-04-281-0/+3
| |/
| * remote: run a callback when updating the branch tipsCarlos Martín Nieto2012-04-251-4/+2
| | | | | | | | | | | | | | | | This allows the caller to update an internal structure or update the user output with the tips that were updated. While in the area, only try to update the ref if the value is different from its old one.
| * transports: buffer the git requests before sending themCarlos Martín Nieto2012-04-252-1/+2
| | | | | | | | | | | | Trying to send every single line immediately won't give us any speed improvement and duplicates the code we need for other transports. Make the git transport use the same buffer functions as HTTP.
| * fetch: use the streaming indexer when downloading a packCarlos Martín Nieto2012-04-251-1/+1
| | | | | | | | | | | | | | | | This changes the git_remote_download() API, but the existing one is silly, so you don't get to complain. The new API allows to know how much data has been downloaded, how many objects we expect in total and how many we've processed.
| * Merge pull request #632 from arrbee/win64-cleanupVicent Martí2012-04-231-0/+20
| |\ | | | | | | Code clean up, including fixing warnings on Windows 64-bit build
| | * Rename to git_reference_name_to_oidRussell Belfer2012-04-231-1/+2
| | |
| | * Add git_reference_lookup_oid and lookup_resolvedRussell Belfer2012-04-171-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a new public reference function `git_reference_lookup_oid` that directly resolved a reference name to an OID without returning the intermediate `git_reference` object (hence, no free needed). Internally, this adds a `git_reference_lookup_resolved` function that combines looking up and resolving a reference. This allows us to be more efficient with memory reallocation. The existing `git_reference_lookup` and `git_reference_resolve` are reimplmented on top of the new utility and a few places in the code are changed to use one of the two new functions.
| * | Merge remote-tracking branch 'carlosmn/indexer-stream' into new-error-handlingVicent Martí2012-04-191-0/+45
| |\ \ | | |/ | |/|
| | * indexer: add git_indexer_stream_free() and _hash()Carlos Martín Nieto2012-04-131-0/+17
| | |
| | * indexer: Add git_indexer_stream_finalize()Carlos Martín Nieto2012-04-131-0/+9
| | | | | | | | | | | | | | | Resolve any lingering deltas, write out the index file and rename the packfile.
| | * indexer: start writing the stream indexerCarlos Martín Nieto2012-04-131-0/+19
| | | | | | | | | | | | | | | | | | This will allow us to index a packfile as soon as we receive it from the network as well as storing it with its final name so we don't need to pass temporary file names around.
| * | Add support for pathspec to diff and statusRussell Belfer2012-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | This adds preliminary support for pathspecs to diff and status. The implementation is not very optimized (it still looks at every single file and evaluated the the pathspec match against them), but it works.
| * | Merge remote-tracking branch 'carlosmn/revwalk-merge-base' into ↵Vicent Martí2012-04-132-0/+57
| |\ \ | | | | | | | | | | | | new-error-handling
| | * | Move git_merge_base() to is own header and document itCarlos Martín Nieto2012-04-122-3/+35
| | | |
| | * | Implement git_merge_base()Carlos Martín Nieto2012-04-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | It's implemented in revwalk.c so it has access to the revision walker's commit cache and related functions. The algorithm is the one used by git, modified so it fits better with the library's functions.
| | * | revwalk: allow pushing/hiding a reference by nameCarlos Martín Nieto2012-04-121-0/+22
| | |/ | | | | | | | | | | | | | | | The code was already there, so factor it out and let users push an OID by giving it a reference name. Only refs to commits are supported. Annotated tags will throw an error.
| * | Refactor git_repository_open with new optionsRussell Belfer2012-04-111-0/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new command `git_repository_open_ext` with extended options that control how searching for a repository will be done. The existing `git_repository_open` and `git_repository_discover` are reimplemented on top of it. We may want to change the default behavior of `git_repository_open` but this commit does not do that. Improve support for "gitdir" files where the work dir is separate from the repo and support for the "separate-git-dir" config. Also, add support for opening repos created with `git-new-workdir` script (although I have only confirmed that they can be opened, not that all functions work correctly). There are also a few minor changes that came up: - Fix `git_path_prettify` to allow in-place prettifying. - Fix `git_path_root` to support backslashes on Win32. This fix should help many repo open/discover scenarios - it is the one function called when opening before prettifying the path. - Tweak `git_config_get_string` to set the "out" pointer to NULL if the config value is not found. Allows some other cleanup. - Fix a couple places that should have been calling `git_repository_config__weakptr` and were not. - Fix `cl_git_sandbox_init` clar helper to support bare repos.
| * error-handling: remote, transportCarlos Martín Nieto2012-04-111-1/+2
| |
| * Typedefs don't have enum in frontCarlos Martín Nieto2012-04-111-1/+1
| |
| * Merge pull request #619 from nulltoken/topic/branchesVicent Martí2012-04-113-6/+133
| |\ | | | | | | Basic branch management API
| | * branch: add git_branch_move()nulltoken2012-04-101-0/+22
| | |
| | * Add basic branch management API: git_branch_create(), git_branch_delete(), ↵nulltoken2012-04-102-6/+96
| | | | | | | | | | | | git_branch_list()
| | * tag: Add git_tag_peel() which recursively peel a tag until a non tag ↵nulltoken2012-04-101-0/+15
| | | | | | | | | | | | git_object is met
| * | Merge branch 'new-error-handling' of github.com:libgit2/libgit2 into ↵Vicent Martí2012-04-113-1/+179
| |\ \ | | |/ | | | | | | new-error-handling
| | * Improve config handling for diff,submodules,attrsRussell Belfer2012-03-301-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | This adds support for a bunch of core.* settings that affect diff and status, plus fixes up some incorrect implementations of those settings from before. Also, this cleans up the handling of config settings in the new submodules code and in the old attrs/ignore code.
| | * Added submodule API and use in statusRussell Belfer2012-03-281-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When processing status for a newly checked out repo, it is possible that there will be submodules that have not yet been initialized. The only way to distinguish these from untracked directories is to have some knowledge of submodules. This commit adds a new submodule API which, given a name or path, can determine if it appears to be a submodule and can give information about the submodule.
| | * Fix crash in new status and add recurse optionRussell Belfer2012-03-232-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the bug that @nulltoken found (thank you!) where if there were untracked directories alphabetically after the last tracked item, the diff implementation would deref a NULL pointer. The fix involved the code which decides if it is necessary to recurse into a directory in the working dir, so it was easy to add a new option `GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS` to control if the contents of untracked directories should be included in status.
| | * New status fixesRussell Belfer2012-03-222-4/+5
| | | | | | | | | | | | | | | | | | | | | This adds support for roughly-right tracking of submodules (although it does not recurse into submodules to detect internal modifications a la core git), and it adds support for including unmodified files in diff iteration if requested.
| | * Adding new tests for new status commandRussell Belfer2012-03-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is a work in progress. This adds two new sets of tests, the issue_592 tests from @nulltoken's pull request #601 and some new tests for submodules. The submodule tests still have issues where the status is not reported correctly. That needs to be fixed before merge.
| | * Reimplment git_status_foreach using git diffRussell Belfer2012-03-211-1/+67
| | | | | | | | | | | | | | | This is an initial reimplementation of status using diff a la the way that core git does it.
| * | error-handling: Commit (WIP)Vicent Martí2012-04-021-1/+2
| |/
| * Migrate index, oid, and utils to new errorsRussell Belfer2012-03-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | This includes a few cleanups that came up while converting these files. This commit introduces a could new git error classes, including the catchall class: GITERR_INVALID which I'm using as the class for invalid and out of range values which are detected at too low a level of library to use a higher level classification. For example, an overflow error in parsing an integer or a bad letter in parsing an OID string would generate an error in this class.
| * Resolve comments from pull requestRussell Belfer2012-03-131-0/+16
| | | | | | | | | | | | | | This converts the map validation function into a macro, tweaks the GITERR_OS system error automatic appending, and adds a tentative new error access API and some quick unit tests for both the old and new error APIs.
| * Migrate ODB files to new error handlingRussell Belfer2012-03-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This migrates odb.c, odb_loose.c, odb_pack.c and pack.c to the new style of error handling. Also got the unix and win32 versions of map.c. There are some minor changes to other files but no others were completely converted. This also contains an update to filebuf so that a zeroed out filebuf will not think that the fd (== 0) is actually open (and inadvertently call close() on fd 0 if cleaned up). Lastly, this was built and tested on win32 and contains a bunch of fixes for the win32 build which was pretty broken.
| * error-handling: On-disk config file backendVicent Martí2012-03-091-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Includes: - Proper error reporting when encountering syntax errors in a config file (file, line number, column). - Rewritten `config_write`, now with 99% less goto-spaghetti - Error state in `git_filebuf`: filebuf write functions no longer need to be checked for error returns. If any of the writes performed on a buffer fail, the last call to `git_filebuf_commit` or `git_filebuf_hash` will fail accordingly and set the appropiate error message. Baller!
| * error-handling: ConfigVicent Martí2012-03-071-0/+1
| |
| * error-handling: RepositoryVicent Martí2012-03-071-1/+1
| | | | | | | | | | | | | | | | This also includes droping `git_buf_lasterror` because it makes no sense in the new system. Note that in most of the places were it has been dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so instead it should return a generic `-1` and obviously not throw anything.
| * error-handling: ReferencesVicent Martí2012-03-061-5/+6
| | | | | | | | | | Yes, this is error handling solely for `refs.c`, but some of the abstractions leak all ofer the code base.
| * refs: Error handling rework. WIPVicent Martí2012-03-031-0/+3
| |
| * error-handling: Add new routinesVicent Martí2012-03-031-0/+15
| | | | | | | | | | Obviously all the old throw routines are still in place, so we can gradually port over.