summaryrefslogtreecommitdiff
path: root/include/git2/submodule.h
Commit message (Collapse)AuthorAgeFilesLines
* Play nice with the docs.typedef-submodule-cbjoshaber2015-12-081-5/+4
|
* Use a typedef for the submodule_foreach callback.joshaber2015-12-081-1/+13
| | | | | | This fits with the style for the rest of the project, but more importantly, makes life easier for bindings authors who auto-generate code.
* submodule: completely remove reload_allCarlos Martín Nieto2015-07-011-11/+0
| | | | | | | | The function was removed, but its declaration and changelog entry about its removal were forgotten. The comment in the test doesn't make any sense as the function doesn't exist anymore, so get rid of it as well.
* submodule: remove the RESET enum valuescmn/submodule-config-stateCarlos Martín Nieto2015-06-221-3/+1
| | | | | These are not useful anymore, as we don't affect the instance's configuration.
* submodule: get rid of `_save()`Carlos Martín Nieto2015-06-221-14/+0
| | | | | We no longer have any setters which affect an instance, so `git_submodule_save()` is no longer relevant.
* submodule: make `_set_url()` affect the configurationCarlos Martín Nieto2015-06-221-7/+5
| | | | With this one, we can get rid of the edit_and_save test.
* submodule: make `_set_branch()` affect the configurationCarlos Martín Nieto2015-06-221-8/+5
|
* submodule: make `_set_update_fetch_recurse_submodules()` affect the configCarlos Martín Nieto2015-06-221-7/+7
| | | | | | Similarly to the other ones. In this test we copy over testing `RECURSE_YES` which shows an error in our handling of the `YES` variant which we may have to port to the rest.
* submodule: make `_set_update()` affect the configurationCarlos Martín Nieto2015-06-221-13/+8
| | | | | Moving on with the removal of runtime-changing variables, the update setting for a remote is whatever it was when it was looked up.
* submodule: add an ignore option to statusCarlos Martín Nieto2015-06-221-1/+3
| | | | | | | | | | | | | This lets us specify in the status call which ignore rules we want to use (optionally falling back to whatever the submodule has in its configuration). This removes one of the reasons for having `_set_ignore()` set the value in-memory. We re-use the `IGNORE_RESET` value for this as it is no longer relevant but has a similar purpose to `IGNORE_FALLBACK`. Similarly, we remove `IGNORE_DEFAULT` which does not have use outside of initializers and move that to fall back to the configuration as well.
* submodule: don't let status change an existing instanceCarlos Martín Nieto2015-06-221-4/+5
| | | | | | As submodules are becomes more like values, we should not let a status check to update its properties. Instead of taking a submodule, have status take a repo and submodule name.
* submodule: make set_ignore() affect the configurationCarlos Martín Nieto2015-06-221-16/+8
| | | | | Instead of affecting a particular instance, make it change the configuration.
* Remove the callbacks struct from the remoteCarlos Martín Nieto2015-05-131-3/+5
| | | | | | | | | | | | | | Having the setting be different from calling its actions was not a great idea and made for the sake of the wrong convenience. Instead of that, accept either fetch options, push options or the callbacks when dealing with the remote. The fetch options are currently only the callbacks, but more options will be moved from setters and getters on the remote to the options. This does mean passing the same struct along the different functions but the typical use-case will only call git_remote_fetch() or git_remote_push() and so won't notice much difference.
* Implement git_submodule_set_branch.Patrick Steinhardt2015-04-121-0/+16
|
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-6/+0
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* checkout: remove `GIT_CHECKOUT_SAFE_CREATE` as a strategyEdward Thomson2015-02-271-3/+3
|
* Add extern function to initialize submodule update options.David Calavera2015-01-071-3/+18
|
* Introduce a convenience function for submodule updatejamill/submodule_updateJameson Miller2014-12-221-1/+65
| | | | | | | | | This introduces the functionality of submodule update in 'git_submodule_do_update'. The existing 'git_submodule_update' function is renamed to 'git_submodule_update_strategy'. The 'git_submodule_update' function now refers to functionality similar to `git submodule update`, while `git_submodule_update_strategy` is used to get the configured value of submodule.<name>.update.
* Spelling fixesWill Stamper2014-12-041-1/+1
|
* Introduce option to use relative paths for repository work directoryjamill/relative_gitlinkJameson Miller2014-09-021-0/+18
| | | | | | | Teach git_repository_init_ext to use relative paths for the gitlink to the work directory. This is used when creating a sub repository where the sub repository resides in the parent repository's .git directory.
* Fixed miscellaneous documentation errors.Michael Anderson2014-05-231-1/+1
|
* Fix segfault if gitmodules is invalidRussell Belfer2014-03-261-3/+3
| | | | | | The reload_all call could end up dereferencing a NULL pointer if there was an error while attempting to load the submodules config data (i.e. invalid content in the gitmodules file). This fixes it.
* Make submodules externally refcountedRussell Belfer2014-03-251-14/+30
| | | | | | | | `git_submodule` objects were already refcounted internally in case the submodule name was different from the path at which it was stored. This makes that refcounting externally used as well, so `git_submodule_lookup` and `git_submodule_add_setup` return an object that requires a `git_submodule_free` when done.
* Add git_submodule_resolve_url()Jan Melcher2014-03-101-0/+10
|
* Make submodule fetchRecurse match other optionsRussell Belfer2014-01-301-13/+0
| | | | | | This removes the fetchRecurse compiler warnings and makes the behavior match the other submodule options (i.e. the in-memory setting can be reset to the on-disk value).
* "Uninitialized" submodules are "unmodified"Edward Thomson2014-01-201-1/+2
| | | | | | Extend the "unmodified" submodule workdir test to include uninitialized submodules, to prevent reporting submodules as modified when they're not in the workdir at all.
* Merge pull request #2022 from KTXSoftware/developmentRussell Belfer2014-01-031-0/+8
|\ | | | | submodule branch option + little VS2013 fix
| * Read the submodule branch option from Git 1.8.2.Robert Konrad2014-01-021-0/+8
| |
* | Fix warnings with submodule changesRussell Belfer2014-01-021-1/+1
|/
* Accept 'submodule.*.fetchRecurseSubmodules' config 'on-demand' valueLinquize2013-12-311-2/+15
|
* Update submodule documentationRussell Belfer2013-08-051-14/+37
| | | | Fixes #1762
* Add ignore_submodules to diff optionsRussell Belfer2013-07-101-43/+10
| | | | | | | | | | | | | | | | | | | | This adds correct support for an equivalent to --ignore-submodules in diff, where an actual ignore value can be passed to diff to override the per submodule settings in the configuration. This required tweaking the constants for ignore values so that zero would not be used and could represent an unset option to the diff. This was an opportunity to move the submodule values into include/git2/types.h and to rename the poorly named DEFAULT values for ignore and update constants to RESET instead. Now the GIT_DIFF_IGNORE_SUBMODULES flag is exactly the same as setting the ignore_submodules option to GIT_SUBMODULE_IGNORE_ALL (which is actually a minor change from the old behavior in that submodules will now be treated as UNMODIFIED deltas instead of being left out totally - if you set GIT_DIFF_INCLUDE_UNMODIFIED). This includes tests for the various new settings.
* Submodule status improvementsRussell Belfer2013-07-101-13/+3
| | | | | | | | | | | | | | | This fixes the way that submodule status is checked to bypass just about all of the caching in the submodule object. Based on the ignore value, it will try to do the minimum work necessary to find the current status of the submodule - but it will actually go to disk to get all of the current values. This also removes the custom refcounting stuff in favor of the common git_refcount style. Right now, it is still for internal purposes only, but it should make it easier to add true submodule refcounting in the future with a public git_submodule_free call that will allow bindings not to worry about the submodule object getting freed from underneath them.
* Fixed most documentation header bugsAndreas Linde2013-06-241-2/+2
| | | | | | | | | | | Fixed a few header @param and @return typos with the help of -Wdocumentation in Xcode. The following warnings have not been fixed: common.h:213 - Not sure how the documentation format is for '...' notes.h:102 - Correct @param name but empty text notes.h:111 - Correct @param name but empty text pack.h:140 - @return missing text pack.h:148 - @return missing text
* Update diff handling of untracked directoriesRussell Belfer2013-04-301-14/+14
| | | | | | | | | | When diff encounters an untracked directory, there was a shortcut that it took which is not compatible with core git. This makes the default behavior no longer take that shortcut and instead look inside the untracked directory to see if there are any untracked files within it. If there are not, then the directory is treated as an ignore directory instead of an untracked directory. This has implications for the git_status APIs.
* Tests and more fixes for submodule diffsRussell Belfer2013-04-091-3/+20
| | | | | | | | | | | | | This adds tests for diffs with submodules in them and (perhaps unsurprisingly) requires further fixes to be made. Specifically, this fixes: - when considering if a submodule is dirty in the workdir, it was being treated as dirty even if only the index was dirty. - git_diff_patch_to_str (and git_diff_patch_print) were "printing" the headers for files (and submodules) that were unmodified or had no meaningful content. - added comment to previous fix and removed unneeded parens.
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Submodule caching fix and location APIRussell Belfer2013-01-041-0/+18
| | | | | | | | | | This adds a new API to the submodule interface that just returns where information about the submodule was found (e.g. config file only or in the HEAD, index, or working directory). Also, the old "refresh" call was potentially keeping some stale submodule data around, so this simplfies that code and literally discards the old cache, then reallocates.
* API updates for submodule.hRussell Belfer2012-11-271-3/+3
|
* Add test for diffs with submodules and bug fixesRussell Belfer2012-10-081-2/+9
| | | | | | | | The adds a test for the submodule diff capabilities and then fixes a few bugs with how the output is generated. It improves the accuracy of OIDs in the diff delta object and makes the submodule output more closely mirror the OIDs that will be used by core git.
* Add missing accessor for fetchRecurseSubmodulesRussell Belfer2012-09-071-0/+29
| | | | | | When `git_submodule` became an opaque structure, I forgot to add accessor functions for the fetchRecurseSubmodules config setting. This fixes that.
* Working implementation of git_submodule_statusRussell Belfer2012-08-241-91/+86
| | | | | | | | | | | | | This is a big redesign of the git_submodule_status API and the implementation of the redesigned API. It also fixes a number of bugs that I found in other parts of the submodule API while writing the tests for the status part. This also fixes a couple of bugs in the iterators that had not been noticed before - one with iterating when there is a gitlink (i.e. separate-work-dir) and one where I was treating anything even vaguely submodule-like as a submodule, more aggressively than core git does.
* Major submodule rewriteRussell Belfer2012-08-241-45/+420
| | | | | This replaces the old submodule API with a new extended API that supports most of the things that can be done with `git submodule`.
* Fix spelling errors.Bruce Mitchener2012-05-191-1/+1
|
* 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.