Commit Graph

1654 Commits

Author SHA1 Message Date
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