Commit Graph

926 Commits

Author SHA1 Message Date
Vicent Marti
a442ed687d repository: Add git_repository_open_bare 2013-04-17 04:46:37 +02:00
Vicent Marti
f124ebd457 libgit2 0.18.0 "Big Ben"
This is the last minor release before 1.0preview1.

Highlights of this release include:

- Branch API
- Checkout head, index and tree
- Finished clone support
- Abstracted reference API to use custom backends
- Full diff support
- New (faster) packbuilder
- Push support
- New Remotes API
- Revparse support (single and range commits)
- Stash support
- Submodules support

As always, the full changelog is available at:

	http://libgit2.github.com/libgit2/#p/changelog

Yeah, it's a huge release. Releasing stuff sucks.
Expect 1.0 and API freeze in less than a month.

Your faithful maintainer,
	 vmg

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2013-04-16 17:45:12 +02:00
Vicent Marti
e13a0647a0 Update docs 2013-04-15 23:54:28 +02:00
Vicent Marti
cbda09d00b git_revision -> git_revspec 2013-04-15 23:40:46 +02:00
Vicent Marti
36c2dfed69 Is this crazy? 2013-04-15 23:32:40 +02:00
Vicent Marti
d064c74794 Merge remote-tracking branch 'ben/unified-revparse' into development 2013-04-15 23:18:24 +02:00
Ben Straub
201566539f Clean up minor details 2013-04-15 13:29:40 -07:00
Ben Straub
299a224be1 Change git_revparse to output git_object pointers
This will probably prevent many lookup/free
operations in calling code.
2013-04-15 12:00:04 -07:00
Ben Straub
4291ad0781 Reintroduce git_revparse_single. 2013-04-15 11:42:34 -07:00
Vicent Martí
ea8bac37b0 Merge pull request #1450 from carlosmn/branch-upstream
Branch upstream configuration
2013-04-11 06:34:59 -07:00
Carlos Martín Nieto
d59942c2ab branch: add more upstream configuration management
Add functions to set and unset the upstream configuration to
complement the getter we already have.
2013-04-11 12:27:25 +02:00
Vicent Marti
575a54db85 object: Export git_object_dup 2013-04-10 16:56:32 +02:00
Russell Belfer
ad26434b3b Tests and more fixes for submodule diffs
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.
2013-04-09 14:52:32 -07:00
Ben Straub
1aa21fe3b8 Deprecate git_revparse_single and _rangelike 2013-04-09 05:07:04 +04:00
Ben Straub
8480eef7ee Implement unified git_revparse 2013-04-08 16:36:11 +04:00
Ben Straub
4d13d07ab2 Propose unified rev-parse API 2013-04-08 16:35:09 +04:00
Vicent Marti
d9ecaf8c6f Merge remote-tracking branch 'gnprice/revwalk' into development 2013-04-07 07:22:38 +02:00
Greg Price
af079d8bf6 revwalk: Parse revision ranges
All the hard work is already in revparse.

Signed-off-by: Greg Price <price@mit.edu>
2013-04-06 20:51:16 -07:00
Greg Price
b208d90022 revparse: Parse range-like syntax
Signed-off-by: Greg Price <price@mit.edu>
2013-04-06 20:51:16 -07:00
Edward Thomson
c869e26878 export git_reference__alloc 2013-04-02 18:57:42 -05:00
nulltoken
b08c317346 branch: Fix git_branch_create() documentation 2013-04-01 22:01:13 +02:00
Greg Price
804c5f5627 Fix puzzling doc comment
Signed-off-by: Greg Price <price@mit.edu>
2013-03-31 15:33:22 -07:00
nulltoken
24cb87e2a6 tag: Fix parsing when no tagger nor message 2013-03-31 14:36:51 +02:00
Carlos Martín Nieto
a258d8e357 branch: rename 'tracking' to 'upstream'
The term 'tracking' is overloaded. Help distinguish what we mean by
using 'upstream' for this part of the library.
2013-03-30 15:45:57 +01:00
Carlos Martín Nieto
81b8c9df46 transport: don't try to export nonexistent function 2013-03-30 04:50:53 +01:00
Vicent Martí
0b061b5bfa Merge pull request #1436 from schu/opts-cache-size
opts: allow configuration of odb cache size
2013-03-26 11:05:57 -07:00
Russell Belfer
37ee70fab4 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).
2013-03-25 22:19:39 -07:00
Russell Belfer
0c289dd7c6 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.
2013-03-25 16:40:16 -07:00
Vicent Martí
1f10747854 Merge pull request #1428 from xavier-l/nul-terminated-oid
Nul terminated oid
2013-03-25 13:26:50 -07:00
Michael Schubert
f5e28202cb opts: allow configuration of odb cache size
Currently, the odb cache has a fixed size of 128 slots as defined by
GIT_DEFAULT_CACHE_SIZE. Allow users to set the size of the cache via
git_libgit2_opts().

