Commit Graph

4865 Commits

Author SHA1 Message Date
Russell Belfer
0c72248b91 Introduce git_oid_compare, an exported oid cmp 2013-04-29 07:34:13 -07:00
Carlos Martín Nieto
0f85c20840 Merge pull request #1512 from carlosmn/push-delete-only
Fix push for delete-only and add travis rules to test it
2013-04-29 04:13:42 -07:00
Carlos Martín Nieto
fb42a22e2f travis: test push
Create a test repository in the VM and set up git-daemon so we can
use it to test the push code.
2013-04-29 02:15:51 +02:00
Carlos Martín Nieto
51e4da6d8a push: don't send a packfile when only issuing delete commands
For update and create commands where all the objects are known to
exist in the remote, we must send an empty packfile. However, if all
we issue are delete commands, no packfile must be sent.

Take this into consideration for push.
2013-04-29 01:49:40 +02:00
Carlos Martín Nieto
d84884571d remote: dwim the refspecs according to the remote's advertised refs
As git allows you to store shorthand refspecs in the configuration, we
need to do this ourselves.
2013-04-28 18:49:51 +02:00
Carlos Martín Nieto
528a4e24c6 Parse shorthand refspecs as valid
Relax the ONELEVEL ref naming rules so the refspec parsing code can
ask for 'master' to be considered valid.
2013-04-28 14:21:10 +02:00
Vicent Martí
78bf2944ed Merge pull request #1504 from ethomson/git_atomic_ssize
git_atomic_ssize for 64-bit atomics only on 64-bit platforms
2013-04-25 17:42:44 -07:00
Edward Thomson
eb63fda2e2 git_atomic_ssize for 64-bit atomics only on 64-bit platforms 2013-04-25 12:40:33 -05:00
Carlos Martín Nieto
b4117e19b7 docs: formatting fixes 2013-04-24 20:25:57 +02:00
Vicent Marti
879458e7cf repo: Add git_repository__cleanup 2013-04-24 15:52:58 +02:00
Vicent Martí
2370b4d79e Merge pull request #1499 from arrbee/fix-diff-config-usage
Support more diff config options and use the config cache more
2013-04-23 13:06:26 -07:00
Russell Belfer
687db88faf Make sure diff output is cleared on error 2013-04-23 12:57:30 -07:00
Russell Belfer
b1ff7004ab Improve diff config options handling
This makes diff use the cvar cache for config options where
possible, and also adds support for a number of other config
options to diff including "diff.context", "diff.ignoreSubmodules",
"diff.noprefix", "diff.mnemonicprefix", and "core.abbrev".

To make this natural, this involved a rearrangement of the code
that allocates the diff object vs. the code that initializes it
based on the combination of options passed in by the user and
read from the config.

This commit includes tests for most of these new options as well.
2013-04-23 12:57:30 -07:00
Russell Belfer
6be368bf16 Clear repo config cache when cfgs are set
This is a conservative change, but it seemed like the only safe
thing to do -- i.e. clear the cvar cache when a config gets set.
2013-04-23 12:57:30 -07:00
Russell Belfer
eac76c230c Use config cache where possible
This converts many of the config lookups that are done around the
library to use the repository config cache.  This was everything I
could find that wasn't part of diff (which requires a larger fix).
2013-04-23 12:57:30 -07:00
Russell Belfer
ab01cbd4dd Add configs to repo config cache
This adds a bunch of additional config values to the repository
config value cache and makes it easier to add a simple boolean
config without creating enum values for each possible setting.

Also, this fixes a bug in git_config_refresh where the config
cache was not being cleared which could lead to potential
incorrect values.

