|
d7354d70
|
2011-03-30T16:22:31
|
|
build_varname: lowercase the variable name
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
0bbaf9aa
|
2011-03-30T16:11:55
|
|
config_parse: no need to check if current_section is non-null
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
df22949a
|
2011-03-31T12:51:17
|
|
config_set: really replace the value on overwrite
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
923fe455
|
2011-03-30T16:02:57
|
|
Add strtolower and strntolower functions
As parts of variable names are case-sensitive, we need these functions.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
8ecc5ae5
|
2011-03-30T16:48:14
|
|
git_config_set_int: use the right buffer
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
e21881d1
|
2011-03-30T15:16:25
|
|
git_config: reorder fields according to use
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
dadc0158
|
2011-03-30T15:05:15
|
|
config: use a singly-linked list instead of a hash table
Such a list preserves the order the variables were first read in which
will be useful later for merging different data-sets. Furthermore,
reading and writing out the same configuration should not reorganize
the variables, which could happen when iterating through all the items
in a hash table.
A hash table is overkill for this small a data-set anyway.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
d28830c2
|
2011-03-30T13:40:19
|
|
Store the parsed variables
Store the key-value pair as strings.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
934fcf78
|
2011-03-30T11:32:08
|
|
Initialise the config reader in config_parse
git_config_open shouldn't have to initialise variables that are only
used inside config_parse and its callees.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
2974aa94
|
2011-03-30T11:30:40
|
|
Determine variable type at runtime
Config variables should be interpreted at run-time, as we don't know if a
zero means false or zero, or if yes means true or "yes".
As a variable has no intrinsic type, git_cvtype is gone and the public
API takes care of enforcing a few rules.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
2e445cac
|
2011-03-30T11:07:09
|
|
build_varname: allocate memory
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
9a3c5e55
|
2011-03-29T17:44:10
|
|
Expose config API for setters, getters and foreach
These functions can be used to query or modify the variables in a
given configuration. No sanity checking is done on the variable names.
This is mostly meant as an API preview.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
26faa366
|
2011-03-29T17:59:13
|
|
Add build_varname to make a full var name
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
e15afc8e
|
2011-03-29T17:37:03
|
|
cvar_free: also free the config var's name
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
6d7bb4e0
|
2011-03-29T17:35:02
|
|
Move git_cvar_type to include/git2/config.h
Include it in src/config.h and fix the header name #define.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
3d23b74a
|
2011-03-29T13:50:37
|
|
Free the config var hash contents in git_config_free
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
238df559
|
2011-03-29T12:29:21
|
|
Rename git_config_{type,var} to git_cvar{_type,}
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
05314b5b
|
2011-03-29T12:25:46
|
|
Make GIT_EINVALIDTYPE available for use in config
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
9f7f4122
|
2011-03-29T12:19:53
|
|
Don't leak if config parsing fails
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
4e02504f
|
2011-03-29T12:10:30
|
|
Move config to support the new hash code
The hashes have been copied from the references code
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
3b4835c2
|
2011-03-28T18:07:22
|
|
Correctly parse the section header
If cfg_readline consumes the line, then parse_section_header will read
past it and if we read a character, parse_variable won't have the full
name.
This solution is a bit hackish, but it's the simplest way to get the
code to parse correctly.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
908afb77
|
2011-03-28T17:53:04
|
|
parse_section_header: save the name where it belongs
Save the location of the name in section_out instead of returning it
as an int. Use the return code to signal success or failure.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
e4c796f1
|
2011-03-28T17:51:18
|
|
Read and parse the confguration when openingt the config file
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
a69053c7
|
2011-03-28T17:12:53
|
|
Convert config.c to LF
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
5d4cd003
|
2011-03-28T17:02:45
|
|
Move the struct declaration outside config.c
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
a3002d56
|
2011-01-29T01:58:55
|
|
First version - WIP
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
86627121
|
2011-03-06T00:03:31
|
|
Fix type-conversion warning in MSVC
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
d6b5f5cc
|
2011-03-05T23:54:49
|
|
Add `git_oid_shorten`
Set of methods to find the minimal-length to uniquely identify every OID
in a list.
Includes stress test.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
55ffebe3
|
2011-03-05T14:34:32
|
|
Fix creation of deeply-rooted references
Use a new `gitfo_creat_force` that will create the full path to a file
before creating it.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
246eba80
|
2011-03-05T13:58:47
|
|
Use memmove() in git__dirname and git__basename
We cannot make sure that the user doesn't use the same buffer as source
and destination, so write to it using memmove.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
60cb1d10
|
2011-03-05T13:56:14
|
|
Use memmove() in git__joinpath for overlapping copies
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
545a6915
|
2011-03-05T13:45:05
|
|
Change interface for Tree Index attr (always unsigned)
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
9de27ad0
|
2011-02-25T19:05:29
|
|
Check for valid range of attributes for tree entry
|
|
3490188b
|
2011-03-05T13:29:50
|
|
Change the return type of `git_blob_rawcontent`
Should return `void *` for raw bytes.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
e0011be3
|
2011-03-05T13:22:16
|
|
Fix the opening of empty repositories
We were checking for the index file, which is not assured to exist on
clean git repositories.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
45314a7e
|
2011-03-04T23:13:02
|
|
clean up temp repo for t12-repo tests
add actual must_pass calls back into the repo tests and remove ./ from
beginning of temp repo path
|
|
f335b42c
|
2011-03-05T01:17:59
|
|
Fix segmentation fault when freeing a repository
Disable garbage collection of cross-references to prevent
double-freeing. Internal reference management is now done
with a separate method.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
e06dd9b6
|
2011-03-04T15:23:52
|
|
Fix 'possibly uninitialized variable' warning
|
|
f7fcb0dd
|
2011-03-04T15:10:16
|
|
Don't use non-int bit fields
They are not standard. MSVC complains about them. And that's not good.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
c3a41e5f
|
2011-03-03T22:01:15
|
|
Fix compilation when using CMake in Windows
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
3c41c635
|
2011-03-03T21:58:37
|
|
Fix compilation in MSVC
MSVC cannot substract void pointers. Go figure.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
b64e11d1
|
2011-03-03T20:23:04
|
|
Bump the version number to 0.8.0
Yes, these are some seriously massive changes to the external API. We
are breaking stuff.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
71d33382
|
2011-03-03T20:20:45
|
|
Move the external includes folder from `src` to `include`
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
584f49a5
|
2011-03-01T01:37:28
|
|
Fix several issues with refcounting
- Added several missing reference increases
- Add new destructor to the repository that does not GC the objects
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
971c90be
|
2011-02-28T16:54:13
|
|
Do not free the index if it's owned by a repository
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
48c27f86
|
2011-02-28T16:51:17
|
|
Implement reference counting for git_objects
All `git_object` instances looked up from the repository are reference
counted. User is expected to use the new `git_object_close` when an
object is no longer needed to force freeing it.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
86d7e1ca
|
2011-02-28T12:46:13
|
|
Fix searching in git_vector
We now store only one sorting callback that does entry comparison. This
is used when sorting the entries using a quicksort, and when looking for
a specific entry with the new search methods.
The following search methods now exist:
git_vector_search(vector, entry)
git_vector_search2(vector, custom_search_callback, key)
git_vector_bsearch(vector, entry)
git_vector_bsearch2(vector, custom_search_callback, key)
The sorting state of the vector is now stored internally.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
5de079b8
|
2011-02-28T12:12:26
|
|
Change the object creation/lookup API
The methods previously known as
git_repository_lookup
git_repository_newobject
git_repository_lookup_ref
are now part of their respective namespaces:
git_object_lookup
git_object_new
git_reference_lookup
This makes the API more consistent with the new references API.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
3dccfed1
|
2011-03-03T18:19:05
|
|
Cleanup the testing toolkit
Tests are now declared with detailed descriptions and a short test name:
BEGIN_TEST(the_test0, "this is an example test that does something")
...
END_TEST
Modules are declared through a simple macro interface:
BEGIN_MODULE(mod_name)
ADD_TEST(the_test0);
...
END_MODULE
Error messages when tests fail have been greatly improved.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
8fc05096
|
2011-03-03T19:59:25
|
|
Add test deleteref::deleting_a_ref_which_is_both_packed_and_loose_should_remove_both_tracks_in_the_filesystem()
|
|
5ad0351d
|
2011-03-03T19:58:07
|
|
Fix reference removal: remove packed refs together with loose ones
|
|
d561403f
|
2011-03-03T19:57:12
|
|
Add test for corner case in reference renaming
|
|
8f90ced5
|
2011-03-03T19:55:48
|
|
Fix corner case in reference renaming
Renaming a packed reference should not pack another reference
which happens to be in both loose and pack state.
|
|
268bee3d
|
2011-03-03T19:54:34
|
|
Add test renameref::rename_a_loose_reference()
|
|
0594e3ef
|
2011-03-03T19:36:54
|
|
Prevent _dirent_loose_load() from choking on empty folders
|
|
e4029c52
|
2011-02-28T12:33:47
|
|
Added copydir_recurs() to test_helpers.c
Test helper function which recursively copies the content of a
directory. This function has been tweaked to prevent stack overflows by
reusing the same path buffers on all recursive calls.
|
|
19a30a3f
|
2011-03-03T19:53:17
|
|
Add new move function, `gitfo_mv_force`
Forces a move by creating the folder for the destination file, if it
doesn't exist.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
6b02b215
|
2011-03-03T19:43:47
|
|
Add test renameref::can_not_rename_a_reference_with_an_invalid_name()
|
|
129007b4
|
2011-03-03T19:43:11
|
|
Fix refs renaming to prevent renaming with an invalid name
|
|
65cc1f44
|
2011-03-03T19:42:11
|
|
Add test renameref::can_not_rename_a_reference_with_an_invalid_name()
|
|
e2d42622
|
2011-03-03T19:41:27
|
|
Fix reference renaming to prevent duplicated names
|
|
de05ff6c
|
2011-03-03T19:40:01
|
|
Add test renameref::renaming_a_packed_reference_makes_it_loose()
|
|
76f7cf70
|
2011-03-03T19:38:54
|
|
Fix reference renaming implementation to match standard git behavior
|
|
669db21b
|
2011-02-28T22:21:18
|
|
Slightly changed the behavior of git__joinpath() and git__joinpath_n().
|
|
52b2c209
|
2011-03-03T19:37:40
|
|
Enhance the packrefs::create_packfile() test
|
|
7167422c
|
2011-02-28T12:16:44
|
|
Refactored some test related constants.
|
|
705a90ec
|
2011-02-26T14:07:13
|
|
Added tests to exercise the initialization and the opening of a repository.
|
|
c38f9013
|
2011-02-26T13:56:57
|
|
Removed a duplicate constant.
|
|
d2d6912e
|
2011-02-26T13:56:16
|
|
Refactored the opening and the initialization of a repository.
|
|
3b3a1017
|
2011-02-25T21:58:25
|
|
Added rmdir_recurs(), a test helper function which recursively removes the content of a directory.
|
|
47d0db78
|
2011-02-25T15:09:31
|
|
Added some dirname and basename tests to ensure that trailing slashes are ignored.
|
|
87d3acf4
|
2011-02-27T22:31:43
|
|
Finish the References API
The following methods have been implemented:
git_reference_packall
git_reference_rename
git_reference_delete
The library now has full support for packed references, including
partial and total writing. Internal documentation has been updated with
the details.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
17cdf252
|
2011-02-27T22:31:06
|
|
Make some Object methods take a const parameter
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
2e60b652
|
2011-02-27T22:30:28
|
|
Add extra methods to the new Hashtable implementation
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
ccef1c9d
|
2011-02-27T22:09:36
|
|
Move the path comparison method to fileops.c
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
da7c3c71
|
2011-02-27T22:07:39
|
|
Fix warnings in vector.c
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
9b3985fa
|
2011-02-25T10:29:11
|
|
Slightly enhanced the readability of some reference related tests.
|
|
b0a83143
|
2011-02-25T10:06:49
|
|
Removed duplicate tests.
|
|
86194b24
|
2011-02-18T21:57:53
|
|
Split packed from unpacked references
These two reference types are now stored separately to eventually allow
the removal/renaming of loose references and rewriting of the refs
packfile.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
32054c24
|
2011-02-18T18:09:19
|
|
Brush up the refs API
Changed some more API details and updated documentation.
Sketched API for addition/removal of entries.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
2de3b35c
|
2011-02-14T22:32:02
|
|
Added test covering creation of nested symbolic references.
|
|
1d8cc731
|
2011-02-14T22:29:22
|
|
Refactored the reference creation API.
|
|
e1be1028
|
2011-02-13T20:18:35
|
|
Added some more tests to ensure the correct behavior of git_reference__normalize_name().
|
|
77600378
|
2011-02-13T14:51:45
|
|
Fixed line endings (CRLF->LF).
|
|
6a0895ad
|
2011-02-11T13:58:40
|
|
Added GIT_EINVALIDREFSTATE error.
|
|
aa2120e9
|
2011-02-10T15:08:00
|
|
Added git_reference__normalize_name() along with tests.
|
|
83403e99
|
2011-03-02T11:02:22
|
|
Fix check for bad --sha1 option argument
|
|
5cfd9ce4
|
2011-03-01T22:15:20
|
|
Add missing include to odb_backends.h
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
fc70832a
|
2011-02-23T07:08:50
|
|
include "oid.h" in headers that use git_oid
This makes generating bindings to hlibgit2 easier
|
|
7360122b
|
2011-02-24T23:53:40
|
|
Fix file renaming in MinGW
We now use MoveFileEx, which is not assured to be atomic but works for
always (both if the destination exists, or if it doesn't) and is
available in MinGW.
Since this is a Win32 API call, complaint about lost or overwritten files
should be forwarded at Steve Ballmer.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
3eb47c9f
|
2011-02-24T21:43:08
|
|
Fix renaming of files in Win32
The `rename` call doesn't quite work on Win32: expects the destination
file to not exist. We're using a native Win32 call in those cases --
that should do the trick.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
c3be1468
|
2011-02-24T19:31:12
|
|
Fix double-freeing file descriptors
Was crashing the Windows build.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
fc658755
|
2011-02-22T21:59:36
|
|
Rewrite git_hashtable internals
The old hash table with chained buckets has been replaced by a new one
using Cuckoo hashing, which offers guaranteed constant lookup times.
This should improve speeds on most use cases, since hash tables in
libgit2 are usually used as caches where the objects are stored once and
queried several times.
The Cuckoo hash implementation is based off the one in the Basekit
library [1] for the IO language, but rewritten to support an arbritrary
number of hashes. We currently use 3 to maximize the usage of the nodes pool.
[1]: https://github.com/stevedekorte/basekit/blob/master/source/CHash.c
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
4378e8d4
|
2011-02-22T15:15:35
|
|
Add unit test for writing a big index file
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
5591ea15
|
2011-02-22T14:58:54
|
|
Add printf method to the File Buffer
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
af774b01
|
2011-02-21T13:14:01
|
|
Add --without-sqlite option to waf configure
Disable sqlite support when ./waf configure is run with --without-sqlite
|
|
817c2820
|
2011-02-21T17:05:16
|
|
Rewrite all file IO for more performance
The new `git_filebuf` structure provides atomic high-performance writes
to disk by using a write cache, and optionally a double-buffered scheme
through a worker thread (not enabled yet).
Writes can be done 3-layered, like in git.git (user code -> write cache
-> disk), or 2-layered, by writing directly on the cache. This makes
index writing considerably faster.
The `git_filebuf` structure contains all the old functionality of
`git_filelock` for atomic file writes and reads. The `git_filelock`
structure has been removed.
Additionally, the `git_filebuf` API allows to automatically hash (SHA1)
all the data as it is written to disk (hashing is done smartly on big
chunks to improve performance).
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
874c3b6f
|
2011-02-18T14:11:53
|
|
Fix repository initialization
Fixed several issues with path joining and bare repos.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
cb77ad0d
|
2011-02-18T12:23:53
|
|
Fix segfault when iterating a revlist backwards
The `prev` and `next` pointers were not being updated after popping one
of the list elements.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
e822508a
|
2011-02-18T10:29:55
|
|
Disable threaded index writing by default
The interlocking on the write threads was not being done properly (index
entries were sometimes written out of order). With proper interlocking,
the threaded write is only marginally faster on big index files, and
slower on the smaller ones because of the overhead when creating
threads.
The threaded index writing has been temporarily disabled; after more
accurate benchmarks, if might be possible to enable it again only when
writing very large index files (> 1000 entries).
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|