Fixes #1035.
2013-03-25 15:45:56 +01:00
Miquel Canes Gonzalez
c2186230f3 Remove GIT_SUCCESS from documentation 2013-03-24 12:34:00 +01:00
Carlos Martín Nieto
33a59401c3 graph: make the ahead-behind docs clearer
Explain it in local-upstream branch terms so it's easier to grasp than
with the `one` and `two` naming from the merge-base code.
2013-03-22 20:27:59 +01:00
Xavier L
0c8efb38f9 Added an oid function that accepts nul-terminated strings 2013-03-21 11:59:01 -04:00
Carlos Martín Nieto
0b0ecbec2b clone: fix param comment 2013-03-19 17:42:10 +01:00
Russell Belfer
324602514f Fixes and cleanups
Get rid of some dead code, tighten things up a bit, and fix a bug
with core::env test.
2013-03-18 15:54:35 -07:00
Russell Belfer
41954a49c1 Switch search paths to classic delimited strings
This switches the APIs for setting and getting the global/system
search paths from using git_strarray to using a simple string with
GIT_PATH_LIST_SEPARATOR delimited paths, just as the environment
PATH variable would contain.  This makes it simpler to get and set
the value.

I also added code to expand "$PATH" when setting a new value to
embed the old value of the path.  This means that I no longer
require separate actions to PREPEND to the value.
2013-03-18 14:19:35 -07:00
Russell Belfer
5540d9477e Implement global/system file search paths
The goal of this work is to expose the search logic for "global",
"system", and "xdg" files through the git_libgit2_opts() interface.

Behind the scenes, I changed the logic for finding files to have a
notion of a git_strarray that represents a search path and to store
a separate search path for each of the three tiers of config file.
For each tier, I implemented a function to initialize it to default
values (generally based on environment variables), and then general
interfaces to get it, set it, reset it, and prepend new directories
to it.

Next, I exposed these interfaces through the git_libgit2_opts
interface, reusing the GIT_CONFIG_LEVEL_SYSTEM, etc., constants
for the user to control which search path they were modifying.
There are alternative designs for the opts interface / argument
ordering, so I'm putting this phase out for discussion.

Additionally, I ended up doing a little bit of clean up regarding
attr.h and attr_file.h, adding a new attrcache.h so the other two
files wouldn't have to be included in so many places.
2013-03-15 16:39:00 -07:00
Carlos Martín Nieto
1aa5318a9e diff: allow asking for diffs with no context
Previously, 0 meant default. This is problematic, as asking for 0
context lines is a valid thing to do.

