Commit Graph

1937 Commits

Author SHA1 Message Date
Edward Thomson
ef206124de Move filelist into the iterator handling itself. 2015-08-28 18:39:52 -04:00
Carlos Martín Nieto
57af0b928e cred: add a free function wrapper 2015-08-19 02:23:18 +02:00
Carlos Martín Nieto
47ed7e5acd transport: provide a way to get the callbacks
libgit2 implementations of smart subtransports can simply reach through
the structure, but external implementors cannot.

Add these two functions as a way for the smart subtransports to get the
callbacks as set by the user.
2015-08-19 02:23:18 +02:00
Carlos Martín Nieto
5340d63d38 config: perform unlocking via git_transaction
This makes the API for commiting or discarding changes the same as for
references.
2015-08-12 04:09:38 +02:00
Carlos Martín Nieto
36f784b538 config: expose locking via the main API
This lock/unlock pair allows for the cller to lock a configuration file
to avoid concurrent operations.

It also allows for a transactional approach to updating a configuration
file. If multiple updates must be made atomically, they can be done
while the config is locked.
2015-08-12 04:09:38 +02:00
Carlos Martín Nieto
b166703964 config: implement basic transactional support
When a configuration file is locked, any updates made to it will be done
to the in-memory copy of the file. This allows for multiple updates to
happen while we hold the lock, preventing races during complex
config-file manipulation.
2015-08-12 04:09:09 +02:00
Michael Procter
25dbcf3499 Make giterr_detach no longer public 2015-08-03 15:23:17 +01:00
Carlos Martín Nieto
c400bac4db Merge pull request #3332 from phatblat/ben/doc-warnings
Resolve documentation warnings
2015-08-01 15:38:04 +02:00
Ben Chatelain
08afd227df Fix remaining documentation warnings 2015-07-27 18:32:55 -06:00
Ben Chatelain
f90fbb8d22 Use correct Doxygen trailing comment syntax 2015-07-27 17:42:08 -06:00
Ben Chatelain
41808d0470 Fix @param names in doc comments 2015-07-27 14:46:50 -06:00
Edward Thomson
759b2230a5 Merge pull request #3303 from libgit2/cmn/index-add-submodule
Allow adding a submodule through git_index_add_bypath
2015-07-24 15:04:20 -05:00
Edward Thomson
91dad18143 Merge pull request #3305 from libgit2/cmn/reflog-del-backend
refdb: delete a ref's reflog upon deletion
2015-07-24 15:01:04 -05:00
Ryan Roden-Corrent
37996d474b Document git_fetch_options struct and fix typo.
git_fetch_options was missing from the API docs because it lacked a
documentation comment above the struct declaration.
I used the git_checkout_options docstring as a template.

Also fixes a typo in git_remote_prune_refs (remote, not reamote).
2015-07-20 09:48:01 -04:00
Carlos Martín Nieto
01d0c02dba refdb: delete a ref's reflog upon deletion
Removing a reflog upon ref deletion is something which only some
backends might wish to do. Backends which are database-backed may wish
to archive a reflog, log-based ones may not need to do anything.
2015-07-12 19:08:06 +02:00
Carlos Martín Nieto
8a52ed7a48 errors: add EDIRECTORY
This is to be returned when the operation which the user asked for is
not possible to do on a directory.
2015-07-12 12:11:22 +02:00
Edward Thomson
79698030b0 git_cert: child types use proper base type 2015-07-10 09:28:33 -05:00
Carlos Martín Nieto
9847d80ddc Merge pull request #3281 from ethomson/wildcard_filters
filters: custom filters with wildcard attributes
2015-07-09 18:21:31 +02:00
Carlos Martín Nieto
3704ac35d3 Merge pull request #3277 from git-up/git_diff_index_to_index
Added git_diff_index_to_index()
2015-07-07 12:38:47 +02:00
Carlos Martín Nieto
a94d3e68bf filter: add docs for streaming filters
These functions are available on the public API but don't have any
documentation, so they don't appear on the API reference. Fix that.
2015-07-03 14:36:41 +02:00
Carlos Martín Nieto
34065968ed submodule: completely remove reload_all
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.
2015-07-01 17:49:07 +02:00
Edward Thomson
63924435a1 filters: custom filters with wildcard attributes
Allow custom filters with wildcard attributes, so that clients
can support some random `filter=foo` in a .gitattributes and look
up the corresponding smudge/clean commands in the configuration file.
2015-07-01 09:40:11 -05:00
Pierre-Olivier Latour
ccef5adb63 Added git_diff_index_to_index() 2015-06-30 10:03:32 -07:00
Carlos Martín Nieto
84d5a98f80 Bump version to 0.23.0 and SOVERSION to 23 2015-06-28 14:53:30 +02:00
Carlos Martín Nieto
354268ca48 Merge pull request #3259 from ethomson/stash_apply_argh
Stash apply: stage new files even when not updating the index
2015-06-26 17:46:35 +02:00
Edward Thomson
c0280bdd15 Merge pull request #3255 from libgit2/cmn/rename-unspecified
Rename FALLBACK to UNSPECIFIED
2015-06-25 18:55:48 -04:00
Edward Thomson
82b1c93d08 stash: don't allow apply with staged changes 2015-06-25 18:34:36 -04:00
Edward Thomson
87987fd1e0 Merge pull request #3246 from libgit2/cmn/dont-grow-borrowed
Don't allow growing borrowed buffers
2015-06-25 15:26:43 -04:00
Carlos Martín Nieto
c2418f4613 Rename FALLBACK to UNSPECIFIED
Fallback describes the mechanism, while unspecified explains what the
user is thinking.
2015-06-25 12:48:44 +02:00
Carlos Martín Nieto
189aad45af errors: introduce EINVALID
We've been using EINVALIDSPEC for a while to mean this, but that name
is too specific. Introduce this to be more explicit.
2015-06-24 23:49:10 +02:00
Carlos Martín Nieto
bd470d0034 blob: don't recomment using git_buf_grow
We currently recommend using `git_buf_grow` in order to make a buffer
make an owned copy of the memory it points to. This is not behaviour we
should encourage, so remove this recommendation.

The function itself is not changed, as we need to remain compatible, but
it will be changed not to allow usage on borrowed buffers.
2015-06-24 23:49:10 +02:00
Carlos Martín Nieto
daacf96d10 Merge pull request #3097 from libgit2/cmn/submodule-config-state
Remove run-time configuration settings from submodules
2015-06-24 23:34:40 +02:00
Carlos Martín Nieto
cdee630f6f curl: extract certificate information
The information is exposed by curl for some crypto libraries in the form
of name:content strings. We can't do much more than return this
information.
2015-06-24 17:26:36 +02:00
Carlos Martín Nieto
1376e784c6 stream: add support for setting a proxy
If the stream claims to support this feature, we can let the transport
set the proxy.

