Commit Graph

804 Commits

Author SHA1 Message Date
Ben Straub
2c8bbb27d9 Convert checkout_index to use progress callback 2012-10-19 19:34:15 -07:00
Ben Straub
d57c47dc07 Add accessor for git_remote's stats field
Also converted the network example to use it.
2012-10-19 19:34:15 -07:00
Ben Straub
3028be0723 Add git_indexer_stats field to git_remote
Also removing all the *stats parameters from external
APIs that don't need them anymore.
2012-10-19 19:34:14 -07:00
Ben Straub
92f91b0e3b Clone: fix indentation 2012-10-19 19:34:14 -07:00
Vicent Marti
875b16eb54 repository: Typo 2012-10-19 23:44:49 +02:00
nulltoken
8b05bea870 errors: deploy GIT_EORPHANEDHEAD usage 2012-10-19 22:01:53 +02:00
nulltoken
c4f68b3503 errors: introduce GIT_EORPHANEDHEAD 2012-10-19 21:23:34 +02:00
Carlos Martín Nieto
f0d2ddbbf8 remote: support fetch cancelation
Introduce git_remote_stop() which sets a variable that is checked by
the fetch process in a few key places. If this is variable is set, the
fetch is aborted.
2012-10-18 04:31:03 +02:00
Russell Belfer
4c47a8bcfe Merge pull request #968 from arrbee/diff-support-typechange
Support TYPECHANGE records in status and adjust checkout accordingly
2012-10-17 14:14:51 -07:00
Ben Straub
6012e86839 Merge pull request #972 from PaulThompson/separate_strarray
Separated git_strarray from common.h.  Added doxy comments.
2012-10-17 11:55:26 -07:00
Vicent Martí
52748f7b9f Merge pull request #952 from csware/config-locations
Config location fixes
2012-10-16 08:36:55 -07:00
Philip Kelley
9e37305aad Merge pull request #984 from arrbee/fix-fnmatch-and-ignore
Fix single file ignores
2012-10-16 08:34:28 -07:00
Russell Belfer
52032ae536 Fix single-file ignore checks
To answer if a single given file should be ignored, the path to
that file has to be processed progressively checking that there
are no intermediate ignored directories in getting to the file
in question.  This enables that, fixing the broken old behavior,
and adds tests to exercise various ignore situations.
2012-10-15 12:54:46 -07:00
nulltoken
4d968f134b clone: Explicit support of no-checkout option 2012-10-15 20:40:37 +02:00
Paul Thompson
b46708aaf9 Separated git_strarray from common.h. Added doxy comments. 2012-10-11 23:04:08 +11:00
Russell Belfer
fe67e404da Move enum comments next to actual values 2012-10-09 14:35:24 -07:00
Michael Schubert
0a32dca5ec gsoc-pack-objects WIP 2012-10-09 21:28:31 +02:00
Michael Schubert
2f05339e3e Add git_tag_foreach 2012-10-09 21:28:31 +02:00
Russell Belfer
0d64bef941 Add complex checkout test and then fix checkout
This started as a complex new test for checkout going through the
"typechanges" test repository, but that revealed numerous issues
with checkout, including:

* complete failure with submodules
* failure to create blobs with exec bits
* problems when replacing a tree with a blob because the tree
  "example/" sorts after the blob "example" so the delete was
  being processed after the single file blob was created

This fixes most of those problems and includes a number of other
minor changes that made it easier to do that, including improving
the TYPECHANGE support in diff/status, etc.
2012-10-09 11:59:34 -07:00
Russell Belfer
95f5f1e63a Cleanup TYPECHANGE support
This is just some cleanup code, rearranging some of the checkout
code where TYPECHANGE support was added and adding some comments
to the diff header regarding the constants.
2012-10-09 11:54:01 -07:00
Russell Belfer
bc16fd3ebf Introduce status/diff TYPECHANGE flags
When I wrote the diff code, I based it on core git's diff output
which tends to split a type change into an add and a delete.  But
core git's status has the notion of a T (typechange) flag for a
file.  This introduces that into our status APIs and modifies the
diff code so it can be forced to not split type changes.
2012-10-09 11:54:01 -07:00
Vicent Martí
21e0d297af Merge pull request #967 from arrbee/diff-submodule-tests-and-fixes
Diff submodule tests and fixes
2012-10-09 11:45:50 -07:00
Russell Belfer
5d1308f25f Add test for diffs with submodules and bug fixes
The adds a test for the submodule diff capabilities and then
fixes a few bugs with how the output is generated.  It improves
the accuracy of OIDs in the diff delta object and makes the
submodule output more closely mirror the OIDs that will be used
by core git.
2012-10-08 15:22:40 -07:00
Russell Belfer
dfbff793b8 Fix a few diff bugs with directory content
There are a few cases where diff should leave directories in
the diff list if we want to match core git, such as when the
directory contains a .git dir.  That feature was lost when I
introduced some of the new submodule handling.

This restores that and then fixes a couple of related to diff
output that are triggered by having diffs with directories in
them.

Also, this adds a new flag that can be passed to diff if you
want diff output to actually include the file content of any
untracked files.
2012-10-08 15:22:40 -07:00
nulltoken
0c78f685eb branch: introduce git_branch_is_head() 2012-10-07 21:03:51 +02:00
Russell Belfer
eada0762dd Merge pull request #939 from pwkelley/ignorecase
Support for the core.ignorecase flag
2012-10-02 10:45:40 -07:00
Sven Strickroth
4258d4832b Rename xdr to xdg
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-10-02 17:21:07 +02:00
Carlos Martín Nieto
3230a44f4c remote: support downloading all tags
Also honor remote.$name.tagopt = --tags.
2012-09-30 12:05:28 +02:00
Carlos Martín Nieto
f70e466f68 remote: add accessors for the autotag setting 2012-09-30 12:04:49 +02:00
Carlos Martín Nieto
24f2f94e7d fetch: use the include-tag capability
This tells the remote to send us any tags that point to objects that
we are downloading.
2012-09-30 11:56:38 +02:00
Carlos Martín Nieto
3665ba8eeb refspec: add git_refspec__free, remove git_refspec_parse
The latter shouldn't be exposed and isn't used, git_refspec__parse
supersedes it.

Fix a leak in the refspec tests while we're at it.
2012-09-30 11:56:37 +02:00
Russell Belfer
bae957b95d Add const to all shared pointers in diff API
There are a lot of places where the diff API gives the user access
to internal data structures and many of these were being exposed
through non-const pointers.  This replaces them all with const
pointers for any object that the user can access but is still
owned internally to the git_diff_list or git_diff_patch objects.

