|
0b5ba0d7
|
2019-06-06T16:36:23
|
|
Rename opt init functions to `options_init`
In libgit2 nomenclature, when we need to verb a direct object, we name
a function `git_directobject_verb`. Thus, if we need to init an options
structure named `git_foo_options`, then the name of the function that
does that should be `git_foo_options_init`.
The previous names of `git_foo_init_options` is close - it _sounds_ as
if it's initializing the options of a `foo`, but in fact
`git_foo_options` is its own noun that should be respected.
Deprecate the old names; they'll now call directly to the new ones.
|
|
22d2062d
|
2019-01-09T18:25:10
|
|
Introduce GIT_CALLBACK macro to enforce cdecl
Since we now always build the library with cdecl calling conventions,
our callbacks should be decorated as such so that users will not be able
to provide callbacks defined with other calling conventions.
The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as
appropriate.
|
|
ca5a15e5
|
2018-03-22T23:27:27
|
|
docs: standardize comment block for git_*_init_options functions
|
|
96576372
|
2018-03-22T23:27:21
|
|
docs: fix more missing includes
|
|
4ccacdc8
|
2017-07-21T17:07:10
|
|
status: Add a baseline field to git_status_options for comparing to trees other than HEAD
|
|
7c948014
|
2015-05-14T14:00:29
|
|
diff/status: introduce conflicts
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.
|
|
68182085
|
2014-11-07T20:32:50
|
|
git_status_file now takes an exact path
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.
|
|
9e2d2f30
|
2014-06-04T15:41:48
|
|
Whitespace wibbles.
|
|
79d5b5c9
|
2014-06-03T17:42:52
|
|
Add GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED
and a (failing) test for it.
|
|
66271925
|
2014-05-30T16:21:49
|
|
Add GIT_STATUS_OPT_INCLUDE_UNREADABLE
|
|
61bef72d
|
2014-05-20T23:57:40
|
|
Start adding GIT_DELTA_UNREADABLE and GIT_STATUS_WT_UNREADABLE.
|
|
9c8ed499
|
2014-04-29T15:05:58
|
|
Remove trace / add git_diff_perfdata struct + api
|
|
cd424ad5
|
2014-04-28T16:39:53
|
|
Add GIT_STATUS_OPT_UPDATE_INDEX and use trace API
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.
|
|
6b833e3a
|
2014-04-24T15:40:50
|
|
Improve docs for status rename detection limits
and make tests empty on platforms without iconv support.
|
|
b9f81997
|
2014-03-05T21:49:23
|
|
Added function-based initializers for every options struct.
The basic structure of each function is courtesy of arrbee.
|
|
373cf6a9
|
2013-12-09T10:17:47
|
|
Update docs for new callback return value behavior
|
|
4bf630b6
|
2013-10-31T14:36:52
|
|
Make diff and status perform soft index reload
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.
|
|
e38f0d69
|
2013-08-05T14:06:41
|
|
Add rename from rewrites to status
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.
|
|
d70ce9bd
|
2013-07-10T15:38:57
|
|
Clarify docs for git_status_file
|
|
2a16914c
|
2013-07-03T12:20:34
|
|
Remove GIT_STATUS_SHOW_INDEX_THEN_WORKDIR option
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.
|
|
22b6b82f
|
2013-06-20T12:16:06
|
|
Add status flags to force output sort order
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.
|
|
4e28e638
|
2013-06-13T15:27:30
|
|
Clarify some docs and minor reordering
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.
|
|
dfe8c8df
|
2013-05-22T23:19:40
|
|
handle renames in status computation
|
|
1ee2ef87
|
2013-05-21T11:05:21
|
|
status access by index, providing more details to callers
|
|
37ee70fa
|
2013-03-25T22:19:39
|
|
Implement GIT_STATUS_OPT_EXCLUDE_SUBMODULES
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).
|
|
0c289dd7
|
2013-03-25T16:40:16
|
|
Recursing into ignored dirs for diff and status
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.
|
|
359fc2d2
|
2013-01-08T17:07:25
|
|
update copyrights
|
|
7eb222fc
|
2013-01-06T10:39:35
|
|
Correct typos in documentation
|
|
fac43c54
|
2012-12-06T19:41:52
|
|
Allow compilation as C++
|
|
bde336ea
|
2012-11-29T12:26:09
|
|
Add version fields and init macros for public input structs.
|
|
d574de0e
|
2012-11-21T11:53:54
|
|
API updates for status.h
|
|
b90500f0
|
2012-11-01T14:08:30
|
|
Improve docs, examples, warnings
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.
|
|
4c47a8bc
|
2012-10-17T14:14:51
|
|
Merge pull request #968 from arrbee/diff-support-typechange
Support TYPECHANGE records in status and adjust checkout accordingly
|
|
52032ae5
|
2012-10-15T12:48:43
|
|
Fix single-file ignore checks
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.
|
|
bc16fd3e
|
2012-09-28T13:40:02
|
|
Introduce status/diff TYPECHANGE flags
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.
|
|
5dca2010
|
2012-08-03T17:08:01
|
|
Update iterators for consistency across library
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.
|
|
a1773f9d
|
2012-07-23T18:16:09
|
|
Add flag to turn off pathspec testing for diff and status
|
|
0abd7244
|
2012-06-04T16:17:41
|
|
Fix filemode comparison in diffs
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.
|
|
904b67e6
|
2012-05-18T01:48:50
|
|
errors: Rename error codes
|
|
e172cf08
|
2012-05-18T01:21:06
|
|
errors: Rename the generic return codes
|
|
2e2e9785
|
2012-05-18T00:42:24
|
|
Properly tag all `enums` with a `_t`
|
|
41a82592
|
2012-05-15T14:17:39
|
|
Ranged iterators and rewritten git_status_file
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.
|
|
dc13f1f7
|
2012-05-10T11:08:59
|
|
Add cache busting to attribute cache
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.
|
|
4b136a94
|
2012-03-23T09:26:09
|
|
Fix crash in new status and add recurse option
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.
|
|
66142ae0
|
2012-03-22T10:44:36
|
|
New status fixes
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.
|
|
95340398
|
2012-03-22T09:17:34
|
|
Adding new tests for new status command
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.
|
|
a48ea31d
|
2012-03-21T12:33:09
|
|
Reimplment git_status_foreach using git diff
This is an initial reimplementation of status using diff a la
the way that core git does it.
|
|
e1bcc191
|
2012-03-01T11:45:00
|
|
Revert GIT_STATUS constants to avoid issues
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.
|
|
74fa4bfa
|
2012-02-28T16:14:47
|
|
Update diff to use iterators
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.
|
|
5e0de328
|
2012-02-13T17:10:24
|
|
Update Copyright header
Signed-off-by: schu <schu-github@schulog.org>
|
|
cfbc880d
|
2012-01-16T15:16:44
|
|
Patch cleanup for merge
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
|
|
df743c7d
|
2012-01-09T15:37:19
|
|
Initial implementation of gitignore support
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).
|
|
87d9869f
|
2011-09-19T03:34:49
|
|
Tabify everything
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.
|
|
bb742ede
|
2011-09-19T01:54:32
|
|
Cleanup legal data
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.
|
|
56453d34
|
2011-09-02T13:44:42
|
|
status: enhance determination of status for a single file
- fix retrieval of a file status when working against a newly initialized repository
- reduce memory pressure
- prevents a directory from being tested
|
|
d9111722
|
2011-09-13T12:30:25
|
|
Standardized doxygen @return lines for int functions to say "GIT_SUCCESS or an error code".
|
|
c52736fa
|
2011-07-09T15:05:14
|
|
status: Cleanup
The `hashfile` function has been moved to ODB, next to `git_odb_hash`.
Global state has been removed from the dirent call in `status.c`,
because global state is killing the rainforest and causing global
warming.
|
|
3af6b34a
|
2011-06-22T18:31:20
|
|
status: get file statuses and run callback
Add git_status_foreach() to run a callback on each file passing the path
and a status value.
|
|
205166d2
|
2011-06-22T18:19:46
|
|
status: get blob object id of file on disk
Add git_status_hashfile() to get blob's object id for a file without adding
it to the object database or needing a repository at all.
This functionality is similar to `git hash-object` without '-w'.
|
|
20361b2f
|
2011-06-23T18:51:22
|
|
status: get status for single file
Add git_status_file to be able to retrieve status of single file by
supplying a path.
|