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
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
nulltoken
ae35aa0708
remote: Improve documentation
2012-12-24 17:20:37 +01:00
nulltoken
b0aa14aa3c
remote: Enhance in-memory remote test coverage
2012-12-24 16:54:27 +01:00
Vicent Martí
2052e3c071
Merge pull request #1163 from barrbrain/check-exists-before-write
...
odb: check if object exists before writing
2012-12-21 10:32:23 -08:00
Ben Straub
79000951ec
In-memory remotes don't have names
2012-12-21 08:05:59 -08:00
David Michael Barr
4d185dd9b0
odb: check if object exists before writing
...
Update the procondition of git_odb_backend::write.
It may now be assumed that the object has already been hashed.
2012-12-21 13:05:20 +11:00
Ben Straub
87bc689fbf
git_remote_create calls git_remote_save
2012-12-20 15:50:33 -08:00
Ben Straub
874dcb25eb
Remote: deprecate dangling, prevent saving in-memory
2012-12-20 12:01:13 -08:00
Ben Straub
29f27599ea
Rename remote creation APIs
...
git_remote_add -> git_remote_create
git_remote_new -> git_remote_create_inmemory
2012-12-20 10:52:57 -08:00
Ben Straub
b412d56389
Add more clone options. Push test suite segfaults.
2012-12-19 17:02:06 -08:00
Edward Thomson
7fcec83428
fetchhead reading/iterating
2012-12-19 16:57:30 -06:00
Vicent Martí
e62171e2fc
Merge pull request #1151 from arrbee/fix-diff-constructor-names
...
Fix diff constructor names
2012-12-17 11:10:25 -08:00
Russell Belfer
ba084f7aaf
More diff.h comment fixes
...
Based on feedback from the ObjectiveGit folks, these are some
further updates to diff.h areas that are poorly documented.
2012-12-17 11:03:42 -08:00
Russell Belfer
56c72b759c
Fix diff constructor name order confusion
...
The diff constructor functions had some confusing names, where the
"old" side of the diff was coming after the "new" side. This
reverses the order in the function name to make it less confusing.
Specifically...
* git_diff_index_to_tree becomes git_diff_tree_to_index
* git_diff_workdir_to_index becomes git_diff_index_to_workdir
* git_diff_workdir_to_tree becomes git_diff_tree_to_workdir
2012-12-17 11:00:53 -08:00
nulltoken
a3337f10bb
blob: introduce git_blob_is_binary()
2012-12-17 17:20:31 +01:00
Ben Straub
b9e7e2b4e1
Move non-options back out of options struct
2012-12-14 13:46:45 -08:00
Ben Straub
18b2d560d3
Deploy git_clone_options; remove git_clone_bare
2012-12-14 13:03:59 -08:00
Ben Straub
7e61044019
Introduce git_clone_options
2012-12-14 12:30:57 -08:00
Ben Straub
7c353afd0e
Define constant for default fetch spec
2012-12-13 08:47:29 -08:00
Ben Straub
44f36f6e3b
Convert clone to use dangling remotes
2012-12-12 19:48:44 -08:00
Ben Straub
b914e17d82
API to set a dangling remote's repository
2012-12-12 12:23:24 -08:00
Ben Straub
a71c27ccda
Allow creation of dangling remotes
2012-12-12 12:15:25 -08:00
Russell Belfer
9950d27ab6
Clean up iterator APIs
...
This removes the need to explicitly pass the repo into iterators
where the repo is implied by the other parameters. This moves
the repo to be owned by the parent struct. Also, this has some
iterator related updates to the internal diff API to lay the
groundwork for checkout improvements.
2012-12-10 15:38:28 -08:00
Ben Straub
59bccf33c4
Add a payload param to git_cred_acquire_cb
...
Fixes #1128 .
2012-12-10 11:11:01 -08:00
Ben Straub
fac43c54a6
Allow compilation as C++
2012-12-06 19:41:52 -08:00
Russell Belfer
32770c52a8
Fix diff header comments and missing const
...
Based on the recent work to wrap diff in objective-git, this
includes a fix for a missing const and a number of clarifications
of the documentation.
2012-12-05 13:56:32 -08:00
Vicent Martí
e05ca13f1f
Merge pull request #1115 from ben/struct-versions
...
Version info for public structs
2012-12-05 11:47:19 -08:00
Ben Straub
de70aea6b1
Remove GIT_SIGNATURE_VERSION and friends
2012-12-03 12:41:50 -08:00
Ben Straub
2da619abde
Remove GIT_CRED_VERSION and friends
2012-12-03 12:41:38 -08:00
nulltoken
cc1466264a
revparse: Deploy EINVALIDSPEC usage
2012-12-01 08:34:31 +01:00
nulltoken
bc05f30c47
object: refine git_object_peel() error report
2012-12-01 08:34:29 +01:00
nulltoken
621730383a
branch: Deploy EINVALIDSPEC usage
2012-12-01 08:34:28 +01:00
nulltoken
18d6f12040
tag: Deploy EINVALIDSPEC usage
2012-12-01 08:34:28 +01:00
nulltoken
80212ecb1c
reflog: Deploy EINVALIDSPEC usage
2012-12-01 08:34:27 +01:00
nulltoken
80d9d1df14
refs: Deploy EINVALIDSPEC usage
2012-12-01 08:34:26 +01:00
nulltoken
032ba9e4ad
remote: deploy EINVALIDSPEC usage
2012-12-01 08:34:23 +01:00
nulltoken
8b50935a69
errors: Introduce EINVALIDSPEC error code
2012-12-01 08:34:22 +01:00
Ben Straub
7bcfbe16c5
Make constant name all-caps
2012-11-30 20:35:01 -08:00
Ben Straub
9267ff586f
Deploy GIT_REMOTE_CALLBACKS_INIT
2012-11-30 13:12:15 -08:00
Ben Straub
2f8d30becb
Deploy GIT_DIFF_OPTIONS_INIT
2012-11-30 13:12:14 -08:00
Ben Straub
f4fc9fdba0
Cleanup nitpicky things
2012-11-30 13:12:10 -08:00
Ben Straub
bde336ea51
Add version fields and init macros for public input structs.
2012-11-30 12:55:45 -08:00
Russell Belfer
f684970a10
Merge pull request #1108 from libgit2/ahead-behind-count
...
Add API to calculate ahead/behind count
2012-11-29 22:53:34 -08:00
Vicent Martí
f1e5c506b2
Merge pull request #1110 from libgit2/features/push_rebased
...
Push! By schu, phkelley, and congyiwu
2012-11-29 12:18:05 -08:00
Philip Kelley
ac22d08f2f
Remove git_object_oid2type
2012-11-29 08:22:15 -05:00
Vicent Martí
e2934db2c7
Merge pull request #1090 from arrbee/ignore-invalid-by-default
...
Ignore invalid entries by default
2012-11-29 02:05:46 -08:00
Scott J. Goldman
0984c8768d
Rename git_count_ahead_behind -> git_graph_ahead_behind
...
Moved it into graph.{c,h} which i created for the new "graph"
functions namespace. Also adjusted the function prototype
to use `size_t` and `const git_oid *`.
2012-11-28 18:54:57 -08:00
Scott J. Goldman
bff53e5405
Add initial implementation of ahead-behind count
2012-11-28 18:54:56 -08:00
Philip Kelley
613d5eb939
Push! By schu, phkelley, and congyiwu, et al
2012-11-28 11:42:37 -05:00
Vicent Marti
9507a434c6
odb: Add git_odb_add_disk_alternate
...
Loads a disk alternate by path to the ODB. Mimics the
`GIT_ALTERNATE_OBJECT_DIRECTORIES` shell var.
2012-11-28 10:47:10 +01:00
Russell Belfer
ca94e031fa
Various minor commenting fixes
2012-11-27 15:28:48 -08:00
Russell Belfer
c3fb7d04ed
Make git_odb_foreach_cb take const param
...
This makes the first OID param of the ODB callback a const pointer
and also propogates that change all the way to the backends.
2012-11-27 15:00:49 -08:00
Russell Belfer
f984d97b22
Clarify git_message_prettify comments
2012-11-27 15:00:28 -08:00
Russell Belfer
2bd5998c9c
Remove git_note_data structure
2012-11-27 14:47:39 -08:00
Ben Straub
336d1275ca
API updates for transport.h
2012-11-27 14:18:51 -08:00
Ben Straub
f4a62c306d
Typedef enums.
2012-11-27 14:13:03 -08:00
Ben Straub
1d8ec670be
API updates for stash.h
2012-11-27 14:06:56 -08:00
Ben Straub
ff6b5ac97d
API updates for signature.h
2012-11-27 14:03:53 -08:00
Ben Straub
44d9f2cb60
API updates for revwalk.h
2012-11-27 14:01:24 -08:00
Ben Straub
c9fc4a6ff9
API updates for repository.h
2012-11-27 13:44:49 -08:00
Ben Straub
df705148ec
API updates for remote.h
...
Includes typedef for git_direction, and renames for
GIT_DIR_[FETCH|PUSH] to GIT_DIRECTION_(\1).
2012-11-27 13:19:49 -08:00
Ben Straub
74f9132212
API updates for oid.h
2012-11-27 13:18:30 -08:00
Ben Straub
0ed67c1cb4
API updates for odb_backend.h
2012-11-27 13:18:30 -08:00
Ben Straub
2e76b5fc84
API updates for odb.h
2012-11-27 13:18:30 -08:00
Ben Straub
de5596bfd6
API updates for notes.h/c.
2012-11-27 13:18:30 -08:00
Ben Straub
05a3ab61c2
API updates for net.h
2012-11-27 13:18:29 -08:00
Ben Straub
fe55f1631c
API updates for message.h
2012-11-27 13:18:29 -08:00
Ben Straub
eac7695683
Format/documentation tweaks for merge.h
2012-11-27 13:18:29 -08:00
Ben Straub
839c5f574f
API updates for indexer.h
2012-11-27 13:18:29 -08:00
Russell Belfer
a8122b5d4a
Fix warnings on Win64 build
2012-11-27 13:18:29 -08:00
Russell Belfer
d574de0e6e
API updates for status.h
2012-11-27 13:18:29 -08:00
Russell Belfer
9daf240053
Fixing up some comments in strarray.h
2012-11-27 13:18:29 -08:00
Russell Belfer
16248ee2d1
Fix up some missing consts in tree & index
...
This fixes some missed places where we can apply const-ness to
various public APIs.
There are still some index and tree APIs that cannot take const
pointers because we sort our `git_vectors` lazily and so we can't
reliably bsearch the index and tree content without applying a
`git_vector_sort()` first.
This also fixes some missed places where size_t can be used and
where const can be applied to a couple internal functions.
2012-11-27 13:18:29 -08:00
Ben Straub
f45d51ff8e
API updates for index.h
2012-11-27 13:18:28 -08:00
Russell Belfer
d9023dbe0c
API updates for tag.h
2012-11-27 13:18:28 -08:00
Russell Belfer
9cd423583f
API updates for submodule.h
2012-11-27 13:18:28 -08:00
Russell Belfer
793c438559
Update diff callback param order
...
This makes the diff functions that take callbacks both take
the payload parameter after the callback function pointers and
pass the payload as the last argument to the callback function
instead of the first. This should make them consistent with
other callbacks across the API.
2012-11-27 13:18:28 -08:00
Ben Straub
54b2a37ac7
Clean up config.h
2012-11-27 13:18:28 -08:00
Russell Belfer
eecc805029
Update callback fn ptr for git_reference_foreach
...
As part of API review, use a typedef for the callback fn ptr.
2012-11-27 13:18:28 -08:00
Russell Belfer
e120123e36
API review / update for tree.h
2012-11-27 13:18:28 -08:00
Russell Belfer
824cb2d5e5
Updates to reset.h
2012-11-27 13:18:28 -08:00
Vicent Marti
cfbe4be3fb
More external API cleanup
...
Conflicts:
src/branch.c
tests-clar/refs/branches/create.c
2012-11-27 13:18:27 -08:00
Ben Straub
2508cc66eb
Rename ref and reflog apis for consistency
2012-11-27 13:17:45 -08:00
Russell Belfer
02df42ddbf
Set up default internal ignores
...
This adds "." ".." and ".git" to the internal ignores list by
default - asking about paths with these files will always say
that they are ignored.
2012-11-19 16:33:30 -08:00
nulltoken
b15df1d937
reflog: make entry_byindex() and drop() git compliant
...
Passing 0 as the index now retrieves the most recent entry instead
of the oldest one.
2012-11-17 18:30:35 -08:00
nulltoken
1a764476d2
reflog: Fix documentation
2012-11-17 18:30:34 -08:00
nulltoken
270160b91a
config: Opening a nonexistent file returns ENOTFOUND
2012-11-17 18:30:34 -08:00
nulltoken
d36451c9d4
config: Make git_config_file__ondisk() internal
2012-11-17 12:34:15 -08:00
nulltoken
6091457e76
repo: ensure is_empty() checks there are no refs
2012-11-17 07:20:08 -08:00
nulltoken
aa8a76eff9
tag: rename git_tag_type to git_tag_target_type
2012-11-17 05:41:20 -08:00
Vicent Martí
4a0c7f56ab
Merge pull request #1074 from edubart/ignore_diff_filemode
...
Add option to ignore file mode in diffs
2012-11-15 10:31:11 -08:00
Eduardo Bart
c0d5acf69a
Add option to ignore file mode in diffs
2012-11-15 14:59:39 -02:00
Russell Belfer
bbe6dbec81
Add explicit git_index ptr to diff and checkout
...
A number of diff APIs and the `git_checkout_index` API take a
`git_repository` object an operate on the index. This updates
them to take a `git_index` pointer explicitly and only fall back
on the `git_repository` index if the index input is NULL. This
makes it easier to operate on a temporary index.
2012-11-14 23:29:48 -08:00
Russell Belfer
5735bf5e6a
Fix diff API to better parameter order
...
The diff API is not in the parameter order one would expect from
other libgit2 APIs. This fixes that.
2012-11-14 22:54:31 -08:00
Vicent Martí
aa1c3b588e
Merge pull request #1016 from arrbee/fix-checkout-dir-removal
...
Update checkout with new strategies & behavior
2012-11-13 14:13:47 -08:00
Carlos Martín Nieto
3ee078c0f7
config: rename get_config_entry -> config_entry
...
We're already in the git_config namespace, there is no need to repeat
it.
2012-11-13 13:46:17 -08:00
Edward Thomson
7ebefd22e7
move hash library func ptrs to global global
2012-11-13 10:23:05 -06:00
nulltoken
b1a3a70ed1
repository: Refine repository_head() error report
2012-11-12 00:14:51 +01:00