This will probably break some bindings...  Sorry!
2012-09-25 16:35:05 -07:00
Russell Belfer
6428630865 Fix bugs in new diff patch code
This fixes all the bugs in the new diff patch code.  The only
really interesting one is that when we merge two diffs, we now
have to actually exclude diff delta records that are not supposed
to be tracked, as opposed to before where they could be included
because they would be skipped silently by `git_diff_foreach()`.
Other than that, there are just minor errors.
2012-09-25 16:35:05 -07:00
Russell Belfer
5f69a31f7d Initial implementation of new diff patch API
Replacing the `git_iterator` object, this creates a simple API
for accessing the "patch" for any file pair in a diff list and
then gives indexed access to the hunks in the patch and the lines
in the hunk.  This is the initial implementation of this revised
API - it is still broken, but at least builds cleanly.
2012-09-25 16:35:05 -07:00
Russell Belfer
9a12a6256e New take on iterating over diff content
Allow diff deltas to be accessed by index and make patch generation
explicit with hunk and line access by index as well.
2012-09-25 16:35:05 -07:00
Vicent Martí
5942bd18bf Merge pull request #947 from arrbee/public-error-set
Make giterr_set_str() and giterr_set_oom() public APIs
2012-09-25 14:53:13 -07:00
nulltoken
77e06d7e85 refs: introduce git_reference_is_valid_name() 2012-09-25 07:49:15 +02:00
nulltoken
c030ada7ff refs: make git_reference_normalize_name() accept refspec pattern 2012-09-25 07:49:14 +02:00
Sven Strickroth
8b4f9b1758 Correctly read xdr compatible %HOME%/.config/git/config config file
This file is not just read if the global config file (%HOME%/.gitconfig)
is not found, however, it is used everytime but with lower priority.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-24 18:59:00 +02:00
Sven Strickroth
f55af775ab Make clear that git_odb_hashfile does not use filters
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-22 01:16:10 +02:00
Russell Belfer
1a62810053 Make giterr_set_str public
There has been discussion for a while about making some set of
the `giterr_set` type functions part of the public API for code
that is implementing new backends to libgit2.  This makes the
`giterr_set_str()` and `giterr_set_oom()` functions public.
2012-09-21 15:04:39 -07:00
nulltoken
9e592583fc checkout: add notification callback for skipped files 2012-09-21 08:08:29 +02:00
Philip Kelley
ec40b7f99f Support for core.ignorecase 2012-09-17 15:42:41 -04:00
nulltoken
397837197d checkout: Mimic git_diff_options storage of paths 2012-09-17 20:27:28 +02:00
nulltoken
44af67a8b6 repository: introduce git_repository_set_head() 2012-09-17 10:48:35 +02:00
nulltoken
4ebe38bd58 repository: introduce git_repository_set_head_detached() 2012-09-17 10:48:35 +02:00
nulltoken
3f4c3072ea repository: introduce git_repository_detach_head() 2012-09-17 10:48:34 +02:00
nulltoken
cc548c7b0f repository: fix documentation typo 2012-09-17 10:48:33 +02:00
nulltoken
5af61863dd checkout: drop git_checkout_reference() 2012-09-17 10:48:30 +02:00
nulltoken
c214fa1caf checkout: segregate checkout strategies 2012-09-17 10:48:30 +02:00
nulltoken
ee8bb8ba64 reset: add support for GIT_RESET_HARD mode 2012-09-17 10:48:28 +02:00
nulltoken
e93af30411 checkout: introduce git_checkout_index() 2012-09-17 10:48:27 +02:00
nulltoken
3aa443a951 checkout: introduce git_checkout_tree() 2012-09-17 10:48:26 +02:00
Vicent Martí
9be2261eaa Merge pull request #927 from arrbee/hashfile-with-filters
Add git_repository_hashfile to hash with filters
2012-09-13 09:24:12 -07:00
Russell Belfer
a13fb55afd Add tests and improve param checks
Fixed some minor `git_repository_hashfile` issues:

- Fixed incorrect doc (saying that repo could be NULL)
- Added checking of object type value to acceptable ones
- Added more tests for various parameter permutations
2012-09-11 17:26:21 -07:00
Russell Belfer
47bfa0be6d Add git_repository_hashfile to hash with filters
The existing `git_odb_hashfile` does not apply text filtering
rules because it doesn't have a repository context to evaluate
the correct rules to apply.  This adds a new hashfile function
that will apply repository-specific filters (based on config,
attributes, and filename) before calculating the hash.
2012-09-11 15:01:09 -07:00
Vicent Martí
21d847d38f Merge pull request #920 from scunz/mergebase_const
git_mergebase: Constness-Fix for consistency
2012-09-11 14:56:13 -07:00
Vicent Marti
412293dcc9 Merge branch 'diff-crlf-filters' into development 2012-09-11 23:38:16 +02:00
Russell Belfer
1f35e89dbf Fix diff binary file detection
In the process of adding tests for the max file size threshold
(which treats files over a certain size as binary) there seem to
be a number of problems in the new code with detecting binaries.
This should fix those up, as well as add a test for the file
size threshold stuff.

Also, this un-deprecates `GIT_DIFF_LINE_ADD_EOFNL`, since I
finally found a legitimate situation where it would be returned.
2012-09-11 12:03:33 -07:00
Russell Belfer
eff14d384c Merge pull request #906 from nulltoken/topic/git_reference_peel
git reference peel
2012-09-10 23:15:54 -07:00
Russell Belfer
e597b1890e Move diff max_size to public API
This commit adds a max_size value in the public `git_diff_options`
structure so that the user can automatically flag blobs over a
certain size as binary regardless of other properties.

Also, and perhaps more importantly, this moves binary detection
to be as early as possible in the diff traversal inner loop and
makes sure that we stop loading objects as soon as we decide that
they are binary.
2012-09-10 11:49:12 -07:00
Russell Belfer
b36effa22e Replace git_diff_iterator_num_files with progress
The `git_diff_iterator_num_files` API was problematic, since we
don't actually know the exact number of files to be iterated over
until we load those files into memory.  This replaces it with a
new `git_diff_iterator_progress` API that goes from 0 to 1, and
moves and renamed the old API for the internal places that can
tolerate a max value instead of an exact value.
2012-09-10 09:59:14 -07:00
Sascha Cunz
857323d4db git_mergebase: Constness-Fix for consistency 2012-09-09 15:53:57 +02:00
Russell Belfer
17b06f4d47 Add missing accessor for fetchRecurseSubmodules
When `git_submodule` became an opaque structure, I forgot to add
accessor functions for the fetchRecurseSubmodules config setting.
This fixes that.
2012-09-07 15:49:08 -07:00
Russell Belfer
8f9b6a132b Better header comments 2012-09-06 15:34:02 -07:00
nulltoken
746642a6b3 checkout: fix documentation code alignment 2012-09-06 18:40:08 +02:00
nulltoken
bb2d305c20 errors: introduce GIT_EBAREREPO 2012-09-06 18:40:06 +02:00
nulltoken
316659489a refs: introduce git_reference_peel()
Fix #530
2012-09-06 18:40:05 +02:00
Vicent Martí
7a3fc9fb17 Merge pull request #900 from pwkelley/development
Expose a malloc function to 3rd party ODB backends
2012-09-06 01:17:23 -07:00
Vicent Marti
01ae1909c5 diff: Cleanup documentation and printf compat 2012-09-06 10:13:38 +02:00
Russell Belfer
510f1bac6b Fix comments and a minor bug
This adds better header comments and also fixes a bug in one of
simple APIs that tells the number of lines in the current hunk.
2012-09-05 15:17:24 -07:00
Russell Belfer
f335ecd6e1 Diff iterators
This refactors the diff output code so that an iterator object
can be used to traverse and generate the diffs, instead of just
the `foreach()` style with callbacks.  The code has been rearranged
so that the two styles can still share most functions.

