Commit Graph

804 Commits

Author SHA1 Message Date
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
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
Michael Schubert
abeefbbe18 push: properly handle tags
Currently, push doesn't really handle tags when queueing objects. Fix
it.
2013-01-09 17:05:21 +01:00
Jameson Miller
087f64d3e3 Relax refspecs accepted by push 2013-01-09 16:15:58 +01:00
Edward Thomson
359fc2d241 update copyrights 2013-01-08 17:31:27 -06:00
Russell Belfer
f2b7f7a6cb Share git_diff_blobs/git_diff_blob_to_buffer code
This moves the implementation of these two APIs into common code
that will be shared between the two.  Also, this adds tests for
the `git_diff_blob_to_buffer` API.  Lastly, this adds some extra
`const` to a few places that can use it.
2013-01-07 15:44:22 -08:00
Ignacio Casal Quinteiro
f6234cd994 Introduce git_diff_blob_to_buffer 2013-01-07 14:13:18 -08:00
Kevin Sawicki
7eb222fc7d Correct typos in documentation 2013-01-06 10:39:35 -08:00
Kevin Sawicki
e5562e181c Revert "Tab align value of GIT_FILEMODE_BLOB_EXECUTABLE"
This reverts commit 47fbcbb5a8.
2013-01-06 10:12:05 -08:00
Kevin Sawicki
47fbcbb5a8 Tab align value of GIT_FILEMODE_BLOB_EXECUTABLE 2013-01-06 10:02:37 -08:00
Russell Belfer
7fc0043582 Add index API to remove all files in a directory
This adds the git_index_remove_directory API plus tests.
2013-01-04 15:47:44 -08:00
Russell Belfer
77cffa31db Simplify checkout documentation
This moves a lot of the detailed checkout documentation into a new
file (docs/checkout-internals.md) and simplifies the public docs
for the checkout API.
2013-01-04 15:47:43 -08:00
Russell Belfer
a9a730075e Submodule caching fix and location API
This adds a new API to the submodule interface that just returns
where information about the submodule was found (e.g. config file
only or in the HEAD, index, or working directory).

Also, the old "refresh" call was potentially keeping some stale
submodule data around, so this simplfies that code and literally
discards the old cache, then reallocates.
2013-01-04 15:47:43 -08:00
Russell Belfer
5cf9875a4f Add index updating to checkout
Make checkout update entries in the index for all files that are
updated and/or removed, unless flag GIT_CHECKOUT_DONT_UPDATE_INDEX
is given.  To do this, iterators were extended to allow a little
more introspection into the index being iterated over, etc.
2013-01-04 15:47:42 -08:00
Russell Belfer
7e5c8a5b41 More checkout improvements
This flips checkout back to be driven off the changes between
the baseline and the target trees.  This reinstates the complex
code for tracking the contents of the working directory, but
overall, I think the resulting logic is easier to follow.
2013-01-04 15:47:42 -08:00
Russell Belfer
cf20803170 Rework checkout internals (again)
I've tried to map out the detailed behaviors of checkout and make
sure that we're handling the various cases correctly, along with
providing options to allow us to emulate "git checkout" and "git
checkout-index" with the various flags.  I've thrown away flags
in the checkout API that seemed like clutter and added some new
ones.  Also, I've converted the conflict callback to a general
notification callback so we can emulate "git checkout" output and
display "dirty" files.

As of this commit, the new behavior is not working 100% but some
of that is probably baked into tests that are not testing the
right thing.  This is a decent snapshot point, I think, along the
way to getting the update done.
2013-01-04 15:47:42 -08:00
Edward Thomson
42e50b5ed1 MERGE_HEAD contents iterator 2013-01-03 16:35:59 -06:00
Edward Thomson
ad2bc32fa3 expose merge metadata cleanup 2013-01-03 15:53:50 -06:00
Nikolai Vladimirov
8716b499e2 add option to allow git note overwrite 2013-01-03 16:31:36 +02:00
Vicent Martí
cd5ca5b97f Merge pull request #1152 from ben/clone-api-structification
Segregate in-memory and persisted remotes
2013-01-02 13:50:41 -08:00
Ben Straub
730df6d0f7 Include checkout options inline 2013-01-02 13:43:54 -08:00
Ben Straub
0642c1431e Move url to last place in parameter list 2013-01-02 12:44:47 -08:00
Sven Strickroth
46c2c1d538 Fixed compilation with VS >= 2010
Starting with VS2010 MS ships a stdint.h.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-12-28 13:47:13 +01:00
nulltoken
f19304d265 remote: Prevent create() from blindly overwriting 2012-12-24 18:18:31 +01:00