summaryrefslogtreecommitdiff
path: root/include/git2/status.h
Commit message (Collapse)AuthorAgeFilesLines
* diff/status: introduce conflictsEdward Thomson2015-05-281-0/+1
| | | | | | | | | | | When diffing against an index, return a new `GIT_DELTA_CONFLICTED` delta type for items that are conflicted. For a single file path, only one delta will be produced (despite the fact that there are multiple entries in the index). Index iterators now have the (optional) ability to return conflicts in the index. Prior to this change, they would be omitted, and callers (like diff) would omit conflicted index entries entirely.
* git_status_file now takes an exact pathUngureanu Marius2014-11-071-1/+2
| | | | | | This function has one output but can match multiple files, which can be unexpected for the user, which would usually path the exact path of the file he wants the status of.
* Whitespace wibbles.Alan Rogers2014-06-041-0/+1
|
* Add GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKEDAlan Rogers2014-06-031-16/+16
| | | | and a (failing) test for it.
* Add GIT_STATUS_OPT_INCLUDE_UNREADABLEAlan Rogers2014-05-301-0/+1
|
* Start adding GIT_DELTA_UNREADABLE and GIT_STATUS_WT_UNREADABLE.Alan Rogers2014-05-201-0/+1
|
* Remove trace / add git_diff_perfdata struct + apiRussell Belfer2014-05-021-5/+4
|
* Add GIT_STATUS_OPT_UPDATE_INDEX and use trace APIRussell Belfer2014-05-021-0/+6
| | | | | | This adds an option to refresh the stat cache while generating status. It also rips out the GIT_PERF stuff I had an makes use of the trace API to keep statistics about what happens during diff.
* Improve docs for status rename detection limitsrb/status-with-precomposed-changesRussell Belfer2014-04-241-2/+27
| | | | and make tests empty on platforms without iconv support.
* Added function-based initializers for every options struct.Matthew Bowen2014-03-051-0/+13
| | | | The basic structure of each function is courtesy of arrbee.
* Update docs for new callback return value behaviorRussell Belfer2013-12-111-3/+3
|
* Make diff and status perform soft index reloadRussell Belfer2013-11-011-0/+4
| | | | | | | | | | | | | | | | | | | | | This changes `git_index_read` to have two modes - a hard index reload that always resets the index to match the on-disk data (which was the old behavior) and a soft index reload that uses the timestamp / file size information and only replaces the index data if the file on disk has been modified. This then updates the git_status code to do a soft reload unless the new GIT_STATUS_OPT_NO_REFRESH flag is passed in. This also changes the behavior of the git_diff functions that use the index so that when an index is not explicitly passed in (i.e. when the functions call git_repository_index for you), they will also do a soft reload for you. This intentionally breaks the file signature of git_index_read because there has been some confusion about the behavior previously and it seems like all existing uses of the API should probably be examined to select the desired behavior.
* Add rename from rewrites to statusEdward Thomson2013-08-051-1/+4
| | | | | | In git_diff_paired_foreach, temporarily resort the index->workdir diff list by index path so that we can track a rename in the workdir from head->index->workdir.
* Clarify docs for git_status_fileRussell Belfer2013-07-101-4/+4
|
* Remove GIT_STATUS_SHOW_INDEX_THEN_WORKDIR optionRussell Belfer2013-07-031-8/+7
| | | | | | This option serves no benefit now that the git_status_list API is available. It was of questionable value before and now it would just be a bad idea to use it rather than the indexed API.
* Add status flags to force output sort orderRussell Belfer2013-06-201-0/+8
| | | | | | | | | | | | | | | | Files in status will, be default, be sorted according to the case insensitivity of the filesystem that we're running on. However, in some cases, this is not desirable. Even on case insensitive file systems, 'git status' at the command line will generally use a case sensitive sort (like 'ls'). Some GUIs prefer to display a list of file case insensitively even on case-sensitive platforms. This adds two new flags: GIT_STATUS_OPT_SORT_CASE_SENSITIVELY and GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY that will override the default sort order of the status output and give the user control. This includes tests for exercising these new options and makes the examples/status.c program emulate core Git and always use a case sensitive sort.
* Clarify some docs and minor reorderingRussell Belfer2013-06-171-92/+89
| | | | | | | This simplifies some documentation and hopefully makes a couple of things easier to read. Also, this rearrages the order in this branch so that the overall diff against the trunk will hopefully be a bit cleaner.
* handle renames in status computationEdward Thomson2013-06-171-7/+14
|
* status access by index, providing more details to callersEdward Thomson2013-06-171-0/+63
|
* Implement GIT_STATUS_OPT_EXCLUDE_SUBMODULESRussell Belfer2013-03-251-1/+7
| | | | | | | | | | | This option has been sitting unimplemented for a while, so I finally went through and implemented it along with some tests. As part of this, I improved the implementation of GIT_DIFF_IGNORE_SUBMODULES so it be more diligent about avoiding extra work and about leaving off delta records for submodules to the greatest extent possible (though it may include them still if you are request TYPECHANGE records).
* Recursing into ignored dirs for diff and statusRussell Belfer2013-03-251-6/+10
| | | | | | | | This implements working versions of GIT_DIFF_RECURSE_IGNORED_DIRS and GIT_STATUS_OPT_RECURSE_IGNORED_DIRS along with some tests for the newly available behaviors. This is not turned on by default for status, but can be accessed via the options to the extended version of the command.
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Correct typos in documentationKevin Sawicki2013-01-061-1/+1
|
* Allow compilation as C++Ben Straub2012-12-061-1/+1
|
* Add version fields and init macros for public input structs.Ben Straub2012-11-301-0/+3
|
* API updates for status.hRussell Belfer2012-11-271-4/+17
|
* Improve docs, examples, warningsRussell Belfer2012-11-011-42/+85
| | | | | | This improves docs in some of the public header files, cleans up and improves some of the example code, and fixes a couple of pedantic warnings in places.
* Merge pull request #968 from arrbee/diff-support-typechangeRussell Belfer2012-10-171-10/+13
|\ | | | | Support TYPECHANGE records in status and adjust checkout accordingly
| * Introduce status/diff TYPECHANGE flagsRussell Belfer2012-10-091-10/+13
| | | | | | | | | | | | | | | | When I wrote the diff code, I based it on core git's diff output which tends to split a type change into an add and a delete. But core git's status has the notion of a T (typechange) flag for a file. This introduces that into our status APIs and modifies the diff code so it can be forced to not split type changes.
* | Fix single-file ignore checksRussell Belfer2012-10-151-4/+6
|/ | | | | | | | To answer if a single given file should be ignored, the path to that file has to be processed progressively checking that there are no intermediate ignored directories in getting to the file in question. This enables that, fixing the broken old behavior, and adds tests to exercise various ignore situations.
* Update iterators for consistency across libraryRussell Belfer2012-08-031-2/+2
| | | | | | | | | | | | | | | | | This updates all the `foreach()` type functions across the library that take callbacks from the user to have a consistent behavior. The rules are: * A callback terminates the loop by returning any non-zero value * Once the callback returns non-zero, it will not be called again (i.e. the loop stops all iteration regardless of state) * If the callback returns non-zero, the parent fn returns GIT_EUSER * Although the parent returns GIT_EUSER, no error will be set in the library and `giterr_last()` will return NULL if called. This commit makes those changes across the library and adds tests for most of the iteration APIs to make sure that they follow the above rules.
* Add flag to turn off pathspec testing for diff and statusyorah2012-07-241-0/+3
|
* Fix filemode comparison in diffsRussell Belfer2012-06-081-1/+1
| | | | | | | | | | | | | | | File modes were both not being ignored properly on platforms where they should be ignored, nor be diffed consistently on platforms where they are supported. This change adds a number of diff and status filemode change tests. This also makes sure that filemode-only changes are included in the diff output when they occur and that filemode changes are ignored successfully when core.filemode is false. There is no code that automatically toggles core.filemode based on the capabilities of the current platform, so the user still needs to be careful in their .git/config file.
* errors: Rename error codesbreaking-changesVicent Martí2012-05-181-1/+1
|
* errors: Rename the generic return codesVicent Martí2012-05-181-2/+2
|
* Properly tag all `enums` with a `_t`Vicent Martí2012-05-181-15/+18
|
* Ranged iterators and rewritten git_status_fileRussell Belfer2012-05-151-11/+20
| | | | | | | | | | | | | | | | | | | | | The goal of this work is to rewrite git_status_file to use the same underlying code as git_status_foreach. This is done in 3 phases: 1. Extend iterators to allow ranged iteration with start and end prefixes for the range of file names to be covered. 2. Improve diff so that when there is a pathspec and there is a common non-wildcard prefix of the pathspec, it will use ranged iterators to minimize excess iteration. 3. Rewrite git_status_file to call git_status_foreach_ext with a pathspec that covers just the one file being checked. Since ranged iterators underlie the status & diff implementation, this is actually fairly efficient. The workdir iterator does end up loading the contents of all the directories down to the single file, which should ideally be avoided, but it is pretty good.
* Add cache busting to attribute cacheRussell Belfer2012-05-101-2/+2
| | | | | | | | | | | This makes the git attributes and git ignores cache check stat information before using the file contents from the cache. For cached files from the index, it checks the SHA of the file instead. This should reduce the need to ever call `git_attr_cache_flush()` in most situations. This commit also fixes the `git_status_should_ignore` API to use the libgit2 standard parameter ordering.
* Fix crash in new status and add recurse optionRussell Belfer2012-03-231-6/+14
| | | | | | | | | | | | | 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-221-3/+3
| | | | | | | 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.
* Revert GIT_STATUS constants to avoid issuesRussell Belfer2012-03-021-1/+1
| | | | | | | | | This reverts the changes to the GIT_STATUS constants and adds a new enumeration to describe the type of change in a git_diff_delta. I don't love this solution, but it should prevent strange errors from occurring for now. Eventually, I would like to unify the various status constants, but it needs a larger plan and I just wanted to eliminate this breakage quickly.
* Update diff to use iteratorsRussell Belfer2012-03-021-1/+1
| | | | | | | | | | | | | This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Patch cleanup for mergeRussell Belfer2012-01-161-0/+16
| | | | | | | | | | After reviewing the gitignore support with Vicent, we came up with a list of minor cleanups to prepare for merge, including: * checking git_repository_config error returns * renaming git_ignore_is_ignored and moving to status.h * fixing next_line skipping to include \r skips * commenting on where ignores are and are not included
* Initial implementation of gitignore supportRussell Belfer2012-01-111-5/+5
| | | | | | | | 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).
* Tabify everythingVicent Marti2011-09-191-7/+7
| | | | | | 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.
* Cleanup legal dataVicent Marti2011-09-191-21/+3
| | | | | | | | | | 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.
* status: enhance determination of status for a single filenulltoken2011-09-151-1/+3
| | | | | | - fix retrieval of a file status when working against a newly initialized repository - reduce memory pressure - prevents a directory from being tested