This also replaces `GIT_REVWALKOVER` with `GIT_ITEROVER` and uses
that as a common error code for marking the end of iteration when
using a iterator style of object.
2012-09-05 15:17:24 -07:00
Vicent Martí
4d3834038b Merge pull request #856 from libgit2/utf8-win
Windows: Perform UTF-8 path conversion on the Stack
2012-09-04 14:19:24 -07:00
Vicent Marti
c9d223f0de branch: Add missing include 2012-09-04 22:57:31 +02:00
Vicent Marti
6813169ac9 windows: Keep UTF-8 on the stack yo 2012-08-28 23:09:43 -07:00
Vicent Marti
62eafd0620 Merge branch 'branch-delete-ref' into development
Conflicts:
	include/git2/refs.h
2012-08-27 14:54:52 -07:00
Vicent Martí
bd2887a5e5 Merge pull request #904 from arrbee/better-object-peel
Make git_object_peel a bit smarter
2012-08-27 14:52:26 -07:00
Vicent Martí
b9d283d14a Merge pull request #897 from nulltoken/topic/git_reference_check_format
refs: expose git_reference_normalize_name()
2012-08-27 13:39:17 -07:00
Russell Belfer
d8057a5b0e Make git_object_peel a bit smarter
This expands the types of peeling that `git_object_peel` knows
how to do to include TAG -> BLOB peeling, and makes the errors
slightly more consistent depending on the situation.  It also
adds a new special behavior where peeling to ANY will peel until
the object type changes (e.g. chases TAGs to a non-TAG).

Using this expanded peeling, this replaces peeling code that was
embedded in `git_tag_peel` and `git_reset`.
2012-08-27 11:53:59 -07:00
Philip Kelley
c49d328cf4 Expose a malloc function to 3rd party ODB backends 2012-08-27 09:59:13 -04:00
nulltoken
2e0c881670 refs: expose git_reference_normalize_name() 2012-08-27 08:41:26 +02:00
Vicent Marti
1c947daa80 branch: Change git_branch_delete to take a ref 2012-08-26 18:00:10 -07:00
Carlos Martín Nieto
2b175ca972 indexer: kill git_indexer_stats.data_received
It's not really needed with the current code as we have EOS and the
sideband's flush to tell us we're done.

Keep the distinction between processed and received objects.
2012-08-26 00:42:28 +02:00
Vicent Martí
b7e8827b8b Merge pull request #895 from carlosmn/sideband
Add sideband support
2012-08-24 16:29:01 -07:00
Carlos Martín Nieto
e03e71da56 network: add sideband support
This lets us notify the user of what the remote end is doing while we
wait for it to start sending us the packfile.
2012-08-24 20:29:39 +02:00
Russell Belfer
5f4a61aea8 Working implementation of git_submodule_status
This is a big redesign of the git_submodule_status API and the
implementation of the redesigned API.  It also fixes a number of
bugs that I found in other parts of the submodule API while
writing the tests for the status part.

This also fixes a couple of bugs in the iterators that had not
been noticed before - one with iterating when there is a gitlink
(i.e. separate-work-dir) and one where I was treating anything
even vaguely submodule-like as a submodule, more aggressively
than core git does.
2012-08-24 11:00:27 -07:00
Russell Belfer
aa13bf05c8 Major submodule rewrite
This replaces the old submodule API with a new extended API that
supports most of the things that can be done with `git submodule`.
2012-08-24 11:00:26 -07:00
Carlos Martín Nieto
bffa852f89 indexer: recognize and mark when all of the packfile has been downloaded
We can't always rely on the network telling us when the download is
finished. Recognize it from the indexer itself.
2012-08-24 19:01:10 +02:00
Russell Belfer
e9ca852e4d Fix warnings and merge issues on Win64 2012-08-23 09:20:17 -07:00
Russell Belfer
85bd174626 Some cleanup suggested during review
This cleans up a number of items suggested during code review
with @vmg, including:

* renaming "outside repo" config API to `git_config_open_default`
* killing the `git_config_open_global` API
* removing the `git_` prefix from the static functions in fileops
* removing some unnecessary functionality from the "cp" command
2012-08-22 16:16:42 -07:00
Russell Belfer
ca1b6e5409 Add template dir and set gid to repo init
This extends git_repository_init_ext further with support for
initializing the repository from an external template directory
and with support for the "create shared" type flags that make a
set GID repository directory.

This also adds tests for much of the new functionality to the
existing `repo/init.c` test suite.

Also, this adds a bunch of new utility functions including a
very general purpose `git_futils_mkdir` (with the ability to
make paths and to chmod the paths post-creation) and a file
tree copying function `git_futils_cp_r`.  Also, this includes
some new path functions that were useful to keep the code
simple.
2012-08-22 16:07:19 -07:00
Russell Belfer
662880ca60 Add git_repository_init_ext for power initters
The extended version of repository init adds support for many
of the things that you can do with `git init` and sets up
structures that will make it easier to extend further in the
future.
2012-08-22 16:06:22 -07:00
Vicent Martí
cfda29e382 Merge pull request #891 from arrbee/internal-ignore-api
API for managing in-memory ignore rules
2012-08-22 13:15:14 -07:00
Russell Belfer
2fb4e9b3c5 Wrap up ignore API and add tests
This fills out the ignore API and adds tests.
2012-08-22 11:42:00 -07:00
nulltoken
9d7ac675d0 tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode() 2012-08-21 23:15:13 +02:00
nulltoken
a7dbac0b23 filemode: deploy enum usage 2012-08-21 23:15:10 +02:00
nulltoken
d854d59e31 filemode: introduce enum to ease use of attributes 2012-08-21 23:15:08 +02:00
nulltoken
66439b0b1a treebuilder: enhance attributes handling on insertion 2012-08-19 14:11:59 +02:00
Vicent Martí
f98c32f3fe Merge pull request #778 from ben/clone
Clone
2012-08-19 01:26:06 -07:00
nulltoken
e0db9f1117 refs: fix missing parameter documentation 2012-08-15 17:54:05 +02:00
nulltoken
5fd17fc217 notes: slight documentation enhancements 2012-08-15 17:50:02 +02:00
Carlos Martín Nieto
85f28ba891 Merge pull request #873 from carlosmn/tree-walk
git_tree_walk callback return value semantic does not match documentation
2012-08-14 11:43:20 -07:00
Russell Belfer
3a6bc301c5 Merge pull request #875 from arrbee/fix-message-prettify-length-check
Fix message prettify length check
2012-08-14 11:30:18 -07:00
Russell Belfer
85a0e28b80 Make git_message_prettify return bytes written
If you want to be absolutely safe with git_message_prettify, you
can now pass a NULL pointer for the buffer and get back the number
of bytes that would be copied into the buffer.