The work to start using the new cached configs will come in the
next couple of commits...
2013-04-23 12:57:30 -07:00
Russell Belfer
608d04667a Make tree to tree diffs case sensitive
When case insensitive tree iterators were added, we started reading
the case sensitivity of the index to decide if the tree should be
case sensitive.  This is good for index-to-tree comparisons, but
for tree-to-tree comparisons, we should really default to doing a
case sensitive comparison unless the user really wants otherwise.
2013-04-23 12:57:30 -07:00
Linquize
a5df71c11f Support diff.context config 2013-04-23 12:57:30 -07:00
Ben Straub
bd0a07f4bb Clone: replace fetch spec with custom value 2013-04-23 12:28:59 -07:00
Vicent Martí
495d6f07c4 Merge pull request #1502 from nvloff/remote_refspecs_minor_fixes
Remote refspecs minor fixes
2013-04-23 12:15:35 -07:00
Nikolai Vladimirov
dfdf709e3f get last refspec in clone test 2013-04-23 22:04:37 +03:00
Vicent Martí
7915e6cc66 Merge pull request #1498 from libgit2/vmg/atomic64
64 bit atomic operations and shared cache memory usage
2013-04-23 11:48:12 -07:00
Vicent Marti
a2378ae4fe opts: Add getter for cached memory 2013-04-23 20:42:29 +02:00
Vicent Martí
6c9dc12b6a Merge pull request #1501 from xavier-l/packbuilder-commit
Added function to insert commit into pack
2013-04-23 11:37:40 -07:00
Nikolai Vladimirov
a952b9867d remove git_remote_pushspec 2013-04-23 21:28:28 +03:00
Carlos Martín Nieto
9a9de29d36 Document the odb backend constructors 2013-04-23 19:09:45 +02:00
Xavier L
0b90366c3b Fixes indentation 2013-04-23 12:27:38 -04:00
Xavier L
f0e37a8b86 Added function to insert commit into pack 2013-04-23 12:22:29 -04:00
Carlos Martín Nieto
6c1b6b7abc examples: init the threading system 2013-04-23 16:21:47 +02:00
Vicent Marti
a5de904427 refs: Better error name 2013-04-23 02:24:44 +02:00
Vicent Marti
d6c8688dac Merge branch 'development' of https://github.com/libgit2/libgit2 into development 2013-04-23 02:22:15 +02:00
Vicent Marti
08a1b4765f Merge branch 'master' of https://github.com/libgit2/libgit2 into development 2013-04-23 02:21:42 +02:00
Russell Belfer
fe7199329b Merge pull request #1497 from carlosmn/atomic-refcount
Make refcounting atomic
2013-04-22 10:39:24 -07:00
Vicent Marti
920cbc9846 cache: More aggressive default 2013-04-22 17:31:47 +02:00
Vicent Marti
a14163a79d cache: Shared meter for memory usage 2013-04-22 17:30:49 +02:00
Vicent Marti
f9774eea3a atomic: Add an atomic type for 64-bit operations 2013-04-22 17:30:28 +02:00
Carlos Martín Nieto
05b179648a Make refcounting atomic 2013-04-22 17:12:11 +02:00
Vicent Martí
d08dd728a8 Merge pull request #1454 from libgit2/vmg/new-cache
New caching
2013-04-22 08:07:20 -07:00
Vicent Marti
d877159260 cache: Max cache size, and evict when the cache fills up 2013-04-22 17:04:52 +02:00
Vicent Marti
cf9709b64e tests: Do not warn for unused variable 2013-04-22 16:53:46 +02:00
Vicent Marti
865e2dd444 tests: Cleanup commit parse testing code 2013-04-22 16:52:07 +02:00
Russell Belfer
5d2d21e536 Consolidate packfile allocation further
Rename git_packfile_check to git_packfile_alloc since it is now
being used more in that capacity.  Fix the various places that use
it.  Consolidate some repeated code in odb_pack.c related to the
allocation of a new pack_backend.
2013-04-22 16:52:07 +02:00
Russell Belfer
38eef6113d Make indexer use shared packfile open code
The indexer was creating a packfile object separately from the
code in pack.c which was a problem since I put a call to
git_mutex_init into just pack.c.  This commit updates the pack
function for creating a new pack object (i.e. git_packfile_check())
so that it can be used in both places and then makes indexer.c
use the shared initialization routine.

There are also a few minor formatting and warning message fixes.
2013-04-22 16:52:07 +02:00
Russell Belfer
c628918625 Fixes for Windows cas/threading stuff 2013-04-22 16:52:07 +02:00
Russell Belfer
e976b56dda Add git__compare_and_swap and use it
This removes the lock from the repository object and changes the
internals to use the new atomic git__compare_and_swap to update
the _odb, _config, _index, and _refdb variables in a threadsafe
manner.
2013-04-22 16:52:07 +02:00
Russell Belfer
5360786885 Further threading fixes
This builds on the earlier thread safety work to make it so that
setting the odb, index, refdb, or config for a repository is done
in a threadsafe manner with minimized locking time.  This is done
by adding a lock to the repository object and using it to guard
the assignment of the above listed pointers.  The lock is only
held to assign the pointer value.

This also contains some minor fixes to the other work with pack
files to reduce the time that locks are being held to and fix an
apparently memory leak.
2013-04-22 16:52:07 +02:00
Russell Belfer
116bbdf044 clean up tree pointer casting 2013-04-22 16:52:06 +02:00
Russell Belfer
3f27127d15 Simplify object table parse functions
This unifies the object parse functions into one signature that
takes an odb_object.
2013-04-22 16:52:06 +02:00
Russell Belfer
786062639f Add callback to git_objects_table
This adds create and free callback to the git_objects_table so
that more of the creation and destruction of objects can be table
driven instead of using switch statements.  This also makes the
semantics of certain object creation functions consistent so that
we can make better use of function pointers.  This also fixes a
theoretical error case where an object allocation fails and we
end up storing NULL into the cache.
2013-04-22 16:51:40 +02:00
Russell Belfer
917f60c50b Add tests for oidmap and new cache with threading
This adds some basic tests for the oidmap just to make sure that
collisions, etc. are dealt with correctly.

This also adds some tests for the new caching that check if items
are inserted (or not inserted) properly into the cache, and that
the cache can hold up in a multithreaded environment without error.
2013-04-22 16:50:51 +02:00