Log

Author Commit Date CI Message
Carlos Martín Nieto 55c197cd 2011-04-11T17:41:21 Merge upstream/development
Vicent Marti fdd0cc9e 2011-04-10T15:25:41 Fix path normalization tests They were backtracking too deep into the filesystem on Linux, where the tests were running directly on `tmp/`.
Vicent Marti a6359408 2011-04-10T12:23:55 Use Z_BEST_SPEED for filebuf deflating This is what Git uses by default for all deflating.
Vicent Marti fff036ec 2011-04-09T17:45:38 Import 'with' from __future__ in the build script
Vicent Marti 53b7560b 2011-04-09T16:16:09 Fix `time_t` conversion on Win32
Vicent Marti 14eb94ee 2011-04-09T16:06:17 Fix `gmtime` issues in Win32
Vicent Marti 8416c9ad 2011-04-09T15:31:12 Rename `git_signature_new_now` The new name is more cool.
Carlos Martín Nieto 9e9e6ae1 2011-04-05T16:15:54 Add API git_signature_new_now Most tags will have a timestamp of whenever the code is running and dealing with time and timezones is error-prone. Optimize for this case by adding a function which causes the signature to be created with a current timestamp. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto b5c00c6d 2011-04-07T13:27:34 Fix the signature documentation The parameters are given by '@param name' and not '@name'. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 076141a1 2011-04-07T14:38:03 Add a few malloc checks Add checks to see if malloc failed when allocating the tag members and signature members. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
nulltoken 4a34b3a9 2011-04-09T15:49:44 Add two new accessors to the repository git_repository_path() and git_repository_workdir() respectively return the path to the git repository and the working directory. Those paths are absolute and normalized.
Vicent Marti c6e65aca 2011-04-09T15:22:11 Properly check `strtol` for errors We are now using a custom `strtol` implementation to make sure we're not missing any overflow errors.
Vicent Marti b918ae40 2011-04-08T15:35:25 Do not declare variables in the middle of a func
Vicent Marti 41233c40 2011-04-08T12:42:18 Add new method `git_repository_is_empty`
Vicent Marti cef75d74 2011-04-08T12:41:17 Remove unused variables from test files
Vicent Marti d79f1da6 2011-04-08T12:14:33 refs: Fix issue when packing weak tags Weak tags (e.g. tags that point directly to a normal object instead of a tag object) were failing to be packed.
Carlos Martín Nieto 6ac247b3 2011-04-06T11:59:40 tag: don't check twice if an object exists Remove the check in git_tag_create_frombuffer as it's done by tag_create already. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 7bc66a79 2011-04-06T10:58:14 tag: don't allow tags to non-existent objects These indicate an inconsistency in the repository which we've created, so don't allow them. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 81234673 2011-04-05T16:53:32 tag: discover the target type if needed Don't blindly pass the target type to git_tag_type2string as it will give an empty string on GIT_OBJ_ANY which would cause us to create an invalid tag object. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Jakob Pfender 26f2c897 2011-04-04T16:20:09 index.h: Add IDXENTRY flags needed for index operations Add several IDXENTRY flags that need to be checked in order to properly implement update-index --refresh.
Sam 5924b282 2011-04-06T10:48:31 Added git_commit_tree_oid and git_commit_parent_oid.
Shuhei Tanuma 98ac6780 2011-04-06T02:22:24 fix git_treebuilder_insert probrem. couldn't add new entry when inserting new one with `git_treebuilder_insert`.
Vicent Marti 5868cd02 2011-04-08T03:28:38 Do not assert error codes on Hiredis backend We cannot assume that Redis is never going to return an error code; when Reddit fails, we cannot crash our library, we need to handle the crash gracefully. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Dmitry Kovega 8a64bc29 2011-04-03T21:43:51 redis backend
Carlos Martín Nieto b075b991 2011-04-07T16:54:10 Add getting and setting of long int variables long int is a safer type than int unless the user knows that the variable is going to be quite small. The code has been reworked to use strtol instead of the more complicated sscanf. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 7a4dfd60 2011-04-07T11:30:02 Simplify error path in config_set Many error paths freed their local data althought it is freed later on when the end of the function notices that there was an error. This can cause double frees and invalid memory access. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 493384e3 2011-04-07T11:24:16 config: make cvar_free behave more like other free functions Make cvar_free return void instad of the next element, as it was mostly a hack to make cvar_list_free shorter but it's now using the list macros. Also check if the input is NULL and return immediately in that case. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 6b45cb8a 2011-04-06T18:27:31 config: use and implement list macros Use list macros instead of manually changing the head and/or tail of the variable list.
Carlos Martín Nieto 0d280ea4 2011-04-06T16:31:06 config: use snprintf instead of sprintf Due to the preconditions, there should never be an error, but it pays to be paranoid. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 956ad0ed 2011-04-06T15:51:10 config: free the file buffer earlier There is no need to keep config file in memory until the the configuration is freed. Free the buffer immediately after the configuration has been parsed. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 8bd6c0ab 2011-04-06T15:49:29 Merge remote-tracking branch 'upstream/development' into config
Carlos Martín Nieto acab3bc4 2011-04-06T15:31:42 config: move str(n)tolower to the git__ namespace Non-static functions in a library should always have a prefix namespace. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto aa793424 2011-04-06T15:27:12 config: coding style fixes
Carlos Martín Nieto 6776fd51 2011-04-06T15:17:06 config: really compare the variable name case-insensitively Make cvar_name_match really compare the last part of the variable ignoring the case. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Vicent Marti 0ad6efa1 2011-04-04T19:24:19 Build & write custom trees in memory
Carlos Martín Nieto 8cd767ef 2011-04-04T17:07:47 config: test for a variable on its own If a variable is on its own, truth should be assumed. Check this is true in our code. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 2470be13 2011-04-04T17:06:31 config: variable name on its own means true If a variable name appears on its own in a line, it's assumed the value is true. Store the variable name as NULL in that case. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 0bf8ca88 2011-04-04T16:44:23 config: add tests These tests are basic, but they should tell us when we've broken something. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 9b7a6a99 2011-04-04T16:17:39 config: check for EOF before newline If a line ends at EOF there is no need to check for the newline character and doing so will cause us to read memory beyond the allocatd memory as we check for the Windows-style new-line, which is two bytes long. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 72946881 2011-04-04T15:26:43 config: support multiline values If a variable value has the traditional continuation character (\) as the last non-space character in the line, then we continue reading the value on the next line. Using more than two lines is also supported. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 2454ce78 2011-04-04T11:25:55 config: don't mix buffer reading methods Make header and variable parse functions use their own buffers instead of giving them the line they need to read as a parameter which they mostly ignore. This is in preparation for multiline configuration variables. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 9f1b54d6 2011-04-04T15:07:47 config: also free the file buffer on error On error, the buffer containing the file contents also needs to be freed. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto fe116e26 2011-04-04T15:33:14 config: Fix typo and remove debug statement Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
nulltoken b153589b 2011-04-03T18:31:45 Make reinitializing a repository return GIT_ENOTIMPLEMENTED instead of GIT_SUCCESS
nulltoken f3564e1e 2011-04-03T13:50:09 Fix tag reference name in testrepo.git The git test repository was holding a wrongly named tag reference ("very-simple") pointing at a tag named "e90810b". This mistake (mine :-/ ) originates back to https://github.com/libgit2/libgit2/commit/9282e92 Whole credit goes to @tclem for having spotted this.
Vicent Marti d69d0185 2011-04-04T13:05:20 Add a fake wstream to the ODB Streaming writes will no longer fail when writing to a backend that doesn't support streaming writes but supports direct ones. Now we create a fake stream on memory and then write it as a single block using the backend `write` callback.
Vicent Marti 29e1789b 2011-04-04T12:14:03 Fix the git_tree_write implementation
Sarath Lakshman 47d8ec56 2011-04-03T17:18:56 New external API method: `git_tree_create` Creates a tree by scanning the index file. The method handles recursive creation of trees for subdirectories and adds them to the parent tree.
Vicent Marti 3e3e4631 2011-04-02T12:49:14 Merge branch 'tagging' of https://github.com/nulltoken/libgit2 into development Conflicts: include/git2/tag.h src/tag.c
Vicent Marti 720d5472 2011-04-02T12:42:04 Change `parse` methods to const buffer Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti d8ad64d3 2011-04-02T12:28:35 Merge branch 'parse-tag-buffer' of https://github.com/carlosmn/libgit2 into development
Olivier Ramonat ccfce5f3 2011-03-30T19:47:12 Update README after sqlite option change To build libgit2 with sqlite support, waf configure should be run with --with-sqlite
Carlos Martín Nieto f026f2b9 2011-03-31T15:29:13 Merge upstream/development Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 11d0e705 2011-03-31T10:50:11 Add support for subsections A variable name is stored internally with its section the way it appeared in the configuration file in order to have the information about what parts are case-sensitive inline. Really implement parse_section_header_ext and move the assignment of variables to config_parse. The variable name matching is now done in a case-away way by cvar_name_match and cvar_section_match. Before the user sees it, it's normalized to the two- or three-dot version. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 6482929b 2011-03-30T18:51:02 move build_varname above parse_section
Carlos Martín Nieto d7354d70 2011-03-30T16:22:31 build_varname: lowercase the variable name Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto df22949a 2011-03-31T12:51:17 config_set: really replace the value on overwrite Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto ba84cad3 2011-03-31T15:02:23 wscript: Use -O0 on debug If we want debugging symbols, we most likely want them to point to the right place. With -O2, gdb or valgrind may give wrong information. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
nulltoken ac26e245 2011-03-30T23:46:54 Rename git_tag_create_o_f() to git_tag_create_fo()
nulltoken 9e680bcc 2011-03-30T23:26:36 Add git_tag_delete()
nulltoken a50c1458 2011-03-30T23:16:30 Add git_tag_create_o_f() and git_tag_create_f() which overwrite existing tag reference, if any
nulltoken 74e50a2d 2011-03-30T22:46:52 Fix memory leak in tag releated tests
nulltoken bf4c39f9 2011-03-30T22:30:55 Prevent tag_create() from creating a conflicting reference
nulltoken 6d316014 2011-03-30T21:57:20 Add test demonstrating that one can create a tag pointing at a non existent target
nulltoken 8e9a3d42 2011-03-30T21:46:19 Enforce the testing of the correct creation of a tag
nulltoken 673de2cf 2011-03-30T21:29:10 Fix misleading comments
Carlos Martín Nieto 8ecc5ae5 2011-03-30T16:48:14 git_config_set_int: use the right buffer Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto e21881d1 2011-03-30T15:16:25 git_config: reorder fields according to use Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 2e445cac 2011-03-30T11:07:09 build_varname: allocate memory Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
nulltoken 2b9b99b6 2011-03-29T21:29:30 Add test ensuring one can not create an oid reference which targets at an unknown id
nulltoken 4d00dfd4 2011-03-29T21:21:47 Replace gitfo_unlink() calls with git_reference_delete() in refs related tests
Olivier Ramonat a796d24c 2011-03-29T14:19:40 Fix help message for waf configure --with-sqlite
Carlos Martín Nieto 553fbd64 2011-03-29T11:43:31 Check for looser reference names res/dummy/a and refs/stash must pass. The other rules are already tested by the rest of the checks. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 83c95128 2011-03-24T14:15:00 normalize_name: allow more references under refs/ Allow any well-formed reference name to live under refs/ removing the condition that they be under refs/{heads,tags,remotes}/ as was the design of git. An exception is made for HEAD which is allowed to contain an OID reference in detached HEAD state. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Vicent Marti 9a53df7e 2011-03-29T19:40:02 refs: Don't allow references to inexistent OIDs
Vicent Marti 95cde17c 2011-03-29T19:22:21 Enforce coding conventions in refs.c Internal methods are static and without the git prefix. 'Force' methods have a `_f` prefix to match the other 'force' methods.
Carlos Martín Nieto fc1eeb9d 2011-03-29T11:30:09 Make overwrite test more comprehensive Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto ec991936 2011-03-29T10:52:29 force-rename test: check for the right name Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto dad4a4d5 2011-03-29T10:47:48 rename: don't return early if the target ref exists Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 591a9423 2011-03-28T18:40:58 Add tests covering overwriting references Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 4cd6ed75 2011-03-28T15:05:02 Fix documentation copy error Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto c7db45e8 2011-03-28T14:53:52 Match the comment with the error string Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto fa204962 2011-03-28T12:00:50 Allow forcing the creation or renaming of references Add internal reference create and rename functions which take a force parameter, telling them to overwrite an existing reference if it exists. These functions try to update the reference if it's of the same type as the one it's going to be replaced by. Otherwise the old reference becomes invalid. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto baad182c 2011-03-28T11:31:58 Add GIT_EEXISTS error code Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 05314b5b 2011-03-29T12:25:46 Make GIT_EINVALIDTYPE available for use in config Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 9f7f4122 2011-03-29T12:19:53 Don't leak if config parsing fails Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 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>
Vicent Marti 6dcb09b5 2011-03-28T22:35:27 libgit2 version 0.11.0, "McSwifty" Apologies for the massive changes in the external API (that's my fault), and for the terrible codename for this release (that's @tclem's fault). The detailed overview for the major API changes can be found in the commit at 72a3fe42fb7208712bbe8f0981f4c6274c05e9c3. Major new features in this release: - Real caching and refcounting on parsed objects - Real caching and refcounting on objects read from the ODB - Streaming writes & reads from the ODB - Single-method writes for all object types - The external API is now partially thread-safe - Improved reference handling - New method to list references - ZLib is now built-in - Improvements to the Revision Walker - Tons of bug fixes Thanks to all the contributors who make this possible. Signed-off-by: Vicent Marti <tanoku@gmail.com>