Commit Graph

1204 Commits

Author SHA1 Message Date
Edward Thomson
300d192f7e Introduce git_revert to revert a single commit 2013-12-02 16:57:41 -06:00
Alessandro Ghedini
138e014c38 transport: document ssh-agent authentication 2013-11-20 14:25:55 +01:00
Vicent Marti
43cb8b3242 libgit2 0.20.0 "anmeldung"
Apologies for the delay. This release is chunky,
but you're probably used to chunky releases by now.

Full changelog follows:

Internal changes
	+ Added support for decomposed Unicode paths in Mac OS X
	+ Added support for junctions in win32
	+ Fixed issues with HTTP redirects in the network stack
	+ Performance improvements (as always)

git2/blame.h
	+ added full support for blame operations

git2/blob.h
	+ added `git_blob_filtered_content` to load blobs in
	memory with their corresponding filters applied

git2/branch.h
	+ added branch iterators as an alternative to the
	callback-based API

git2/buffer.h
	+ exported the git_buf struct to allow binary buffers
	to be passed from/to the library. This simplifies
	several APIs

git2/checkout.h
	+ implemented additional checkout options ('skip unmerged',
	'use ours' and 'use theirs')

git2/clone.h
	+ simplified the clone API
	+ added new `git_clone_into` to clone into an existing
	(empty) repository

git2/commit.h
	+ added APIs to access the raw (uncleaned) text of a commit
	message

git2/common.h
	+ added global options to set the default paths to load
	templates from

git2/config.h
	+ added multivar iterators
	+ added globbing iterator
	+ added `git_config_foreach_match` to perform operations
	on every single var in a config file

git2/diff.h
	+ restructured and simplified the diff API

git2/filter.h
	+ added external APIs to configure and apply custom filters
	to checked out blobs

git2/index.h
	+ `git_index_read` can now force a reload of the index file
	even if it hasn't changed on-disk

git2/indexer.h
	+ improved the streaming indexer APIs

git2/merge.h
	+ added support for merge!

git2/object.h
	+ added helper API to lookup a generic object by path

git2/pack.h
	+ added progress callbacks to the packbuilder

git2/patch.h
	+ added support for patch generation as part of the Diff
	API revamp

git2/pathspec.h
	+ added helper APIs to work with pathspecs and match files
	in the workdir or diffs

git2/push.h
	+ added progress callbacks to push

git2/reflog.h
	+ changed reflog APIs to work on reference names instead of
	the references themselves, so they become less racy

git2/remote.h
	+ added support for setting refspecs on remotes, either at
	creation or on existing ones
	+ simplified the remotes API

git2/revwalk.h
	+ add API to simplify parents during a walk

git2/signature.h
	+ add helper to create a signature with the default values for
	a repository (i.e. the set `user.name` and `user.email` values,
	and the current time)

git2/submodules.h
	+ improve the status detection for submodules

git2/sys/
	+ exported many new internal APIs, such as pluggabe transport
	APIs

