|
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>
|
|
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>
|
|
8bd6c0ab
|
2011-04-06T15:49:29
|
|
Merge remote-tracking branch 'upstream/development' into config
|
|
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>
|
|
aa793424
|
2011-04-06T15:27:12
|
|
config: coding style fixes
|
|
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>
|
|
0ad6efa1
|
2011-04-04T19:24:19
|
|
Build & write custom trees in memory
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
fe116e26
|
2011-04-04T15:33:14
|
|
config: Fix typo and remove debug statement
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
b153589b
|
2011-04-03T18:31:45
|
|
Make reinitializing a repository return GIT_ENOTIMPLEMENTED instead of GIT_SUCCESS
|
|
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.
|
|
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.
|
|
29e1789b
|
2011-04-04T12:14:03
|
|
Fix the git_tree_write implementation
|
|
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.
|
|
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
|
|
720d5472
|
2011-04-02T12:42:04
|
|
Change `parse` methods to const buffer
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
d8ad64d3
|
2011-04-02T12:28:35
|
|
Merge branch 'parse-tag-buffer' of https://github.com/carlosmn/libgit2 into development
|
|
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
|
|
f026f2b9
|
2011-03-31T15:29:13
|
|
Merge upstream/development
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
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>
|
|
6482929b
|
2011-03-30T18:51:02
|
|
move build_varname above parse_section
|
|
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>
|
|
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>
|
|
df22949a
|
2011-03-31T12:51:17
|
|
config_set: really replace the value on overwrite
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
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>
|
|
ac26e245
|
2011-03-30T23:46:54
|
|
Rename git_tag_create_o_f() to git_tag_create_fo()
|
|
9e680bcc
|
2011-03-30T23:26:36
|
|
Add git_tag_delete()
|
|
a50c1458
|
2011-03-30T23:16:30
|
|
Add git_tag_create_o_f() and git_tag_create_f() which overwrite existing tag reference, if any
|
|
74e50a2d
|
2011-03-30T22:46:52
|
|
Fix memory leak in tag releated tests
|
|
bf4c39f9
|
2011-03-30T22:30:55
|
|
Prevent tag_create() from creating a conflicting reference
|
|
6d316014
|
2011-03-30T21:57:20
|
|
Add test demonstrating that one can create a tag pointing at a non existent target
|
|
8e9a3d42
|
2011-03-30T21:46:19
|
|
Enforce the testing of the correct creation of a tag
|
|
673de2cf
|
2011-03-30T21:29:10
|
|
Fix misleading comments
|
|
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>
|
|
2b9b99b6
|
2011-03-29T21:29:30
|
|
Add test ensuring one can not create an oid reference which targets at an unknown id
|
|
4d00dfd4
|
2011-03-29T21:21:47
|
|
Replace gitfo_unlink() calls with git_reference_delete() in refs related tests
|
|
a796d24c
|
2011-03-29T14:19:40
|
|
Fix help message for waf configure --with-sqlite
|
|
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>
|
|
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>
|
|
9a53df7e
|
2011-03-29T19:40:02
|
|
refs: Don't allow references to inexistent OIDs
|
|
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.
|
|
fc1eeb9d
|
2011-03-29T11:30:09
|
|
Make overwrite test more comprehensive
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
ec991936
|
2011-03-29T10:52:29
|
|
force-rename test: check for the right name
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
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>
|
|
591a9423
|
2011-03-28T18:40:58
|
|
Add tests covering overwriting references
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
4cd6ed75
|
2011-03-28T15:05:02
|
|
Fix documentation copy error
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
c7db45e8
|
2011-03-28T14:53:52
|
|
Match the comment with the error string
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
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>
|
|
baad182c
|
2011-03-28T11:31:58
|
|
Add GIT_EEXISTS error code
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>
|
|
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>
|
|
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>
|
|
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>
|
|
483526eb
|
2011-03-28T22:23:44
|
|
Update the SQLite backend
|
|
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>
|
|
683581a3
|
2011-03-28T17:59:13
|
|
index.c: Fix tiny typos
|
|
9d80d74d
|
2011-03-28T17:57:08
|
|
signature.h: Fix tiny typo
|
|
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>
|
|
7b4a16e2
|
2011-03-28T13:59:48
|
|
Add git_tag_create_frombuffer API
Expose the tag parsing capabilities already present in the
library.
Exporting this function makes it possible to implement the
mktag command without duplicating this functionality.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
c15e0db5
|
2011-03-28T13:58:44
|
|
Fix memory leak in parse_tag_buffer
Free the allocated memory if the signature parsing reports an error.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
09e8de0f
|
2011-03-25T23:53:38
|
|
New external API method: `git_reference_listcb`
List all the references in the repository, calling a custom
callback for each one.
The listed references may be filtered by type, or using
a bitwise OR of several types. Use the magic value
`GIT_REF_LISTALL` to obtain all references, including
packed ones.
The `callback` function will be called for each of the references
in the repository, and will receive the name of the reference and
the `payload` value passed to this method.
|
|
051d6915
|
2011-03-24T18:28:04
|
|
index.h: Fix minor typo
|
|
12f6d8e1
|
2011-03-24T13:48:22
|
|
index.h: Correct documentation for git_index_open_inrepo()
Fix the doxygen comments for git_index_open_inrepo(). Previously they
referred to a param index_path and omitted index (probably a c&p
error).
|
|
3bdc0d4c
|
2011-03-24T15:32:24
|
|
index.c: Read index after initialization
The current behaviour of git_index_open{bare,inrepo}() is unexpected.
When an index is opened, an in-memory index object is created that is
linked to the index discovered by git_repository_open(). However, this
index object is empty, as the on-disk index is not read. To fully open
the on-disk index file, git_index_read() has to be called. This leads to
confusing behaviour. Consider the following code:
git_index *idx;
git_index_open_inrepo(&idx, repo);
git_index_write(idx);
You would expect this to have no effect, as the index is never
ostensibly manipulated. However, what actually happens is that the index
entries are removed from the on-disk index because the empty in-memory
index object created by open_inrepo() is written back to the disk.
This patch reads the index after opening it.
|
|
f3cf7f6d
|
2011-03-23T17:06:49
|
|
add go-git (Go bindings) to the readme
|
|
815c9bc7
|
2011-03-23T20:18:34
|
|
Remove circular dependency in includes
|
|
ea269511
|
2011-03-23T14:57:41
|
|
odb.h: Fix minor typo
Fix a doxygen typo ("@para" instead of "@param") in odb.h
|
|
c585f55f
|
2011-03-23T12:35:08
|
|
common.h: Fix minor typos
Fix a few minor typos in the documentation of the GIT_ERROR codes.
|
|
f6f72d7e
|
2011-03-23T18:44:53
|
|
Improve the ODB writing backend
Temporary files when doing streaming writes are now stored inside the
Objects folder, to prevent issues when moving files between
disks/partitions.
Add support for block writes to the ODB again (for those backends that
cannot implement streaming).
|
|
08db1efd
|
2011-03-23T15:53:12
|
|
Add Ocaml bindings to the readme
|
|
c0ffe518
|
2011-03-23T15:44:52
|
|
Do not return on `void` helper methods
MSVC doesn't swallow that.
|
|
f0d08b7c
|
2011-03-23T15:40:47
|
|
Remove `git_repository_gc` from the headers
|
|
b0b83135
|
2011-03-22T16:15:50
|
|
Add close wappers for commit, tree, tag and blob
In the same spirit that git_repository_lookup is no longer available,
add wrappers so the users don't have to cast when closing their
objects.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
7c80c19e
|
2011-03-23T01:58:18
|
|
Fix compilation in MinGW
|
|
a8375f53
|
2011-03-05T15:09:01
|
|
Add test exercising the opening of an standard repository initialized by git
|
|
2ce44b67
|
2011-03-05T14:33:31
|
|
Add test exercising the opening of an empty bare repository initialized by git
|
|
29e1797c
|
2011-03-05T14:26:22
|
|
Add remove_placeholders() test helper function which recursively removes marker files from a directory structure
|
|
3fe9c60c
|
2011-03-23T00:21:30
|
|
Add empty bare and normal repos to test resources
We have removed the hooks folder because it takes a lot of space
|