We also set HTTPPROXYTUNNEL option so curl can create a tunnel through
the proxy which lets us create our own TLS session (if needed).
2015-06-24 17:26:36 +02:00
Edward Thomson
09f3364d7a Merge pull request #3131 from urkud/const-char
Add `const` qualifier
2015-06-23 23:40:02 -04:00
Carlos Martín Nieto
783672fa5b submodule: remove the RESET enum values
These are not useful anymore, as we don't affect the instance's
configuration.
2015-06-22 17:02:56 +02:00
Carlos Martín Nieto
961861fafa submodule: get rid of _save()
We no longer have any setters which affect an instance, so
`git_submodule_save()` is no longer relevant.
2015-06-22 17:02:55 +02:00
Carlos Martín Nieto
d6073b30f3 submodule: make _set_url() affect the configuration
With this one, we can get rid of the edit_and_save test.
2015-06-22 17:02:55 +02:00
Carlos Martín Nieto
486ba4cdd3 submodule: make _set_branch() affect the configuration 2015-06-22 17:02:55 +02:00
Carlos Martín Nieto
4e63642321 submodule: make _set_update_fetch_recurse_submodules() affect the config
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.
2015-06-22 17:02:55 +02:00
Carlos Martín Nieto
e8a39f8ed1 submodule: make _set_update() affect the configuration
Moving on with the removal of runtime-changing variables, the update
setting for a remote is whatever it was when it was looked up.
2015-06-22 17:02:55 +02:00
Carlos Martín Nieto
c6f489c964 submodule: add an ignore option to status
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.
2015-06-22 17:02:55 +02:00
Carlos Martín Nieto
64bbd47a32 submodule: don't let status change an existing instance
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.
2015-06-22 17:02:55 +02:00
Carlos Martín Nieto
5a9fc6c83c submodule: make set_ignore() affect the configuration
Instead of affecting a particular instance, make it change the
configuration.
2015-06-22 17:02:55 +02:00
Carlos Martín Nieto
a3f42fe8e4 commit: allow retrieving an arbitrary header field
This allows the user to look up fields which we don't parse in libgit2,
and allows them to access gpgsig or mergetag fields if they wish to
check the signature.
2015-06-22 15:56:31 +02:00
Carlos Martín Nieto
5e947c91d4 index: use the checksum to check whether it's been modified
We currently use a timetamp to check whether an index file has been
modified since we last read it, but this is racy. If two updates happen
in the same second and we read after the first one, we won't detect the
second one.

Instead read the SHA-1 checksum of the file, which are its last 20 bytes which
gives us a sure-fire way to detect whether the file has changed since we
last read it.

As we're now keeping track of it, expose an accessor to this data.
2015-06-19 22:05:08 +02:00
Edward Thomson
8147b1aff5 diff: introduce binary diff callbacks
Introduce a new binary diff callback to provide the actual binary
delta contents to callers.  Create this data from the diff contents
(instead of directly from the ODB) to support binary diffs including
the workdir, not just things coming out of the ODB.
2015-06-12 09:39:20 -04:00
Carlos Martín Nieto
2deb36081c Merge pull request #3155 from mgorny/userpass-const
cred_helpers: Add 'const' qualifiers to git_cred_userpass_payload
2015-06-11 08:54:48 +02:00
Edward Thomson
2eecc2886b Introduce git_filter_list_contains
`git_filter_list_contains` can be used to query a filter list to
determine if a given filter will be run.
2015-06-10 14:43:49 -04:00
Patrick Steinhardt
ec0c4c4001 remote: apply insteadOf configuration.
A remote's URLs are now modified according to the url.*.insteadOf
and url.*.pushInsteadOf configurations. This allows a user to
replace URL prefixes by setting the corresponding keys. E.g.
"url.foo.insteadOf = bar" would replace the prefix "bar" with the
new prefix "foo".
2015-05-31 13:21:53 +02:00
Carlos Martín Nieto
2c8550f040 Merge pull request #3157 from mgorny/ssh_memory_auth
Support getting SSH keys from memory, pt. 2
2015-05-29 19:38:11 +02:00
Edward Thomson
885b94aac0 Rename GIT_EMERGECONFLICT to GIT_ECONFLICT
We do not error on "merge conflicts"; on the contrary, merge conflicts
are a normal part of merging.  We only error on "checkout conflicts",
where a change exists in the index or the working directory that would
otherwise be overwritten by performing the checkout.