Change GIT_DIFF_OPTIONS_INIT to default to three and stop treating 0
as a magic value. In case no options are provided, make sure the
options in the diff object default to 3.
2013-03-09 16:04:34 +01:00
Vicent Martí
6f83a78133 Merge pull request #1403 from ethomson/tracing
Optional tracing back to consumers
2013-03-07 11:14:03 -08:00
Edward Thomson
b5ec5430a8 optional tracing 2013-03-07 12:42:33 -06:00
Vicent Marti
33abaad809 refs: Dude, you're OUT. 2013-03-07 18:58:34 +01:00
Edward Thomson
d00d54645d immutable references and a pluggable ref database 2013-03-07 11:01:52 -06:00
Nico von Geyso
f7b1850215 fixed minor issues with new note iterator
* fixed style issues
* use new iterator functions for git_note_foreach()
2013-03-06 22:36:19 +01:00
Nico von Geyso
1a90dcf64e use git_note_iterator type instead of non-public git_iterator one 2013-03-06 19:07:56 +01:00
Nico von Geyso
6edb427b76 basic note iterator implementation
* git_note_iterator_new() - create a new note iterator
* git_note_next() - retrieves the next item of the iterator
2013-03-06 17:01:33 +01:00
Carlos Martín Nieto
3d74702eec Make sure docurium can see git_packbuilder_foreach 2013-03-05 23:50:43 +01:00
Edward Thomson
5bddabcca5 clear REUC on checkout 2013-03-04 18:10:57 -06:00
Carlos Martín Nieto
447ae791e5 indexer: kill git_indexer
This was the first implementation and its goal was simply to have
something that worked. It is slow and now it's just taking up
space. Remove it and switch the one known usage to use the streaming
indexer.
2013-03-03 15:19:21 +01:00
Vicent Martí
e68e33f33d Merge pull request #1233 from arrbee/file-similarity-metric
Add file similarity scoring to diff rename/copy detection
2013-02-27 14:50:32 -08:00
Michael Schubert
fcc265fef8 pack.h: improve docs on how to create a packfile 2013-02-25 22:22:15 +01:00
nulltoken
c1b5e8c42b branch: Make git_branch_remote_name() cope with orphaned heads 2013-02-22 17:04:23 +01:00
Russell Belfer
d4b747c1cb Add diff rename tests with partial similarity
This adds some new tests that actually exercise the similarity
metric between files to detect renames, copies, and split modified
files that are too heavily modified.

There is still more testing to do - these tests are just partially
covering the cases.

There is also one bug fix in this where a change set with only
MODIFY being broken into ADD/DELETE (due to low self-similarity)
without any additional RENAMED entries would end up not processing
the split requests (because the num_rewrites counter got reset).
2013-02-21 16:44:44 -08:00
Russell Belfer
960a04dd56 Initial integration of similarity metric to diff
This is the initial integration of the similarity metric into
the `git_diff_find_similar()` code path.  The existing tests all
pass, but the new functionality isn't currently well tested.  The
integration does go through the pluggable metric interface, so it
should be possible to drop in an alternative to the internal
metric that libgit2 implements.

This comes along with a behavior change for an existing interface;
namely, passing two NULLs to git_diff_blobs (or passing NULLs to
git_diff_blob_to_buffer) will now call the file_cb parameter zero
times instead of one time.  I know it's strange that that change
is paired with this other change, but it emerged from some
initialization changes that I ended up making.
2013-02-21 12:40:33 -08:00
Russell Belfer
71a3d27ea6 Replace diff delta binary with flags
Previously the git_diff_delta recorded if the delta was binary.
This replaces that (with no net change in structure size) with
a full set of flags.  The flag values that were already in use
for individual git_diff_file objects are reused for the delta
flags, too (along with renaming those flags to make it clear that
they are used more generally).

This (a) makes things somewhat more consistent (because I was
using a -1 value in the "boolean" binary field to indicate unset,
whereas now I can just use the flags that are easier to understand),
and (b) will make it easier for me to add some additional flags to
the delta object in the future, such as marking the results of a
copy/rename detection or other deltas that might want a special
indicator.

While making this change, I officially moved some of the flags that
were internal only into the private diff header.

This also allowed me to remove a gross hack in rename/copy detect
code where I was overwriting the status field with an internal
value.
2013-02-20 15:10:21 -08:00
Russell Belfer
9bc8be3d7e Refine pluggable similarity API
This plugs in the three basic similarity strategies for handling
whitespace via internal use of the pluggable API.  In so doing, I
realized that the use of git_buf in the hashsig API was not needed
and actually just made it harder to use, so I tweaked that API as
well.