This means that an error is a non-negative return code and a
success will be greater than zero from this function.
2012-08-14 10:50:58 -07:00
Vicent Martí
e08ca0d4a7 Merge pull request #871 from joshtriplett/fix-note_foreach-docs
git_note_foreach: Fix documentation for notes_ref parameter
2012-08-13 21:04:27 -07:00
Vicent Martí
a6ee620185 Merge pull request #870 from joshtriplett/fix-note_create-docs
git_note_oid: Fix the documentation to reference parameters using the correct names
2012-08-13 21:02:35 -07:00
Vicent Martí
0374e6abe7 Merge pull request #872 from joshtriplett/fix-note_remove-docs
git_note_create: Copyediting on documentation for the oid parameter
2012-08-13 21:02:12 -07:00
Carlos Martín Nieto
a6bf16878a tree: allow the user to skip an entry or cancel the walk
Returning a negative cancels the walk, and returning a positive one
causes us to skip an entry, which was previously done by a negative
value.

This allows us to stay consistent with the rest of the functions that
take a callback and keeps the skipping functionality.
2012-08-13 14:07:47 +02:00
Josh Triplett
39a60efd39 git_note_remove: Copyediting on documentation for the oid parameter 2012-08-12 11:31:12 -07:00
Josh Triplett
d45ada03cf git_note_foreach: Fix documentation for notes_ref parameter 2012-08-12 06:31:42 -07:00
Josh Triplett
22408f4d5f git_note_oid: Fix the documentation to reference parameters using the correct names 2012-08-12 05:53:30 -07:00
Josh Triplett
b90202bbdd Fix incorrect array size in example for git_config_get_mapped
In the documentation for git_config_get_mapped, the sample mapping
array uses [3] but has 4 entries.  Fix by dropping the size entirely and
letting the compiler figure it out.
2012-08-12 03:56:15 -07:00
Josh Triplett
5389005d93 Export git_attr_value
Commit 0c9eacf3d2 introduced the function
git_attr_value and switched the GIT_ATTR_* macros to use it, but
attempting to use that function leads to a linker error (undefined
reference to `git_attr_value').  Export git_attr_value so programs can
actually call it.
2012-08-11 18:14:07 -07:00
Vicent Marti
51e1d80846 Merge remote-tracking branch 'arrbee/tree-walk-fixes' into development
Conflicts:
	src/notes.c
	src/transports/git.c
	src/transports/http.c
	src/transports/local.c
	tests-clar/odb/foreach.c
2012-08-06 12:41:08 +02:00
Russell Belfer
5dca201072 Update iterators for consistency across library
This updates all the `foreach()` type functions across the library
that take callbacks from the user to have a consistent behavior.
The rules are:

* A callback terminates the loop by returning any non-zero value
* Once the callback returns non-zero, it will not be called again
  (i.e. the loop stops all iteration regardless of state)
* If the callback returns non-zero, the parent fn returns GIT_EUSER
* Although the parent returns GIT_EUSER, no error will be set in
  the library and `giterr_last()` will return NULL if called.

This commit makes those changes across the library and adds tests
for most of the iteration APIs to make sure that they follow the
above rules.
2012-08-03 17:08:01 -07:00
Vicent Marti
e25dda51c4 Merge remote-tracking branch 'nulltoken/topic/amd64-compat' into development
Conflicts:
	src/netops.c
	src/netops.h
	src/oid.c
2012-08-02 01:38:30 +02:00
Vicent Martí
95a1d87614 Merge pull request #850 from libgit2/attr-export
attr: Do not export variables externally
2012-08-01 16:31:00 -07:00
Vicent Martí
e5f495012d Merge pull request #848 from carlosmn/pending-message
repository: add a getter and remove function for git's prepared message
2012-08-01 16:21:41 -07:00
Vicent Marti
0c9eacf3d2 attr: Do not export variables externally
Fixes #824

Exporting variables in a dynamic library is a PITA. Let's keep
these values internally and wrap them through a helper method.

This doesn't break the external API. @arrbee, aren't you glad I turned
the `GIT_ATTR_` macros into function macros? 
2012-08-02 01:15:24 +02:00
Sascha Cunz
e564e4969c Add function to query for compile time settings. 2012-08-01 20:02:32 +02:00
Carlos Martín Nieto
074841ec6a repository: add a getter and remove function for git's prepared message
The 'git revert/cherry-pick/merge -n' commands leave .git/MERGE_MSG
behind so that git-commit can find it. As we don't yet support these
operations, users who are shelling out to let git perform these
operations haven't had a convenient way to get this message.

These functions allow the user to retrieve the message and remove it
when she's created the commit.
2012-08-01 18:39:20 +02:00
Ben Straub
8b67f72b9c Add documentation for clone methods. 2012-07-31 21:25:48 -07:00
Ben Straub
5280f4e698 Add checkout.h to git2.h.
Also correcting some documentation strings.
2012-07-31 19:39:06 -07:00
Vicent Martí
bfb5916468 Merge pull request #833 from carlosmn/odb-one
odb: allow creating an ODB backend from a packfile index
2012-07-31 10:16:21 -07:00
Ben Straub
4bf5115642 Enable stats on git_index_read_tree.
Replace with the contents of 
git_index_read_tree_with_stats() and improve
documentation comments.
2012-07-30 15:48:06 -07:00
Ben Straub
f1587b97a1 Checkout: use git_index_read_tree_with_stats.
New variant of git_index_read_tree that fills in
the 'total' field of a git_indexer_stats struct
as it's walking the tree.
2012-07-30 14:37:40 -07:00
Michael Schubert
f6b26e770f git_oid_cmp: inline memcmp by hand to optimize
git.git uses an inlined hashcmp function instead of memcmp, since it
performes much better when comparing hashes (most hashes compared
diverge within the first byte).

Measurements and rationale for the curious reader:
http://thread.gmane.org/gmane.comp.version-control.git/172286
2012-07-29 20:50:58 +02:00
Ben Straub
b31667fb69 Checkout: add head- and ref-centric checkouts.
Renamed git_checkout_index to what it really was,
and removed duplicate code from clone.c. Added
git_checkout_ref, which updates HEAD and hands off
to git_checkout_head.

Added tests for the options the caller can pass to
git_checkout_*.
2012-07-27 20:31:05 -07:00
Ben Straub
a4827a5b5c Merge remote-tracking branch 'upstream/development' into test-merge 2012-07-27 11:17:21 -07:00
Vicent Martí
60d5cc5747 Merge pull request #834 from carlosmn/network-callbacks
Add a struct for network callbacks
2012-07-27 09:52:44 -07:00
Vicent Marti
f0244463ad branch: Add repository argument to create
Yes, we can get the repository from the owner of the object, but having
it marked explicitly makes the API more consistent.
2012-07-27 18:49:37 +02:00
Vicent Marti
b41a30bdbb Merge remote-tracking branch 'nulltoken/topic/branch-rework' into development 2012-07-27 18:45:55 +02:00
Vicent Marti
b84f75c357 reflog: Rename entry_drop to drop 2012-07-27 18:43:02 +02:00
Vicent Marti
43b67d496b Merge remote-tracking branch 'nulltoken/topic/reflog-delete' into development 2012-07-27 18:39:40 +02:00
Ben Straub
095ccc013f Checkout: implementation of most options 2012-07-26 16:31:49 -07:00
Russell Belfer
2031760c62 Fix git_tree_walk to return user error
This makes sure that an error code returned by the callback function
of `git_tree_walk` will stop the iteration and get propagated back
to the caller verbatim.

Also, this adds a minor helper function `git_tree_entry_byoid` that
searches a `git_tree` for an entry with the given OID.  This isn't
a fast function, but it's easier than writing the loop yourself as
an external user of the library.
2012-07-26 16:10:22 -07:00
Sascha Cunz
765015902a Remotes: Setter for url+pushurl; Getter for pushurl 2012-07-26 23:08:22 +02:00
Ben Straub
b401bace1b Restructure for better checkout options
* Removed the #define for defaults
* Promoted progress structure to top-level API call
  argument
2012-07-26 13:12:21 -07:00
Ben Straub
ef9905c990 checkout: introduce git_checkout_opts
Refactor checkout into several more-sensible
entry points, which consolidates common options
into a single structure that may be passed around.
2012-07-26 12:58:44 -07:00
nulltoken
40c75652d0 reflog: prevent git_reflog_append() from persisting the reflog back to disk 2012-07-25 07:53:32 +02:00
nulltoken
ae8331784e reflog: prevent git_reflog_read() from chocking when no log exists yet 2012-07-25 07:53:31 +02:00
nulltoken
bd72425d16 reflog: introduce git_reflog_write() 2012-07-25 07:53:30 +02:00
nulltoken
d284b3de63 reflog: rename git_reflog_write() to git_reflog_append() 2012-07-25 07:53:30 +02:00
nulltoken
59341a5d59 reflog: introduce git_reflog_entry_drop() 2012-07-25 07:53:29 +02:00
nulltoken
b8457baae2 portability: Improve x86/amd64 compatibility 2012-07-24 16:10:12 +02:00
nulltoken
ef4d795ec5 refs: drop git_reference_remote_tracking_from_branch() 2012-07-24 16:09:49 +02:00
nulltoken
fb910281d6 branch: introduce git_branch_tracking() 2012-07-24 16:09:48 +02:00
nulltoken
bf9e8cc86b branch: make git_branch_move() reference based 2012-07-24 16:09:47 +02:00
nulltoken
abee7bd36a branch: slight git_branch_create() doc improvement 2012-07-24 16:09:46 +02:00
nulltoken
88bcd5153f branch: introduce git_reference_is_branch() 2012-07-24 16:09:45 +02:00
nulltoken
eed378b669 branch: introduce git_branch_lookup() 2012-07-24 16:09:44 +02:00
nulltoken
b308c11e4e branch: change git_branch_create() to make it return a reference 2012-07-24 16:09:43 +02:00
yorah
a1773f9d89 Add flag to turn off pathspec testing for diff and status 2012-07-24 14:03:09 +02:00
Carlos Martín Nieto
b3aaa7a7c8 Add a struct for network callbacks
Currently only update_tips is used, but it prepares the way for
progress output during download.
2012-07-21 18:44:01 +02:00
Vicent Martí
5b78696334 Merge pull request #818 from nulltoken/rework
Revparse rework
2012-07-21 07:56:59 -07:00
Carlos Martín Nieto
6782245e51 repo: add git_repository_wrap_odb() to wrap an ODB
Primarily useful when used together with git_odb_backend_one_pack().
2012-07-21 16:24:13 +02:00
Carlos Martín Nieto
507523c32f odb: allow creating an ODB backend from a packfile index
git_odb_backend_one_packfile() allows us to create an ODB backend out
of an .idx file.
2012-07-21 16:23:49 +02:00
nulltoken
db9be9457d object: introduce git_object_peel()
Partially fix #530
2012-07-17 20:32:40 +02:00
Ben Straub
bfc6563405 Merge branch 'development' into clone 2012-07-17 08:08:34 -07:00
Vicent Marti
227f313119 attr: Rename the git_attr__ exports
Pevents collisions with the original libgit, which also exports those
exact symbols.

Fixes #822
2012-07-15 14:32:51 +02:00
Ben Straub
deac801de9 Fix documentation comment to match actual params. 2012-07-13 15:50:23 -07:00
Carlos Martín Nieto
1ebe432e2f commit: properly export git_commit_nth_gen_ancestor() 2012-07-12 20:33:30 +02:00
Vicent Martí
dd4345b424 Merge pull request #789 from carlosmn/odb-foreach
odb: add git_odb_foreach()
2012-07-12 09:42:54 -07:00
Vicent Martí
0cf6b2f29e Merge pull request #805 from nulltoken/fix/revwalk-email-parsing
Fix revwalk email parsing
2012-07-12 09:37:09 -07:00
Vicent Martí
db2d4061f6 Merge pull request #814 from nulltoken/topic/revparse-refac
Revparse refactoring: a start
2012-07-12 09:35:35 -07:00
Vicent Martí
48bcf81dd2 Merge pull request #812 from arrbee/assorted-tweaks
Assorted goodies
2012-07-12 09:32:44 -07:00
nulltoken
84f18e3587 refs: introduce git_reference_remote_tracking_from_branch() 2012-07-12 01:06:13 +02:00
nulltoken
b1aca6eae0 commit: introduce git_commit_nth_gen_ancestor() 2012-07-12 01:06:11 +02:00
nulltoken
8aedf1d558 signature: prevent angle bracket usage in identity 2012-07-11 20:40:13 +02:00
Vicent Martí
a13a30ac30 Merge pull request #801 from nulltoken/fix/ref-renaming
refs and revparse love <3
2012-07-11 05:29:51 -07:00
Russell Belfer
991a56c704 Add flag to write gitlink on setting repo workdir
This added a flag to the `git_repository_set_workdir()` function
that enables generation of a `.git` gitlink file that links the
new workdir to the parent repository.  Essentially, the flag tells
the function to write out the changes to disk to permanently set
the workdir of the repository to the new path.

If you pass this flag as true, then setting the workdir to something
other than the default workdir (i.e. the parent of the .git repo
directory), will create a plain file named ".git" with the standard
gitlink contents "gitdir: <repo-path>", and also update the
"core.worktree" and "core.bare" config values.

Setting the workdir to the default repo workdir will clear the
core.worktree flag (but still permanently set core.bare to false).

BTW, the libgit2 API does not currently provide a function for
clearing the workdir and converting a non-bare repo into a bare one.
2012-07-10 23:19:47 -07:00
Russell Belfer
b3ff1dab31 Adding git_config_foreach_match() iteration fn
Adding a new config iteration function that let's you iterate
over just the config entries that match a particular regular
expression.  The old foreach becomes a simple use of this with
an empty pattern.

This also fixes an apparent bug in the existing `git_config_foreach`
where returning a non-zero value from the iteration callback was
not correctly aborting the iteration and the returned value was
not being propogated back to the caller of foreach.

Added to tests to cover all these changes.
2012-07-10 23:19:47 -07:00
Russell Belfer
4d3a7b7846 Merge pull request #793 from libgit2/tree-entry-by-path
Bring back `entry_bypath`
2012-07-10 21:45:16 -07:00
Russell Belfer
19017a24e3 Merge pull request #797 from yorah/fix/inter-hunk-context
diff: make inter-hunk-context default value git-compliant
2012-07-10 16:24:17 -07:00
nulltoken
33c3370700 refs: deploy git_reference_has_log() 2012-07-07 12:15:29 +02:00
nulltoken
75261421ec refs: add git_reference_has_log() 2012-07-07 12:15:28 +02:00
Kevin Sawicki
4ea7c8c666 Replace incorrect 'it' with 'if' in documentation 2012-07-03 12:35:33 -07:00
Carlos Martín Nieto
521aedad30 odb: add git_odb_foreach()
Go through each backend and list every objects that exists in
them. This allows fsck-like uses.
2012-07-03 12:50:51 +02:00
yorah
29f9186d1b diff: make inter-hunk-context default value git-compliant
Default in git core is 0, not 3
2012-07-02 17:27:49 +02:00
Vicent Marti
46ea40d995 tree: Rename entry_copy to entry_dup 2012-06-29 17:08:36 +02:00
Vicent Marti
0e2fcca850 tree: Bring back entry_bypath
Smaller, simpler, faster.
2012-06-29 02:21:12 +02:00
Carlos Martín Nieto
371599576a indexer: don't use '/objects/pack/' unconditionally
Not everyone who indexes a packfile wants to put it in the standard
git repository location.
2012-06-28 10:24:03 +02:00
Vicent Martí
c6713398ba Merge pull request #785 from nulltoken/topic/refs-fromglob
Topic/refs fromglob
2012-06-25 23:27:35 -07:00
nulltoken
527ed55448 references: introduce git_reference_foreach_glob() 2012-06-22 21:40:24 +02:00
Vicent Marti
798e4d53dc amigaos: Cleanup 2012-06-22 21:25:17 +02:00
Vicent Marti
2ae052d1b1 Merge branch 'pull-req' of https://github.com/chris-y/libgit2 into amigaos 2012-06-22 20:48:50 +02:00
Ben Straub
14741d62d9 Clone: new home for git_checkout_force. 2012-06-21 11:13:19 -07:00
Ben Straub
bb1f6087e4 Add progress reporting to clone. 2012-06-21 09:53:44 -07:00
Ben Straub
764df57e82 Add git_clone and git_clone_bare.
So far they only create a repo, setup the "origin"
remote, and fetch. The API probably needs work as
well; there's no way to get progress information
at this point.

Also uncovered a shortcoming; git_remote_download
doesn't fetch over local transport.
2012-06-21 09:53:44 -07:00
nulltoken
d4827081ea branch: drop git_branch_list() 2012-06-21 18:51:32 +02:00
nulltoken
a8fd805e2f branch: add git_branch_foreach() 2012-06-21 18:51:27 +02:00
Vicent Martí
c3ce8d0c9a Merge pull request #775 from arrbee/fix-index-filemodes
Make index add/append support core.filemode flag
2012-06-19 15:17:35 -07:00
Russell Belfer
77d65af439 Nicer constant 2012-06-19 15:16:38 -07:00
Russell Belfer
da825c92d9 Make index add/append support core.filemode flag
This fixes git_index_add and git_index_append to behave more like
core git, preserving old filemode data in the index when adding
and/or appending with core.filemode = false.

This also has placeholder support for core.symlinks and
core.ignorecase, but those flags are not implemented (well,
symlinks has partial support for preserving mode information in
the same way that git does, but it isn't tested).
2012-06-19 14:27:02 -07:00
nulltoken
743a4b3bdd message: Expose git_message_prettify()
git_commit() and git_tag() no longer prettify the
message by default. This has to be taken care of
by the caller.

This has the nice side effect of putting the
caller in position to actually choose to strip
the comments or not.
2012-06-19 10:02:22 +02:00
Vicent Martí
31eed56b9e Merge pull request #753 from nulltoken/topic/merge-base-many
Expose git_merge_base_many()
2012-06-18 17:36:14 -07:00
Chris Young
a8df98c6fb Updates from comments on OS4 compatibility pull request http://github.com/libgit2/libgit2/pull/766 2012-06-14 18:57:24 +01:00
Chris Young
a21bb1aa33 Merge remote-tracking branch 'source/development' into development 2012-06-13 23:28:51 +01:00
Carlos Martín Nieto
14ebe51832 Expose git_refspec_parse()
This function has been available for some time, but never in a
header. Expose it so we can use it from outside the library.
2012-06-12 15:24:33 +02:00
Chris Young
327fb51cec Fix gethostbyname compatibility 2012-06-09 18:13:07 +01:00
Russell Belfer
145e696b49 Minor fixes, cleanups, and clarifications
There are three actual changes in this commit:

1. When the trailing newline of a file is removed in a diff, the
   change will now be reported with `GIT_DIFF_LINE_DEL_EOFNL` passed
   to the callback.  Previously, the `ADD_EOFNL` constant was given
   which was just an error in my understanding of when the various
   circumstances arose.  `GIT_DIFF_LINE_ADD_EOFNL` is deprecated and
   should never be generated.  A new newline is simply an `ADD`.
2. Rewrote the `diff_delta__merge_like_cgit` function that contains
   the core logic of the `git_diff_merge` implementation.  The new
   version doesn't actually have significantly different behavior,
   but the logic should be much more obvious, I think.
3. Fixed a bug in `git_diff_merge` where it freed a string pool
   while some of the string data was still in use.  This led to
   `git_diff_print_patch` accessing memory that had been freed.

The rest of this commit contains improved documentation in `diff.h`
to make the behavior and the equivalencies with core git clearer,
and a bunch of new tests to cover the various cases, oh and a minor
simplification of `examples/diff.c`.
2012-06-08 12:11:13 -07:00
Russell Belfer
0abd724454 Fix filemode comparison in diffs
File modes were both not being ignored properly on platforms
where they should be ignored, nor be diffed consistently on
platforms where they are supported.

This change adds a number of diff and status filemode change
tests.  This also makes sure that filemode-only changes are
included in the diff output when they occur and that filemode
changes are ignored successfully when core.filemode is false.

There is no code that automatically toggles core.filemode
based on the capabilities of the current platform, so the user
still needs to be careful in their .git/config file.
2012-06-08 12:09:10 -07:00
Chris Young
fa56478fb8 Generic needs compat files 2012-06-08 19:15:11 +01:00
Chris Young
aa5a92d121 OS4 compatibility 2012-06-08 18:57:35 +01:00
Chris Young
519757279e Fix double-defines when using GIT_OLD_ERRORS 2012-06-07 23:13:39 +01:00
Chris Young
0f5e1f3b68 Network byte order is big-endian - the way it should be :) 2012-06-07 21:56:19 +01:00
Vicent Martí
3f0358604e misc: Fix warnings from PVS Studio trial 2012-06-07 22:43:48 +02:00
Vicent Martí
6c08e69fd9 Merge pull request #669 from nulltoken/topic/reset
Add git_reset()
2012-06-07 12:30:20 -07:00
Vicent Martí
b9ebcc59e7 Merge pull request #684 from benstraub/rev-parse
Rev parse
2012-06-07 12:29:31 -07:00
Chris Young
c3f35902f3 Merge remote-tracking branch 'source/development' into update-test
Merging main libgit2!
Conflicts:
	CMakeLists.txt
	src/unix/map.c
2012-06-07 20:29:22 +01:00
nulltoken
edebceffef Add git_reset()
Currently supports Soft and Mixed modes.
2012-06-07 21:27:30 +02:00
Vicent Martí
cddb8efe56 Merge pull request #704 from nulltoken/topic/blob_fromchunks
Add the ability to create blob given a provider of chunks of bytes
2012-06-07 11:34:48 -07:00
nulltoken
cd44576790 blob: add git_blob_create_fromchunks() 2012-06-07 20:33:22 +02:00
nulltoken
b46bdb2204 merge: Expose git_merge_base_many() 2012-06-07 16:25:37 +02:00
Vicent Martí
966fbdcb8e Merge pull request #697 from carlosmn/ssl
Add HTTPS support
2012-06-05 13:53:33 -07:00
Ben Straub
56a5000d58 Merge branch 'development' into rev-parse
Conflicts:
	src/util.h
	tests-clar/refs/branches/listall.c
2012-06-05 12:52:44 -07:00
Chris Young
d0517805d8 Required include for OS4 to typedef int64_t 2012-06-05 11:47:17 +01:00
nulltoken
d05e2c64dd refspec: expose the force update specifier through git_refspec_force() accessor 2012-05-30 01:05:17 +02:00
Carlos Martín Nieto
250b95b24b ssl: allow skipping the server certificate check
Sometimes it's useful not to perform the check. Allow it to be
configurable.
2012-05-26 21:17:08 +02:00
Carlos Martín Nieto
dbb36e1b42 ssl: check certificates against the system's trusted CAs 2012-05-19 17:51:53 +02:00
Bruce Mitchener
d73c94b21c Fix spelling errors. 2012-05-19 20:26:52 +07:00
Vicent Marti
ad5df35a47 libgit2 v0.17.0 "Lord of Diffstruction"
Welcome to yet another libgit2 release, this one being the
biggest we've shipped so far. Highlights on this release
include diff, branches, notes and submodules support. The new
diff API is shiny and powerful. Check it out.

Apologies, one more time, to all the early adopters for the
breaking API changes. We've been iterating on the error
handling for the library until we reached its current state,
which we believe it's significantly more usable both for normal
users and for developers of bindings to other languages.
Also, we've renamed a few legacy calls to ensure that the whole
external API uses a consistent naming scheme.

As always, check the API docs for the full list of new API calls
and backwards-incompatible changes.

	http://libgit2.github.com/libgit2/

Changelog of new features follows:

Attributes:
	- Added function macros to check attribute values instead of having
	to manually compare them
	- Added support for choosing the attribute loading order (workdir files
	vs index) and to skip the systems' default `.gitattributes`
	- Fixed issues when fetching attribute data on bare repositories

Blob:
	- Added support for creating blobs from any file on disk (not
	restricted to the repository's working directory)
	- Aded support for smudge filters when writing blobs to the ODB
		- So far only CRLF normalization is available

Branches:
	- Added a high-level branch API:
		- git_branch_create
		- git_branch_delete
		- git_branch_list
		- git_branch_move

Commit:
	- Commit messages are now filtered to match Git rules (stripping
	comments and adding proper whitespacing rules)

Config:
	- Added support for setting and getting multivars
	- Added `git_config_get_mapped` to map the value of a config
	variable based on its defaults

Diff:
	- Added full diff API:
		- tree to tree
		- index to tree
		- workdir to index
		- workdir to tree
		- blob to blob

	- Added helper functions to print the diffs as valid patchfiles

Error handling:
	- New design for the error handling API, taking into consideration
	the requirements of dynamic languages

Indexer:
	- Added streaming packfile indexer

Merge:
	- Added support for finding the merge base between two commits

Notes:
	- Full git-notes support:
		- git_note_read
		- git_note_message/git_note_oid
		- git_note_create
		- git_note_remove
		- git_note_free
		- git_note_foreach

References:
	- Added `git_reference_name_to_oid` helper to resolve
	a reference to its final OID

	- Added `git_reference_cmp` to compare two references with
	a stable order

Remotes:
	- Added support for writing and saving remotes
		- `git_remote_add`
		- `git_remote_save`
		- Setters for all the attributes of a remote
	- Switched remote download to the new streaming packfile indexer
	- Fixed fetch on HTTP and Git under Windows
	- Added `git_remote_supported_url` helper to check if a protocol
	can be accessed by the library
	- Added `git_remote_list`

Repository:
	- Made `git_repository_open` smarter when finding the `.git` folder.
	- Added `git_repository_open_ext` with extra options when
	opening a repository

Revwalk:
	- Added support for pushing/hiding several references through a glob
	- Added helper to push/hide the current HEAD to the walker
	- Added helper to push/hide a single reference to the walker

Status:
	- Greatly improved Status implementation using the new `diff` code
	as a backend

Submodules:
	- Added a partial submodules API to get information about a
	submodule and list all the submodules in a repository
		- git_submodule_foreach
		- git_submodule_lookup

Tag:
	- Added `git_tag_peel` helper to peel a tag to its pointed object
	- Tag messages are now filtered to match Git rules (stripping comments
	and adding proper whitespacing rules)

Tree:
	- Killed the old `git_tree_diff` API, which is replaced by the
	new diff code.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2012-05-19 01:40:46 +02:00
Vicent Martí
904b67e69f errors: Rename error codes 2012-05-18 01:48:50 +02:00
Vicent Martí
e172cf082e errors: Rename the generic return codes 2012-05-18 01:26:26 +02:00
Vicent Martí
2e2e97858d Properly tag all enums with a _t 2012-05-18 01:26:23 +02:00
Vicent Martí
4fbd1c007e refs: git_reference_listall -> git_reference_list 2012-05-18 01:26:16 +02:00
Vicent Martí
fe3bcf7d7a errors: Remove old comments 2012-05-18 01:25:57 +02:00
Vicent Martí
29e948debe global: Change parameter ordering in API
Consistency is good.
2012-05-18 01:25:57 +02:00
nulltoken
ee7680d53b notes: make git_note_foreach() callback signature easier to cope with from a binding perspective 2012-05-16 21:51:45 +02:00
Vicent Martí
9d0011fd83 tree: Naming conventions 2012-05-16 19:24:35 +02:00
Vicent Martí
cedf9ca955 tree: Kill the git_tree_diff functions
These are deprecated and replaced with the diffing code in git2/diff.h
2012-05-16 19:24:35 +02:00
Vicent Martí
c261c272af Merge pull request #702 from arrbee/fix-status-file
Update git_status_file and add ranged iterators
2012-05-16 09:57:45 -07:00
Russell Belfer
41a82592ef Ranged iterators and rewritten git_status_file
The goal of this work is to rewrite git_status_file to use the
same underlying code as git_status_foreach.

This is done in 3 phases:

1. Extend iterators to allow ranged iteration with start and
   end prefixes for the range of file names to be covered.
2. Improve diff so that when there is a pathspec and there is
   a common non-wildcard prefix of the pathspec, it will use
   ranged iterators to minimize excess iteration.
3. Rewrite git_status_file to call git_status_foreach_ext
   with a pathspec that covers just the one file being checked.

Since ranged iterators underlie the status & diff implementation,
this is actually fairly efficient.  The workdir iterator does
end up loading the contents of all the directories down to the
single file, which should ideally be avoided, but it is pretty
good.
2012-05-15 14:34:15 -07:00
Carlos Martín Nieto
73d87a091c Introduce GITERR_INDEXER 2012-05-15 21:42:20 +02:00
Vicent Martí
87d6138e2e Merge pull request #696 from nulltoken/topic/notes-list
Add git_note_foreach()
2012-05-14 13:17:19 -07:00
Vicent Martí
79fdde494f Revert "Specifiy dllimport to MSVC if we're not building libgit2.dll"
This reverts commit 1093e2de22.
2012-05-14 22:15:53 +02:00
nulltoken
86ecd84427 notes: add git_notes_foreach() 2012-05-14 22:07:42 +02:00
Sascha Cunz
1093e2de22 Specifiy dllimport to MSVC if we're not building libgit2.dll
Building a "shared object" (DLL) in Windows includes 2 steps:

- specify __declspec(dllexport)
  when building the library itself. MSVC will disallow itself from
  optimizing these symbols out and reference them in the PE's
  Exports-Table.
  Further, a static link library will be generated. This library
  contains the symbols which are exported via the declsepc above.
  The __declspec(dllexport) becomes part of the symbol-signature
  (like parameter types in C++ are 'mangled' into the symbol name,
  the export specifier is mingled with the name)

- specify __declspec(dllimport)
  when using the library. This again mingles the declspec into the
  name and declares the function / variable with external linkage.

cmake automatically adds -Dgit2_EXPORTS to the compiler arguments
when compiling the libgit2 project.
The 'git2' is the name specified via PROJECT() in CMakeLists.txt.
2012-05-14 20:22:50 +02:00
Vicent Martí
e49cb1687e Merge pull request #671 from nulltoken/topic/blob_create_fromdisk
Add git_blob_create_fromdisk()
2012-05-14 11:03:30 -07:00
Vicent Martí
72bfde9790 Merge pull request #681 from scottjg/solaris-fixes
Fix build/runtime issues on Solaris
2012-05-14 11:01:14 -07:00
Vicent Martí
27f5b7cfed Merge pull request #682 from arrbee/attribute-cache-buster
Attribute cache buster
2012-05-14 10:58:23 -07:00
Sascha Cunz
0c9a5565f7 Add missing GIT_EXTERN declarations 2012-05-14 19:56:35 +02:00
nulltoken
6ca9643c96 blob: Add git_blob_create_fromdisk()
This function will create blobs in the object database from files anywhere on the filesystem. This can be run against bare and non-bare repositories.
2012-05-13 11:28:49 +02:00
Ben Straub
bfc13e7985 Adding comment documentation for rev-parse api. 2012-05-11 11:30:46 -07:00
Ben Straub
ac250c56c7 First stab at implementation of rev-parse.
This version supports refspecs of these kinds:
- Full & partial SHAs
- Output from "git describe"
- "/refs/heads/master" (full ref names)
- "master" (partial ref names)
- "FETCH_HEAD" (named heads)
2012-05-11 11:30:45 -07:00
Scott J. Goldman
b1ec25facc Fix comment typo in common.h 2012-05-10 17:16:38 -07:00
Russell Belfer
dc13f1f7d7 Add cache busting to attribute cache
This makes the git attributes and git ignores cache check
stat information before using the file contents from the
cache.  For cached files from the index, it checks the SHA
of the file instead.  This should reduce the need to ever
call `git_attr_cache_flush()` in most situations.

This commit also fixes the `git_status_should_ignore` API
to use the libgit2 standard parameter ordering.
2012-05-10 11:12:43 -07:00
Vicent Martí
c99bdacf71 Merge pull request #670 from nulltoken/ntk/topic/clean-commit_message
Clean commit and tag messages
2012-05-08 14:13:43 -07:00
Russell Belfer
364f51bdca Merge pull request #668 from nulltoken/topic/binary-blobs
Enhancing the blob diffing experience
2012-05-08 13:56:21 -07:00
Carlos Martín Nieto
baaa8a447e remotes: change git_remote_new's signature
Add a fetch refspec arguemnt and make the arguments (name, url,
refspec), as that order makes more sense.
2012-05-08 21:36:40 +02:00