This *may* happen during merge (after the production of the new index
that we're going to checkout) but it could happen during any checkout.
2015-05-29 09:55:09 -04:00
Carlos Martín Nieto
ff8d635adb Merge pull request #3139 from ethomson/diff_conflicts
Include conflicts when diffing
2015-05-28 18:45:57 +02:00
Carlos Martín Nieto
2b92283221 Merge pull request #3127 from libgit2/cmn/remote-fixups
Tackle remote API issues from bindings
2015-05-28 16:09:17 +02:00
Edward Thomson
10549a2df1 Introduce GIT_DIFF_FLAG_EXISTS
Mark the `old_file` and `new_file` sides of a delta with a new bit,
`GIT_DIFF_FLAG_EXISTS`, that introduces that a particular side of
the delta exists in the diff.

This is useful for indicating whether a working directory item exists
or not, in the presence of a conflict.  Diff users may have previously
used DELETED to determine this information.
2015-05-28 09:47:47 -04:00
Edward Thomson
9f545b9d71 introduce git_index_entry_is_conflict
It's not always obvious the mapping between stage level and
conflict-ness.  More importantly, this can lead otherwise sane
people to write constructs like `if (!git_index_entry_stage(entry))`,
which (while technically correct) is unreadable.

Provide a nice method to help avoid such messy thinking.
2015-05-28 09:47:31 -04:00
Edward Thomson
7c94801400 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.
2015-05-28 09:44:02 -04:00
Edward Thomson
ecd60a56eb conflicts: when adding conflicts, remove staged
When adding a conflict for some path, remove the staged entry.
Otherwise, an illegal index (with both stage 0 and high-stage
entries) would result.
2015-05-28 09:43:49 -04:00
Carlos Martín Nieto
c6e942fb3d remote: validate refspecs before adding to config
When we moved from acting on the instance to acting on the
configuration, we dropped the validation of the passed refspec, which
can lead to writing an invalid refspec to the configuration. Bring that
validation back.
2015-05-28 15:32:20 +02:00
Carlos Martín Nieto
ae5b93629c remote: remove fetch parameter from create_anonymous
An anonymous remote is not configured and cannot therefore have
configured refspecs. Remove the parameter which adds this from the
constructor.
2015-05-28 15:32:20 +02:00
Michał Górny
f7142b5e4a cred: Declare GIT_CREDTYPE_SSH_MEMORY unconditionally
Declare GIT_CREDTYPE_SSH_MEMORY to have consistent API independently of
whether libgit2 was built with or without in-memory key passing support.
Or rather, to have it at all since build-time definitions are not stored
in headers.
2015-05-27 20:36:53 +02:00
David Calavera
08e6b875c1 Return an error when ssh memory credentials are not supported.
To not modify the external api.
2015-05-27 20:36:53 +02:00
David Calavera
7a8b85032f Add support to read ssh keys from memory. 2015-05-27 20:36:53 +02:00
Michał Górny
462865d702 cred_helpers: Add 'const' qualifiers to git_cred_userpass_payload
Make both username & password in git_cred_userpass_payload 'const'.
The values are not altered anywhere, and the extra qualifier allows
clients to assign 'const' values there.
2015-05-24 13:18:30 +02:00
Jason Haslam
d30155f2f9 Fix error when building as C++. 2015-05-20 14:26:05 -06:00
Carlos Martín Nieto
cd3f3c2844 Add a missing include for reset
Our doc parser really wants the types to be declared in the header it's
reading.
2015-05-20 21:06:01 +02:00
Carlos Martín Nieto
1396c38178 errors: add GIT_EEOF to indicate early EOF
This can be used by tools to show mesages about failing to communicate
with the server. The error message in this case will often contain the
server's error message, as far as it managed to send anything.
2015-05-20 15:08:39 +02:00
Carlos Martín Nieto
70f7484d2a remote: get rid of the run-time refspec setters
These were left over from the culling as it's not clear which use-cases
might benefit from this. It is not clear that we want to support any
use-case which depends on changing the remote's idea of the base
refspecs rather than passing in different per-operation refspec list, so
remove these functions.
2015-05-17 15:45:37 +02:00
Yury G. Kudryashov
c8022e6ce7 Add const qualifier
This fixes a warning in `examples/describe.c` without breaking the main build.

OTOH, I'm not sure if this is an API-compatible change.
2015-05-15 00:34:43 +03:00
Edward Thomson
a6f2ceaf48 Merge pull request #3118 from libgit2/cmn/stream-size
odb: make the writestream's size a git_off_t
2015-05-13 12:11:55 -04:00
Edward Thomson
d01737b419 Merge pull request #3117 from libgit2/cmn/index-more-accurate
index: make the entries have more accurate sizes
2015-05-13 09:11:38 -04:00
Carlos Martín Nieto
a4b6452a6a remote: remove git_remote_save()
It has now become a no-op, so remove the function and all references to
it.
2015-05-13 09:46:36 +02:00
Carlos Martín Nieto
7725499072 remote: remove live changing of refspecs
The base refspecs changing can be a cause of confusion as to what is the
current base refspec set and complicate saving the remote's
configuration.

Change `git_remote_add_{fetch,push}()` to update the configuration
instead of an instance.

This finally makes `git_remote_save()` a no-op, it will be removed in a
later commit.
2015-05-13 09:46:36 +02:00
Carlos Martín Nieto
35a8a8c546 remote: move the tagopt setting to the fetch options
This is another option which we should not be keeping in the remote, but
is specific to each particular operation.
2015-05-13 09:46:36 +02:00
Carlos Martín Nieto
3eff2a5728 remote: move the update_fetchhead setting to the options
While this will rarely be different from the default, having it in the
remote adds yet another setting it has to keep around and can affect its
behaviour. Move it to the options.
2015-05-13 09:46:36 +02:00
Carlos Martín Nieto
058b753ceb remote: move the transport ctor to the callbacks
Instead of having it set in a different place from every other callback,
put it the main structure. This removes some state from the remote and
makes it behave more like clone, where the constructors are passed via
the options.
2015-05-13 09:46:36 +02:00
Carlos Martín Nieto
6fb373a0e8 remote: add prune option to fetch
Add a prune setting in the fetch options to allow to fall back to the
configuration (the default) or to set it on or off.
2015-05-13 09:46:36 +02:00
Carlos Martín Nieto
22261344de remote: remove url and pushurl from the save logic
As a first step in removing the repository-saving logic, don't allow
chaning the url or push url from a remote object, but change the
configuration on the configuration immediately.
2015-05-13 09:46:36 +02:00
Carlos Martín Nieto
8f0104ecc5 Remove the callbacks struct from the remote
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.
2015-05-13 09:46:35 +02:00
Carlos Martín Nieto
77b339f7b6 odb: make the writestream's size a git_off_t
Restricting files to size_t is a silly limitation. The loose backend
writes to a file directly, so there is no issue in using 63 bits for the
size.

We still assume that the header is going to fit in 64 bytes, which does
mean quite a bit smaller files due to the run-length encoding, but it's
still a much larger size than you would want Git to handle.
2015-05-13 09:34:20 +02:00
Carlos Martín Nieto
ca29427979 index: make the entries have more accurate sizes
While we are confident about the size of an int in architectures we're
likely to care about, the index format is defined by the exact size of
the fields. Use the definitions which show the exact width of the entry
fields.

As part of that, bring back 32-bit time and size fields, which currently
are 64 bits wide and can bring a false sense of security in how much
data they really store. Document that these fields are not to be taken
as authoritative.
2015-05-12 11:43:27 +02:00
Edward Thomson
1f1f5c639e checkout: better document the baseline_index opt 2015-05-11 14:13:31 -04:00
Edward Thomson
4ea3eebf4b stash_apply: provide progress callbacks 2015-05-11 14:12:42 -04:00
Edward Thomson
19c80a6fd1 stash_apply: provide its own options structure 2015-05-11 14:12:39 -04:00
Edward Thomson
12149a20ef stash apply: default to at least GIT_CHECKOUT_SAFE 2015-05-11 14:12:31 -04:00
Edward Thomson
958950b6e0 stash: document merge conflicts 2015-05-11 14:12:23 -04:00
Edward Thomson
f0957589ee stash: refactor to use merge_iterators 2015-05-11 14:12:19 -04:00
Edward Thomson
73dce1f688 checkout: allow baseline to be specified as index
Allow the baseline to be specified as an index, so that users
need not write their index to a tree just to checkout with that
as the baseline.
2015-05-11 14:12:01 -04:00
Pierre-Olivier Latour
bf8dd3f53d Added git_stash_apply() and git_stash_pop() APIs 2015-05-11 14:11:53 -04:00
Edward Thomson
4beab1f8bb checkout: break case-changes into delete/add
When checking out with a case-insensitive working directory, we
want to change the case of items in the working directory to
reflect changes that occured in the checkout target.  Diff now
has an option to break case-changing renames into delete/add.
2015-05-04 07:18:28 -05:00
Edward Thomson
cbe8a61dfa Merge pull request #3059 from libgit2/cmn/negotiation-notify
[WIP/RFC] push: report the update plan to the caller
2015-05-01 11:28:54 -04:00
Jameson Miller
bf2ba5290a Update documentation for API changes 2015-04-30 10:59:50 -04:00
Edward Thomson
aa9bb425a9 rebase: correct documentation, CHANGELOG 2015-04-20 17:22:39 -04:00
Edward Thomson
94c988f6d6 rebase: include checkout opts within rebase opts 2015-04-20 17:19:08 -04:00
Edward Thomson
f3a199dd99 rebase: init and open take a rebase_options
`git_rebase_init` and `git_rebase_open` should take a
`git_rebase_options` and use it for future rebase operations on
that `rebase` object.
2015-04-20 16:22:54 -04:00
Edward Thomson
5ae38538c6 rebase: take checkout_options where appropriate 2015-04-20 16:22:49 -04:00
Edward Thomson
649834fd6e reset: git_checkout_options is const 2015-04-20 16:22:44 -04:00
Edward Thomson
30640aa9ad rebase: identify a rebase that has not started
In `git_rebase_operation_current()`, indicate when a rebase has not
started (with `GIT_REBASE_NO_OPERATION`) rather than conflating that
with the first operation being in-progress.
2015-04-20 16:22:27 -04:00
Carlos Martín Nieto
efc2fec50e push: report the update plan to the caller
It can be useful for the caller to know which update commands will be
sent to the server before the packfile is pushed up. git does this via
the pre-push hook.

We don't have hooks, but as it adds introspection into what is
happening, we can add a callback which performs the same function.
2015-04-19 01:02:29 +02:00
Edward Thomson
a0e652d281 Merge pull request #2999 from pks-t/submodule-set-url
Implement git_submodule_set_branch.
2015-04-17 12:35:41 -05:00
Edward Thomson
6f80bf4afb Merge pull request #3037 from libgit2/cmn/hide-then-push
Handle hide-then-push in the revwalk
2015-04-16 19:12:28 -05:00
Carlos Martín Nieto
05d9202678 revwalk: reword the push text
As it seems it's not quite clear what it means to push a commit, try to
be more explicit about adding a new root and that we may not see this
commit if it is hidden.
2015-04-13 18:03:03 +02:00
Patrick Steinhardt
129788a623 Implement git_submodule_set_branch. 2015-04-12 10:51:08 +02:00
Edward Thomson
623fbd93f1 Merge pull request #2974 from libgit2/cmn/clone-everything
Make sure to pack referenced objects for non-branches
2015-04-10 11:38:07 +02:00
Pierre-Olivier Latour
807566d554 Entry argument passed to git_index_add_frombuffer() should be const 2015-04-03 18:59:11 -07:00
Edward Thomson
c5e071873c Merge pull request #2990 from leoyanggit/custom_param
Add a custom param to git_smart_subtransport_definition
2015-03-24 14:03:51 -04:00
Edward Thomson
95d1624b8d Merge pull request #2947 from libgit2/cmn/notes-buf
note: use a git_buf to return the default namespace
2015-03-24 08:34:12 -04:00
Edward Thomson
89ba9f1acc Merge pull request #2967 from jacquesg/merge-whitespace
Allow merges of files (and trees) with whitespace problems/fixes
2015-03-18 13:17:04 -04:00
Leo Yang
142e5379ca Add a custom param to git_smart_subtransport_definition
The smart transport has already take the payload param. For the
sub transport a payload param is useful for the implementer.
2015-03-18 13:15:21 -04:00
Carlos Martín Nieto
a61fa4c0c7 packbuilder: introduce git_packbuilder_insert_recur()
This function recursively inserts the given object and any referenced
ones. It can be thought of as a more general version of the functions to
insert a commit or tree.
2015-03-17 20:51:14 +01:00
Carlos Martín Nieto
385449b1df note: use a git_buf to return the default namespace
The caller has otherwise no way to know how long the string will be
allocated or ability to free it.

This fixes #2944.
2015-03-17 20:50:02 +01:00
Edward Thomson
9bbc8f350b Merge pull request #2962 from libgit2/cmn/reflog-annotated
Add annotated versions of ref-modying functions
2015-03-17 10:21:28 -04:00
Edward Thomson
7800048afb Merge pull request #2972 from libgit2/cmn/pack-objects-walk
[WIP] Smarter pack-building
2015-03-17 10:06:50 -04:00
Carlos Martín Nieto
62dd4d71db annotated_commit: provide a constructor from a revspec
This extra constructor will be useful for the annotated versions of
ref-modifying functions, as it allows us to create a commit with the
extended sha syntax which was used to retrieve it.
2015-03-16 16:57:30 +01:00
Carlos Martín Nieto
62d38a1ddb Add annotated commit versions of reflog-modifying functions
We do not always want to put the id directly into the reflog, but we
want to speicfy what a user typed. For this use-case we provide
annotated version of a few functions which let the caller specify what
user-friendly name was used when asking for the operation.
2015-03-16 16:57:30 +01:00
Jacques Germishuys
74c37c2a48 Added options to enable patience and minimal diff drivers 2015-03-16 09:53:27 +02:00
Jacques Germishuys
13de936316 Collapse whitespace flags into git_merge_file_flags_t 2015-03-16 09:53:27 +02:00
Jacques Germishuys
f29dde6828 Renamed git_merge_options 'flags' to 'tree_flags' 2015-03-16 09:53:27 +02:00
Jacques Germishuys
45a86bbfd0 Allow for merges with whitespace discrepancies 2015-03-16 09:53:27 +02:00
Carlos Martín Nieto
15f581747c Merge commit 'refs/pull/2879/head' of ssh://github.com/libgit2/libgit2 2015-03-11 17:55:39 +01:00
Carlos Martín Nieto
04a36feff1 pack-objects: fill a packbuilder from a walk
Most use-cases for the object packer communicate in terms of commits
which each side has. We already have an object to specify this
relationship between commits, namely git_revwalk.

By knowing which commits we want to pack and which the other side
already has, we can perform similar optimisations to git, by marking
each tree as interesting or uninteresting only once, and not sending
those trees which we know the other side has.
2015-03-11 02:36:11 +01:00
Carlos Martín Nieto
9a97f49e3a config: borrow refcounted references
This changes the get_entry() method to return a refcounted version of
the config entry, which you have to free when you're done.

This allows us to avoid freeing the memory in which the entry is stored
on a refresh, which may happen at any time for a live config.

For this reason, get_string() has been forbidden on live configs and a
new function get_string_buf() has been added, which stores the string in
a git_buf which the user then owns.

The functions which parse the string value takea advantage of the
borrowing to parse safely and then release the entry.
2015-03-03 18:35:12 +01:00
Carlos Martín Nieto
4e498646b6 repository: remove log message override for switching the active branch
We want to use the "checkout: moving from ..." message in order to let
git know when a change of branch has happened. Make the convenience
functions for this goal write this message.
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
412a380888 push: remove reflog message override
We always use "update by push".
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
6bfb990dc7 branch: don't accept a reflog message override
This namespace is about behaving like git's branch command, so let's do
exactly that instead of taking a reflog message.

This override is still available via the reference namespace.
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
23a17803b6 reset: remove reflog message override
This function is meant to simulate what git does in the reset command,
so we should include the reflog message in that.
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
659cf2029f Remove the signature from ref-modifying functions
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.
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
99b68a2aec Merge pull request #2908 from ethomson/safe_create
Allow checkout to handle newly cloned repositories, remove `GIT_CHECKOUT_SAFE_CREATE`
2015-03-03 13:47:13 +01:00
Edward Thomson
bf1476f190 win32: add the patch level to the .dll fileversion
Win32 DLLs have four fields for the version number (major, minor,
teeny, patch).  If a consumer wants to build a custom DLL, it may
be useful to set the patchlevel version number in the DLL.

This value only affects the DLL version number, it does not affect
the resultant "version number", which remains major.minor.teeny.
2015-03-02 10:35:26 -05:00
Edward Thomson
96b82b11c6 checkout: remove GIT_CHECKOUT_SAFE_CREATE as a strategy 2015-02-27 13:50:44 -05:00
Damien PROFETA
a275fbc0f7 Add API to add a memory buffer to an index
git_index_add_frombuffer enables now to store a memory buffer in the odb
and to store an entry in the index directly if the index is attached to a
repository.
2015-02-25 10:24:13 +01:00
Edward Thomson
795eaccd66 git_filter_opt_t -> git_filter_flag_t
For consistency with the rest of the library, where an opt is an
options *structure*.
2015-02-19 11:09:54 -05:00
Edward Thomson
b75f15aaf1 git_writestream: from git_filter_stream 2015-02-18 10:24:23 -05:00
Edward Thomson
fbdc9db364 filters: introduce streaming filters
Add structures and preliminary functions to take a buffer, file or
blob and write the contents in chunks through an arbitrary number
of chained filters, finally writing into a user-provided function
accept the contents.
2015-02-17 02:19:05 -05:00
Carlos Martín Nieto
a291790a8d Merge pull request #2831 from ethomson/merge_lock
merge: lock index during the merge (not just checkout)
2015-02-15 05:18:01 +01:00
Edward Thomson
8639ea5f98 checkout: introduce GIT_CHECKOUT_DONT_WRITE_INDEX 2015-02-14 09:25:35 -05:00
Edward Thomson
49b8293c75 rebase: allow NULL branch to indicate HEAD
Don't require the branch to rebase, if given `NULL`, simply look up
`HEAD`.
2015-02-13 11:20:32 -05:00
Carlos Martín Nieto
dc63c0496b Merge pull request #2893 from phatblat/ben/pr/doc-comments
Fix doc comment formatting
2015-02-11 23:44:05 +01:00
John Haley
a36486ef26 Fixed error when including git2/include/sys/stream.h 2015-02-11 23:30:34 +01:00
Ben Chatelain
c03e8c224c Use correct Doxygen trailing comment syntax 2015-02-10 12:44:05 -07:00
Ben Chatelain
ec7e1c93ce Fix doc comment formatting 2015-02-10 08:31:48 -07:00
Edward Thomson
3538f8f131 diff docs: update git_diff_delta description 2015-02-03 13:41:35 -05:00
Pierre-Olivier Latour
9a294fd8c5 Clarified git_repository_is_empty() documentation 2015-01-27 08:17:23 -08:00
Edward Thomson
1ac5acdc69 Merge pull request #2819 from libgit2/cmn/config-get-path
config: add parsing and getter for paths
2015-01-26 11:28:59 -06:00
Edward Thomson
f483720c6f Merge pull request #2839 from swisspol/typo
Fixed typo in git_repository_reinit_filesystem() documentation
2015-01-26 11:25:16 -06:00
Pierre-Olivier Latour
86815dca20 Make sure sys/repository.h includes the required headers
It was missing "common.h" and "types.h" like other system headers.
This generated compilation errors if including it directly.
2015-01-23 16:04:23 -08:00
Pierre-Olivier Latour
22b6a92365 Fixed typo in git_repository_reinit_filesystem() documentation 2015-01-23 15:59:54 -08:00
Edward Thomson
e74340b000 checkout: remove files before writing new ones
On case insensitive filesystems, we may have files in the working
directory that case fold to a name we want to write.  Remove those
files (by default) so that we will not end up with a filename that
has the unexpected case.
2015-01-20 17:13:31 -06:00
Edward Thomson
fe598f0903 mkdir: walk up tree to mkdir
Walk up the tree to mkdir, which is less immediately efficient,
but allows us to look at intermediate directories that may need
attention.
2015-01-20 17:12:46 -06:00
Edward Thomson
1d50b3649d checkout: introduce git_checkout_perfdata
Checkout can now provide performance data about the number of (some)
syscalls performed using an optional callback.
2015-01-20 17:12:23 -06:00
Carlos Martín Nieto
eac773d92b config: add parsing and getter for paths 2015-01-14 19:36:50 +01:00
Edward Thomson
85880693d5 Merge branch 'pr/2740' 2015-01-14 10:19:28 -06:00
Pierre-Olivier Latour
36fc549781 Added GIT_HASHSIG_ALLOW_SMALL_FILES to allow computing signatures for small files
The implementation of the hashsig API disallows computing a signature on
small files containing only a few lines. This new flag disables this
behavior.

git_diff_find_similar() sets this flag by default which means that rename
/ copy detection of small files will now work. This in turn affects the
behavior of the git_status and git_blame APIs which will now detect rename
of small files assuming the right options are passed.
2015-01-14 10:17:56 -06:00
David Calavera
c868981f0e Add extern function to initialize submodule update options. 2015-01-07 09:04:49 -06:00
Carlos Martín Nieto
239bdc5761 Merge pull request #2799 from ethomson/merge_doc
Better document `git_merge_commits`
2015-01-05 21:28:30 +00:00
Carlos Martín Nieto
9b2efc15a2 Bump version to 0.22
Bump the version number to 0.22.0 and the SOVERSION to 22.
2015-01-05 20:16:48 +00:00
Carlos Martín Nieto
0c6012293a Merge commit 'refs/pull/2632/head' of github.com:libgit2/libgit2 2015-01-05 20:10:43 +00:00
Edward Thomson
5e44d9bcb6 Better document git_merge_commits
`git_merge_commits` (and thus `git_merge`) do not use the same
strategy as `git-merge-recursive` wherein they can produce an
artificial common ancestor that is the merge of all common
ancestors.  Document this accordingly.
2015-01-05 11:35:18 -06:00
David Calavera
d76e9df9a2 Include git2/common.h in sys/openssl.h. 2015-01-02 15:56:03 -08:00
Pierre-Olivier Latour
f8263472d1 Fixed git_revert() documentation 2014-12-30 15:54:30 -08:00
Edward Thomson
a3ef70bb40 Merge pull request #2761 from libgit2/cmn/fetch-prune
Remote-tracking branch prunning
2014-12-30 11:53:55 -06:00
Edward Thomson
c4c47fc286 Merge pull request #2762 from libgit2/cmn/hide-push
remote: remove git_push from the public API
2014-12-30 11:53:45 -06:00
Carlos Martín Nieto
fe794b2ea7 remote: remove git_push from the public API
Instead we provide git_remote_upload() and git_remote_update_tips() in
order to have a parallel API for fetching and pushing.
2014-12-30 17:02:50 +00:00
Carlos Martín Nieto
208a2c8aef treebuilder: rename _create() to _new()
This function is a constructor, so let's name it like one and leave
_create() for the reference functions, which do create/write the
reference.
2014-12-27 12:09:11 +00:00
Edward Thomson
2fe8157e1b index: reuc and name entrycounts should be size_t
For the REUC and NAME entries, we use size_t internally, and we take
size_t for the get_byindex() functions, but the entrycount() functions
strangely cast to an unsigned int instead.
2014-12-22 18:42:03 -06:00
Jameson Miller
9d1f97df10 Introduce a convenience function for submodule update
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.
2014-12-22 16:37:35 -05:00
Edward Thomson
d147900ea4 Merge pull request #2759 from libgit2/cmn/openssl-sys
Make OpenSSL locking warnings more severe
2014-12-20 21:24:45 -06:00
Damien PROFETA
ceb651c9b0 Fix public header on sys/refs.h
GIT_BEGIN/END_DECL were missing from sys/refs.h and preventing
compilation with g++ as the symbol were mangled.
2014-12-19 15:31:49 +01:00
Edward Thomson
dce7b1a4e7 treebuilder: take a repository for path validation
Path validation may be influenced by `core.protectHFS` and
`core.protectNTFS` configuration settings, thus treebuilders
can take a repository to influence their configuration.
2014-12-17 13:05:27 -05:00
Carlos Martín Nieto
26186b155b fetch: remove the prune setter
This option does not get persisted to disk, which makes it different
from the rest of the setters. Remove it until we go all the way.

We still respect the configuration option, and it's still possible to
perform a one-time prune by calling the function.
2014-12-14 21:52:27 +01:00
Linquize
5f47394753 remote: prune refs when fetching 2014-12-14 17:04:01 +01:00
Carlos Martín Nieto
263b1d6ed9 Make the OpenSSL locking function warnings more severe
Our git_openssl_set_locking() would ideally not exist. Make it clearer
that we provide it as a last resort and you should prefer anything else.
2014-12-12 15:46:57 +01:00
Carlos Martín Nieto
85a6d5f49c push: reword comment on finish()
This should make it clearer what the return value implies.
2014-12-10 18:55:54 +01:00
Carlos Martín Nieto
d524b2d3d1 push: fold unpack_ok() into finish()
The push cannot be successful if we sent a bad packfile. We should
return an error in that case instead of storing it elsewhere.
2014-12-10 18:55:54 +01:00
Edward Thomson
cd305c2f56 Merge pull request #2678 from libgit2/cmn/io-stream
Introduce stackable IO streams
2014-12-10 11:30:28 -05:00
Carlos Martín Nieto
49ae22baac stream: constify the write buffer 2014-12-10 16:20:52 +01:00
Carlos Martín Nieto
dd4ff2c9b5 Introduce stackable IO streams
We currently have gitno for talking over TCP, but this needs to know
about both plaintext and OpenSSL connections and the code has gotten
somewhat messy with ifdefs determining which version of the function
should be called.

In order to clean this up and abstract away the details of sending over
the different types of streams, we can instead use an interface and
stack stream implementations.

We may not be able to use the stackability with all streams, but we
are definitely be able to use the abstraction which is currently spread
between different bits of gitno.
2014-12-10 01:17:40 +01:00
Edward Thomson
f2e09b8aac Merge pull request #2748 from libgit2/cmn/doc-all
doc: add documentation to all the public structs and enums
2014-12-06 12:26:04 -05:00
Carlos Martín Nieto
bfa6cdbf13 notes: fix comments for git_note_next()
The iterator is the last argument. There is also no returned notes, just
ids, so the comment about freeing is out of place.
2014-12-06 04:20:10 +01:00
Carlos Martín Nieto
21083a7129 notes: move the notes name argument
Make it consistent between git_note_create() and git_note_remote() by
putting it after the repository.
2014-12-06 04:20:09 +01:00
Carlos Martín Nieto
a295bd2dc4 doc: add documentation to all the public structs and enums
This makes them show up in the reference, even if the text itself isn't
the most descriptive.

These have been found with

    grep -Przon '\n\ntypedef struct.*?\{' -- include
    grep -Przon '\n\ntypedef enum.*?\{' -- include
2014-12-06 03:44:40 +01:00
nulltoken
30ec05260d Merge pull request #2744 from epmatsw/spelling
Spelling fixes
2014-12-05 07:44:09 +01:00
Will Stamper
b874629b2d Spelling fixes 2014-12-04 21:06:59 -06:00
Edward Thomson
6d91dc5351 init: return the number of initializations 2014-12-04 20:42:27 -05:00
Edward Thomson
e952bc5a57 Merge pull request #2718 from libgit2/cmn/peeling-errors
peel: reject bad queries with EPEEL
2014-11-23 17:15:18 -05:00
Carlos Martín Nieto
753e17b0f5 peel: reject bad queries with EINVALIDSPEC
There are some combination of objects and target types which we know
cannot be fulfilled. Return EINVALIDSPEC for those to signify that there
is a mismatch in the user-provided data and what the object model is
capable of satisfying.

If we start at a tag and in the course of peeling find out that we
cannot reach a particular type, we return EPEEL.
2014-11-22 18:55:22 +01:00
Carlos Martín Nieto
8fd7dd778d remote: don't say we free the remote on disconnect
On disconnect we simply ask the transport to close the connection, we do
not free it.
2014-11-19 15:49:47 +01:00
Carlos Martín Nieto
699dfcc3bc remote: clarify which list of references _ls() returns
Make it clear that this is not the ls-remote command but a way to access
the data we have and how long it's kept around.
2014-11-19 15:49:02 +01:00
Edward Thomson
45301cca30 Merge pull request #2608 from libgit2/cmn/remote-push
Provide a convenience function `git_remote_push()`
2014-11-18 11:44:59 -05:00
Carlos Martín Nieto
64e3e6d43a remote: use configured push refspecs if none are given
If the user does not pass any refspecs to push, try to use those
configured via the configuration or via add_push().
2014-11-09 00:01:58 +01:00
Carlos Martín Nieto
3149547b5a remote: introduce git_remote_push()
This function, similar in style to git_remote_fetch(), performs all the
steps required for a push, with a similar interface.

The remote callbacks struct has learnt about the push callbacks, letting
us set the callbacks a single time instead of setting some in the remote
and some in the push operation.
2014-11-09 00:01:58 +01:00
Carlos Martín Nieto
799e22ea0c Rename git_threads_ to git_libgit2_
This describes their purpose better, as we now initialize ssl and some
other global stuff in there. Calling the init function is not something
which has been optional for a while now.
2014-11-08 23:46:39 +01:00
Edward Thomson
02bc523304 Merge pull request #2698 from libgit2/cmn/fetchhead-refactor
Refactor fetchhead
2014-11-08 17:05:13 -05:00
Edward Thomson
bc8c4a8aeb Merge pull request #2695 from libgit2/cmn/remote-lookup
remote: rename _load() to _lookup()
2014-11-08 16:55:23 -05:00
Carlos Martín Nieto
82374d9825 branch: add getter for the upstream remote name
This gets the value from branch.<foo>.remote.
2014-11-08 20:00:17 +01:00
Carlos Martín Nieto
209425ce26 remote: rename _load() to _lookup()
This brings it in line with the rest of the lookup functions.
2014-11-08 13:28:27 +01:00
Ungureanu Marius
6818208569 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.
2014-11-07 21:34:54 +02:00
Edward Thomson
7bb639911b Merge pull request #2676 from libgit2/cmn/threading
Threading and crypto libraries
2014-11-06 10:25:23 -05:00
Edward Thomson
0a62918188 Merge pull request #2661 from swisspol/2656
Changed context_lines and interhunk_lines to uint32_t to match struct s_xdemitconf
2014-11-03 15:10:14 +01:00
Carlos Martín Nieto
521c0cab7a merge: talk about the merging state after git_merge()
Since it's not necessarily obvious, mention the merging state and how to
clear it.
2014-11-02 17:18:19 +01:00
Carlos Martín Nieto
fe6b51ae40 ssl: separate locking init from general init
Extract the lock-setting functions into their own, as we cannot assume
that it's ok for us to set this unconditionally.
2014-11-01 10:58:55 +01:00
Pierre-Olivier Latour
d88766c4e1 Changed context_lines and interhunk_lines to uint32_t to match struct s_xdemitconf 2014-10-27 09:17:01 -07:00
Edward Thomson
979645a719 rebase: updates based on PR comments 2014-10-26 22:59:50 -04:00
Edward Thomson
18b00406c6 s/git_merge_head/git_annotated_commit
Rename git_merge_head to git_annotated_commit, as it becomes used
in more operations than just merge.
2014-10-26 22:59:48 -04:00
Edward Thomson
e69737d760 rebase: oid member of operation should be const 2014-10-26 22:59:43 -04:00
Edward Thomson
ed2c06a6a1 git_rebase: iterators for operations 2014-10-26 22:59:41 -04:00
Edward Thomson
f152f8ac0c rebase: preload all operations 2014-10-26 22:59:38 -04:00
Edward Thomson
b6b636a7fa rebase: init/open a git_rebase object 2014-10-26 22:59:36 -04:00
Edward Thomson
18b439b9be git_rebase_next: provide info about the operation 2014-10-26 22:59:34 -04:00
Edward Thomson
5ae9d296e3 git_rebase_finish: rewrite notes when finishing rebase 2014-10-26 22:59:32 -04:00
Edward Thomson
bad4937ea5 Introduce git_note_author, git_note_committer 2014-10-26 22:59:29 -04:00
Edward Thomson
517644cce4 Introduce git_rebase_finish to complete a rebase 2014-10-26 22:59:25 -04:00
Edward Thomson
93a7004cc2 git_rebase_commit: drop already-picked commits
Already cherry-picked commits should not be re-included.  If all changes
included in a commit exist in the upstream, then we should error with
GIT_EAPPLIED.
2014-10-26 22:59:21 -04:00
Edward Thomson
a35a9890b0 Introduce git_rebase_commit
Commit the current patch of a rebase process.
2014-10-26 22:59:19 -04:00
Edward Thomson
950a709159 Introduce git_rebase_next
`git_rebase_next` will apply the next patch (or cherry-pick)
operation, leaving the results checked out in the index / working
directory so that consumers can resolve any conflicts, as appropriate.
2014-10-26 22:59:14 -04:00
Edward Thomson
4fe84d624b Introduce git_rebase_abort
Abort an in-progress rebase and move the working directory and
repository back to the ORIG_HEAD state.
2014-10-26 22:59:12 -04:00
Edward Thomson
daf395b795 git_reset: const the git_signature arg 2014-10-26 22:59:10 -04:00
Edward Thomson
867a36f3a6 Introduce git_rebase to set up a rebase session
Introduce `git_rebase` to set up a rebase session that can
then be continued.  Immediately, only merge-type rebase is
supported.
2014-10-26 22:59:08 -04:00
Edward Thomson
d09458f3e9 Merge pull request #2638 from libgit2/cmn/config-refresh-remove
config: remove the refresh function and backend field
2014-10-24 16:52:39 -07:00
Edward Thomson
725cd5f29d Merge pull request #2646 from libgit2/cmn/remote-rename
remote: accept a repo and name for renaming
2014-10-24 16:44:07 -07:00
Carlos Martín Nieto
46c8f7f845 remote: accept a repo and name for renaming
Remote objects are not meant to be changed from under the user. We did
this in rename, but only the name and left the refspecs, such that a
save would save the wrong refspecs (and a fetch and anything else would
use the wrong refspecs).

Instead, let's simply take a name and not change any loaded remote from
under the user.
2014-10-24 16:25:59 +02:00
Carlos Martín Nieto
0862f617da remote: delete git_remote_supported_url()
This function does not in fact tell us anything, as almost anything with
a colon in it is a valid rsync-style SSH path; it can not tell us that
we do not support ftp or afp or similar as those are still valid SSH
paths and we do support that.
2014-10-24 13:40:42 +02:00
Carlos Martín Nieto
55cb499972 config: remove the refresh function and backend field
We have been refreshing on read and write for a while now, so
git_config_refresh() is at best a no-op, and might just end up wasting
cycles.
2014-10-23 19:05:02 +02:00
Carlos Martín Nieto
12e1803188 Update some documentation 2014-10-18 15:22:19 +02:00
Russell Belfer
babbff347c Move un-namespaced constant to internal header
FLAG_BITS only seems to be used internally
2014-10-10 15:17:05 -07:00
Edward Thomson
a6ed1fcbe1 Merge pull request #2593 from libgit2/cmn/remote-delete-name
remote: accept a repository and remote name for deletion
2014-10-10 12:21:28 -04:00
Carlos Martín Nieto
bab92a8dcf Merge pull request #2575 from cirosantilli/factor-struct-typedef
[factor] Join typedef and struct definitions in single file.
2014-10-10 18:06:36 +02:00
Carlos Martín Nieto
9b36537de4 Merge pull request #2588 from swansontec/ssl-cert-path2
Add support for setting the SSL CA location
2014-10-10 17:42:52 +02:00
Carlos Martín Nieto
0625638f06 Merge pull request #2499 from csware/hard-reset-checkout-callbacks
Allow to propagate checkout callbacks to git HARD reset
2014-10-10 17:40:53 +02:00
Edward Thomson
f54d8d528a Merge pull request #2574 from csware/hostname-for-certificate_check_cb
Provide host name to certificate_check_cb
2014-10-10 11:28:58 -04:00
Arthur Schreiber
8e398e4c84 Treat an empty list of refspecs the same as a NULL value. 2014-10-10 13:17:53 +02:00
Carlos Martín Nieto
46a2b8e855 Merge pull request #2592 from libgit2/cmn/describe
Implement git-describe
2014-10-09 22:24:40 +02:00
Edward Thomson
10cf4b26a0 Merge pull request #2448 from libgit2/cmn/reference-transaction
Introduce reference transactions
2014-10-09 10:49:37 -04:00
Edward Thomson
8be28acfcd Merge pull request #2462 from libgit2/cmn/remote-fetch-refs
Implement opportunistic ref updates
2014-10-09 10:41:38 -04:00
Carlos Martín Nieto
c327d5db8b transaction: rename lock() to lock_ref()
This leaves space for future expansion to locking other resources
without having to change the API for references.
2014-10-09 16:29:30 +02:00
Arthur Schreiber
eca07bcd83 Add git_merge_bases_many. 2014-10-09 14:19:00 +02:00
Vicent Marti
737b505116 hashsig: Export as a sys header 2014-10-01 12:03:24 +02:00
William Swanson
737b445a18 Add support for setting the SSL CA location
This allows users to specify self-signed certificates, or to provide their
own certificate stores on limited platforms such as mobile phones.
2014-09-30 17:26:39 -07:00
Carlos Martín Nieto
262eec23fe remote: accept a repository and remote name for deletion
We don't need the remote loaded, and the function extracted both of
these from the git_remote in order to do its work, so let's remote a
step and not ask for the loaded remote at all.

This fixes #2390.
2014-09-30 16:09:55 +02:00
Carlos Martín Nieto
db2f82630c transaction: add documentation 2014-09-30 15:52:13 +02:00
Carlos Martín Nieto
ab8d9242f5 Introduce reference transactions
A transaction allows you to lock multiple references and set up changes
for them before applying the changes all at once (or as close as the
backend supports).

This can be used for replication purposes, or for making sure some
operations run when the reference is locked and thus cannot be changed.
2014-09-30 15:44:32 +02:00
Carlos Martín Nieto
20363d583c reflog: constify byindex 2014-09-30 15:44:32 +02:00
Carlos Martín Nieto
3f89420523 remote: allow overriding the refspecs for download and fetch
With opportunistic ref updates, git has introduced the concept of having
base refspecs *and* refspecs that are active for a particular fetch.

Let's start by letting the user override the refspecs for download.
2014-09-30 15:42:32 +02:00
Carlos Martín Nieto
a3b9270dcf describe: document the API 2014-09-30 09:32:24 +02:00
Carlos Martín Nieto
25345c0cbe describe: rename git_describe_opts to git_describe_options
And implement the option init functions for this and the format options.
2014-09-30 09:18:22 +02:00
Carlos Martín Nieto
fd8126e4c6 describe: implement describing the workdir
When we describe the workdir, we perform a describe on HEAD and then
check to see if the worktree is dirty. If it is and we have a suffix
string, we append that to the buffer.
2014-09-30 08:56:20 +02:00
Carlos Martín Nieto
3b6534b807 describe: split into gather and format steps
Instead of printing out to the buffer inside the information-gathering
phase, write the data to a intermediate result structure.

This allows us to split the options into gathering options and
formatting options, simplifying the gathering code.
2014-09-30 07:24:28 +02:00
Carlos Martín Nieto
1f501a086b describe: rename _object() to _commit()
We don't describe arbitrary object, so let's give it the name of the one
object type we accept.
2014-09-30 04:58:02 +02:00
Carlos Martín Nieto
af6cc38fc0 Merge remote-tracking branch 'upstream/master' into cmn/describe 2014-09-30 04:38:05 +02:00
Ciro Santilli
062804570c Join typedef and struct definitions in single file. 2014-09-24 11:00:51 +02:00