Commit Graph

834 Commits

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