Note that the similarity metric is still not hooked up in the
find_similarity code - this is just setting out the function that
will be used.
2013-02-20 15:09:41 -08:00
Russell Belfer
a235e9d355 Pluggable similarity metric API 2013-02-20 15:09:41 -08:00
Alessandro Ghedini
91f7335e1c push: fix typo in git_push_finish() doc 2013-02-15 13:12:16 +01:00
Michael Schubert
a53b5e5fc3 push: improve docs on success / failure of git_push_finish 2013-02-14 20:22:48 +01:00
Ben Straub
6a0ffe84a7 Merge pull request #1333 from phkelley/push_options
Add git_push_options, to set packbuilder parallelism
2013-02-12 10:50:55 -08:00
Russell Belfer
9c258af094 Merge pull request #1316 from ben/clone-cancel
Allow network operations to cancel
2013-02-12 10:13:56 -08:00
nulltoken
2bca5b679b remote: Introduce git_remote_is_valid_name()
Fix libgit2/libgit2sharp#318
2013-02-11 23:19:41 +01:00
Russell Belfer
390a3c8141 Merge pull request #1190 from nulltoken/topic/reset-paths
reset: Allow the selective reset of pathspecs
2013-02-11 11:44:00 -08:00
Jameson Miller
db4bb4158f Teach refspec to transform destination reference to source reference 2013-02-11 11:36:28 -05:00
Jameson Miller
2e3e8c889b Teach remote branch to return its remote 2013-02-11 11:36:22 -05:00
Philip Kelley
b8b897bbc5 Add git_push_options, to set packbuilder parallelism 2013-02-11 09:35:26 -05:00
yorah
0d64ba4837 diff: add a notify callback to git_diff__from_iterators
The callback will be called for each file, just before the `git_delta_t` gets inserted into the diff list.

When the callback:
- returns < 0, the diff process will be aborted
- returns > 0, the delta will not be inserted into the diff list, but the diff process continues
- returns 0, the delta is inserted into the diff list, and the diff process continues
2013-02-07 20:44:35 +01:00
Philip Kelley
fcd81bcf52 No bitfields in public headers b/c packing is compiler-specific 2013-02-07 12:47:29 -05:00
Ben Straub
f393d4e8d7 Clone: fetch all tags 2013-02-06 13:07:56 -08:00
Ben Straub
b71bac9d2b Document callback-triggered cancellation 2013-02-05 12:06:14 -08:00
nulltoken
a0c34c9406 reset: Introduce git_reset_default() 2013-02-05 20:33:03 +01:00
Ben Straub
fe95ac1b67 Allow progress callback to cancel fetch
This works by having the indexer watch the return
code of the callback, so will only take effect
on object boundaries.
2013-02-05 10:59:58 -08:00
nulltoken
c67ffd4aa0 reset: Enhance documentation 2013-02-05 15:47:18 +01:00
nulltoken
3f0ed118d1 index: Enhance documentation 2013-02-05 15:47:16 +01:00
Ben Straub
7602cb7c0e Add user-from-url param to auth callback 2013-01-31 10:44:57 -08:00
Russell Belfer
f1e2735c74 Add helper for diff line stats
This adds a `git_diff_patch_line_stats()` API that gets the total
number of adds, deletes, and context lines in a patch.  This will
make it a little easier to emulate `git diff --stat` and the like.

Right now, this relies on generating the `git_diff_patch` object,
which is a pretty heavyweight way to get stat information.  At
some future point, it would probably be nice to be able to get
this information without allocating the entire `git_diff_patch`,
but that's a much larger project.
2013-01-30 11:10:39 -08:00
Russell Belfer
4657fc1cab Merge pull request #1285 from phkelley/vector
Vector improvements and their fallout
2013-01-29 13:54:08 -08:00
John Wiegley
5fb9820664 Added git_treebuilder_entrycount
Conflicts:
	src/tree.c