-vmg, out
2013-11-20 12:53:33 +01:00
Carlos Martín Nieto
1b3fe73c8d Formatting fix for cred_acquire_cb 2013-11-20 11:55:32 +01:00
Nick Hengeveld
d8e7ffc2a2 Add content offset to git_diff_line
For additions and deletions, external consumers like subversion
can make use of the content offset to generate diffs in their
proprietary formats.
2013-11-18 14:03:25 -08:00
Edward Thomson
84efffc33a Introduce git_cred_default for NTLM/SPNEGO auth 2013-11-18 12:56:35 -05:00
Ben Straub
83e1efbf46 Update files that reference tests-clar 2013-11-14 14:10:32 -08:00
Vicent Martí
7b947bf5cc Merge pull request #1951 from victorgp/create-remote-plus-fetch
Allowing create remotes with custom fetch spec
2013-11-14 07:21:47 -08:00
Vicent Martí
6414fd338d Merge pull request #1956 from libgit2/cmn/fetch-default-head
Remote revamp (director's cut)
2013-11-11 06:47:15 -08:00
Carlos Martín Nieto
359dce726d remote: make _ls return the list directly
The callback-based method of listing remote references dates back to the
beginning of the network code's lifetime, when we didn't know any
better.

We need to keep the list around for update_tips() after disconnect() so
let's make use of this to simply give the user a pointer to the array so
they can write straightforward code instead of having to go through a
callback.
2013-11-11 15:35:51 +01:00
Carlos Martín Nieto
266af6d819 remote: don't allow such direct access to the refspecs
Removing arbitrary refspecs makes things more complex to reason
about. Instead, let the user set the fetch and push refspec list to
whatever they want it to be.
2013-11-10 22:21:25 +01:00
Victor Garcia
886cc44738 fixing typo 2013-11-08 15:42:52 +01:00
Victor Garcia
40b99d05b4 splitting funcionality in two methods to avoid ambiguity with NULL 2013-11-08 12:14:31 +01:00
Edward Thomson
1e60e5f42d Allow callers to set mode on packfile creation 2013-11-07 12:04:32 -05:00
Victor Garcia
99feb98897 adding doc for new param and test to check fetch spec is correctly added 2013-11-07 16:22:49 +01:00
Edward Thomson
cc2447da32 Add git_packbuilder_hash to query pack filename 2013-11-07 09:43:24 -05:00
Victor Garcia
0fe522d105 allowing create remote with custom fetch spec 2013-11-07 14:16:20 +01:00
Carlos Martín Nieto
a8baf4b160 Merge pull request #1946 from arthurschreiber/change-branch-iterator-definition
Change the git_branch_iterator_new definition to use git_branch_t
2013-11-05 12:26:41 -08:00
Arthur Schreiber
a667ca8298 Change the git_branch_iterator_new and git_branch_next definitions to use git_branch_t. 2013-11-05 20:51:07 +01:00
Ben Straub
8adea28ae9 Blame: change signature to be more binding-friendly 2013-11-05 11:44:42 -08:00
Edward Thomson
039db728f3 merge branch into current, updating workdir 2013-11-05 10:00:39 -05:00
Vicent Martí
c82f7f8e99 Merge pull request #1938 from libgit2/cmn/branch-iterator
branch: move from foreach to an iterator
2013-11-05 06:55:16 -08:00
Vicent Martí
ffd040532a Merge pull request #1941 from libgit2/rb/preserve-iterator-error
Preserve error messages during file system iterator cleanup
2013-11-05 06:05:32 -08:00
Carlos Martín Nieto
8ec889a45f branch: move from foreach to an iterator
Create a git_branch_iterator type which is equivalent to the foreach but
lets us write loops instead of callbacks.

Since the introduction of git_reference_shorthand(), the added value of
passing the name is reduced.
2013-11-05 14:58:16 +01:00
Vicent Marti
1eab9f0e32 error: Simplify giterr_detach 2013-11-05 14:56:10 +01:00
Edward Thomson
f966acd133 Take umask into account in filebuf_commit 2013-11-04 22:32:50 -05:00
Russell Belfer
d6c6016966 Add giterr_detach API to get and clear error
There are a number of cases where it is convenient to be able to
fetch and "claim" the current error string, clearing the error.
This is helpful when you need to call some code that may alter
the error and you want to restore it later on and/or report it via
some other mechanism.
2013-11-04 15:45:31 -08:00
Vicent Martí
0e1115d287 Merge pull request #1939 from ethomson/readwrite_odb
Allow backend consumers to specify file mode
2013-11-04 12:16:14 -08:00
Edward Thomson
dd64c71c26 Allow backend consumers to specify file mode 2013-11-04 14:50:25 -05:00
Russell Belfer
fb6b0e019e Merge pull request #1317 from libgit2/blame
Blame Canada
2013-11-04 10:44:59 -08:00
Vicent Martí
44acdd1f9a Merge pull request #1937 from scunz/checkout_assert
Don't assert in git_checkout_tree
2013-11-04 08:09:58 -08:00
Sascha Cunz
352214416c Checkout: Don't assert if treeish is NULL
In git_checkout_tree, the first check tests if either repo or treeish is
NULL and says that eithor of them has to have a valid value. But there
is no code to handle the treeish == NULL case.

So, do something meaningful in that case: use HEAD instead.
2013-11-02 03:43:34 +00:00
Sascha Cunz
10749f6ca2 Checkout: Unifiy const-ness of opts parameter
Since all 3 checkout APIs perform the same operation with the options,
all of them should use the same const-ness.
2013-11-02 03:20:05 +00:00
Carlos Martín Nieto
2f03050f4f remote: download HEAD when no refspecs are given
The correct behaviour when a remote has no refspecs (e.g. a URL from the
command-line) is to download the remote's HEAD. Let's do that.

This fixes #1261.
2013-11-01 22:47:06 +01:00
Russell Belfer
a5c16f3cfb Add git_diff_options_init helper
Sometimes the static initializer for git_diff_options cannot be
used and since setting them to all zeroes doesn't actually work
quite right, this adds a new helper for that situation.

This also adds an explicit new value to the submodule settings
options to be used when those enums need static initialization.
2013-11-01 10:20:51 -07:00
Russell Belfer
8e5a8ef86f Convert git_index_read to have a "force" flag
This is a little more intuitive than the turned-around option that
I originally wrote.
2013-11-01 10:20:51 -07:00
Russell Belfer
4bf630b6ba 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.
2013-11-01 10:20:51 -07:00
Vicent Martí
ac5e507cec Merge pull request #1918 from libgit2/cmn/indexer-naming
indexer: remove the stream infix
2013-11-01 09:31:52 -07:00
Daniel Rodríguez Troitiño
3793fa9b18 Fix saving remotes with several fetch/push ref specs.
At some moment git_config_delete_entry lost the ability to delete one entry of
a multivar configuration. The moment you had more than one fetch or push
ref spec for a remote you will not be able to save that remote anymore. The
changes in network::remote::remotes::save show that problem.

I needed to create a new git_config_delete_multivar because I was not able to
remove one or several entries of a multivar config with the current API.
Several tries modifying how git_config_set_multivar(..., NULL) behaved were
not successful.

git_config_delete_multivar is very similar to git_config_set_multivar, and
delegates into config_delete_multivar of config_file. This function search
for the cvar_t that will be deleted, storing them in a temporal array, and
rebuilding the linked list. After calling config_write to delete the entries,
the cvar_t stored in the temporal array are freed.

There is a little fix in config_write, it avoids an infinite loop when using
a regular expression (case for the multivars). This error was found by the
test network::remote::remotes::tagopt.
2013-11-01 00:08:52 +01:00
Carlos Martín Nieto
97d32abb49 Remove leftover function declaration 2013-10-30 15:15:54 +01:00
Carlos Martín Nieto
a6154f2183 indexer: remove the stream infix
It was there to keep it apart from the one which read in from a file on
disk. This other indexer does not exist anymore, so there is no need for
anything other than git_indexer to refer to it.

While here, rename _add() function to _append() and _finalize() to
_commit(). The former change is cosmetic, while the latter avoids
talking about "finalizing", which OO languages use to mean something
completely different.
2013-10-30 15:00:05 +01:00
Ben Straub
42c8f8f807 Merge remote-tracking branch 'libgit2/development' into blame 2013-10-28 11:04:58 -07:00
Vicent Martí
5c50f22a93 Merge pull request #1891 from libgit2/cmn/fix-thin-packs
Add support for thin packs
2013-10-28 09:25:44 -07:00
Vicent Martí
5565f3cda8 Merge pull request #1904 from libgit2/cmn/ssh-naming
Rename the ssh credentials
2013-10-28 07:04:58 -07:00
Ben Straub
8f4a8b096b Merge pull request #1802 from libgit2/cmn/reflog-backend
Make reflog part of refdb
2013-10-28 06:20:28 -07:00
Carlos Martín Nieto
5cb136705d transport: let the progress output return an error
There are any number of issues that can come up in the progress
callback, and we should let the user cancel at that point as well.
2013-10-23 15:45:29 +02:00
Carlos Martín Nieto
ab46b1d8eb indexer: include the delta stats
The user is unable to derive the number of deltas in the pack, as that
would require them to capture the stats exactly in the moment between
download and final processing, which is abstracted away in the fetch.

Capture these numbers for the user and expose them in the progress
struct. The clone and fetch examples now also present this information
to the user.
2013-10-23 15:08:18 +02:00
Carlos Martín Nieto
70a8c78f36 Rename the ssh credentials
The names from libssh2 are somewhat obtuse for us. We can simplify the
usual key/passphrase credential's name, as well as make clearer what the
custom signature function is.
2013-10-23 12:08:54 +02:00
Vicent Martí
1c74686e05 Merge pull request #1897 from libgit2/split-patch-from-diff
RFC: Proposed reworking of diff APIs
2013-10-22 11:55:54 -07:00
Russell Belfer
7ce60099ee Fix typo 2013-10-22 11:12:44 -07:00