2013-01-28 16:35:43 -06:00
Philip Kelley
11d9f6b304 Vector improvements and their fallout 2013-01-27 14:17:07 -05:00
Sebastian Bauer
c253056d24 Added git_branch_name().
This is a convenience function to get the branch name of a given
ref. The returned branch name is compatible with the name that can
be supplied e.g. to git_branch_lookup(). That is, the prefixes
"refs/heads" or "refs/remotes" are omitted.

Also added a new test for testing the new function.
2013-01-25 05:24:21 +01:00
Philip Kelley
3fbd7485d8 Merge pull request #1250 from jamill/push_update_tips
Update remote tips on push
2013-01-24 11:03:11 -08:00
Vicent Marti
a0f777c87f opts: Add getters too 2013-01-23 23:44:34 +01:00
Vicent Marti
59853eff99 Global options setter 2013-01-23 02:58:58 +01:00
Jameson Miller
1d645aabef Update remote tips on push 2013-01-22 10:01:43 -05:00
Vicent Martí
ddcb28a41f Merge pull request #1239 from ethomson/index_remove
add an index_remove_bypath that removes conflicts
2013-01-17 16:56:57 -08:00
Vicent Martí
34a4ad46e8 Merge pull request #1211 from arrbee/fix-icase-status-file
Fix case insensitivity issues in git_status_file
2013-01-16 15:52:58 -08:00
Vicent Martí
4b45675d7c Merge pull request #1248 from sba1/doc-fix
Some doc improvements in transport.h
2013-01-16 14:20:41 -08:00
nulltoken
bf031581d3 branch: Introduce git_branch_tracking_name() 2013-01-16 22:56:13 +01:00
Sebastian Bauer
62d4fa23a8 Some doc improvements 2013-01-16 12:25:28 +01:00
Russell Belfer
98527b5b24 Add git_tree_entry_cmp and git_tree_entry_icmp
This adds a new external API git_tree_entry_cmp and a new internal
API git_tree_entry_icmp for sorting tree entries.  The case
insensitive one is internal only because general users should
never be seeing case-insensitively sorted trees.
2013-01-15 09:51:35 -08:00
Edward Thomson
25743bd7c5 add an index_remove_bypath that removes conflicts, renamed add_from_workdir to match 2013-01-12 13:47:56 -06:00
Vicent Martí
e2d2c6e57d Merge pull request #1222 from scunz/clone_branch
Switch to specified branch during clone
2013-01-12 02:14:14 -08:00
Sascha Cunz
f31cae8be9 Default git_clone_options' checkout strategy to GIT_CHECKOUT_SAFE_CREATE 2013-01-12 05:51:00 +01:00
Ben Straub
3874f2d54f Kill vestigal dangling-remote code
Fixes #1232
2013-01-11 20:23:46 -08:00
nulltoken
635c235cf3 errors: Introduce EMERGECONFLICT error code 2013-01-11 19:30:57 +01:00
Sascha Cunz
88aef76635 Implement analog for 'git checkout --branch xxx ...' 2013-01-11 03:10:19 +01:00
Russell Belfer
40342bd2b6 Add GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH
This adds an option to checkout a la the diff option to turn off
fnmatch evaluation for pathspec entries.  This can be useful to
make sure your "pattern" in really interpretted as an exact file
match only.
2013-01-10 15:15:37 -08:00
Vicent Martí
404880b1ba Merge pull request #1206 from ben/stock-auth
Expose stock user/pass credential utility
2013-01-10 11:24:09 -08:00
Vicent Marti
4a863c0666 Sane refresh logic
All the ODB backends have a specific refresh interface. When reading an
object, first we attempt every single backend: if the read fails, then
we refresh all the backends and retry the read one more time to see if
the object has appeared.
2013-01-10 15:34:56 +01:00
Ben Straub
520dcc1c00 Move credential helpers to their own (optional) header 2013-01-09 13:31:17 -08:00
Ben Straub
ffb02b1630 Expose stock user/pass credential utility 2013-01-09 13:31:17 -08:00