|
8cdf439b
|
2017-12-30T13:07:03
|
|
Merge pull request #4028 from chescock/improve-local-fetch
Transfer fewer objects on push and local fetch
|
|
2b7a3393
|
2017-12-30T12:47:57
|
|
Merge pull request #4455 from libgit2/ethomson/branch_symlinks
refs: traverse symlinked directories
|
|
e14bf97e
|
2017-12-30T08:09:22
|
|
Merge pull request #4443 from libgit2/ethomson/large_loose_blobs
Inflate large loose blobs
|
|
7a830f28
|
2017-12-30T00:46:17
|
|
refs:iterator: add tests to recurse symlinks
Ensure that we can recurse into directories via symbolic links.
|
|
9e94b6af
|
2017-12-30T00:12:46
|
|
iterator: cleanups with symlink dir handling
Perform some error checking when examining symlink directories.
|
|
e9628e7b
|
2017-10-30T11:38:33
|
|
branches: Check symlinked subdirectories
Native Git allows symlinked directories under .git/refs. This
change allows libgit2 to also look for references that live under
symlinked directories.
Signed-off-by: Andy Doan <andy@opensourcefoundries.com>
|
|
083b1a2e
|
2017-12-28T10:38:31
|
|
Merge pull request #4021 from carlosmn/cmn/refspecs-fetchhead
FETCH_HEAD and multiple refspecs
|
|
c081f0d0
|
2017-12-26T17:50:59
|
|
fetch: go over FETCH_HEAD just once when counting the prefixes in test
|
|
1b4fbf2e
|
2017-11-19T09:47:07
|
|
remote: append to FETCH_HEAD rather than overwrite for each refspec
We treat each refspec on its own, but the code currently overwrites the contents
of FETCH_HEAD so we end up with the entries for the last refspec we processed.
Instead, truncate it before performing the updates and append to it when
updating the references.
|
|
3ccc1a4d
|
2017-11-19T09:46:02
|
|
futils: add a function to truncate a file
We want to do this in order to get FETCH_HEAD to be empty when we start updating
it due to fetching from the remote.
|
|
c0bfda87
|
2016-12-02T17:36:04
|
|
fetch: add a failing test for FETCH_HEAD with multiple fetch refspecs
|
|
4110fc84
|
2017-12-23T23:30:29
|
|
Merge pull request #4285 from pks-t/pks/patches-with-whitespace
patch_parse: fix parsing unquoted filenames with spaces
|
|
d734466c
|
2017-12-23T16:38:20
|
|
Merge pull request #4045 from lhchavez/fix-unpack-double-free
Fix unpack double free
|
|
c3514b0b
|
2017-12-23T14:59:07
|
|
Fix unpack double free
If an element has been cached, but then the call to
packfile_unpack_compressed() fails, the very next thing that happens is
that its data is freed and then the element is not removed from the
cache, which frees the data again.
This change sets obj->data to NULL to avoid the double-free. It also
stops trying to resolve deltas after two continuous failed rounds of
resolution, and adds a test for this.
|
|
9f7ad3c5
|
2017-12-23T10:55:13
|
|
Merge pull request #4430 from tiennou/fix/openssl-x509-leak
Free OpenSSL peer certificate
|
|
30d91760
|
2017-12-23T10:52:08
|
|
Merge pull request #4435 from lhchavez/ubsan-shift-overflow
libFuzzer: Prevent a potential shift overflow
|
|
1ddc57b3
|
2017-12-23T10:09:12
|
|
Merge pull request #4402 from libgit2/ethomson/iconv
cmake: let USE_ICONV be optional on macOS
|
|
06f3aa5f
|
2017-12-23T10:07:44
|
|
Merge pull request #4429 from novalis/delete-modify-submodule-merge
Do not attempt to check out submodule as blob when merging a submodule modify/deltete conflict
|
|
456e5218
|
2017-12-20T16:13:31
|
|
tests: add GITTEST_SLOW env var check
Writing very large files may be slow, particularly on inefficient
filesystems and when running instrumented code to detect invalid memory
accesses (eg within valgrind or similar tools).
Introduce `GITTEST_SLOW` so that tests that are slow can be skipped by
the CI system.
|
|
bdb54214
|
2017-12-11T16:46:05
|
|
hash: commoncrypto hash should support large files
Teach the CommonCrypto hash mechanisms to support large files. The hash
primitives take a `CC_LONG` (aka `uint32_t`) at a time. So loop to give
the hash function at most an unsigned 32 bit's worth of bytes until we
have hashed the entire file.
|
|
a89560d5
|
2017-12-10T17:26:43
|
|
hash: win32 hash mechanism should support large files
Teach the win32 hash mechanisms to support large files. The hash
primitives take at most `ULONG_MAX` bytes at a time. Loop, giving the
hash function the maximum supported number of bytes, until we have
hashed the entire file.
|
|
3e6533ba
|
2017-12-10T17:25:00
|
|
odb_loose: reject objects that cannot fit in memory
Check the size of objects being read from the loose odb backend and
reject those that would not fit in memory with an error message that
reflects the actual problem, instead of error'ing later with an
unintuitive error message regarding truncation or invalid hashes.
|
|
8642feba
|
2017-12-10T17:23:44
|
|
zstream: use UINT_MAX sized chunks
Instead of paging to zlib in INT_MAX sized chunks, we can give it
as many as UINT_MAX bytes at a time. zlib doesn't care how big
a buffer we give it, this simply results in fewer calls into zlib.
|
|
ddefea75
|
2017-11-30T15:55:59
|
|
odb: support large loose objects
zlib will only inflate/deflate an `int`s worth of data at a time.
We need to loop through large files in order to ensure that we inflate
the entire file, not just an `int`s worth of data. Thankfully, we
already have this loop in our `git_zstream` layer. Handle large objects
using the `git_zstream`.
|
|
d1e44655
|
2017-11-30T15:52:47
|
|
object: introduce git_object_stringn2type
Introduce an internal API to get the object type based on a
length-specified (not null terminated) string representation. This can
be used to compare the (space terminated) object type name in a loose
object.
Reimplement `git_object_string2type` based on this API.
|
|
dacc3291
|
2017-11-30T15:49:05
|
|
odb: test loose reading/writing large objects
Introduce a test for very large objects in the ODB. Write a large
object (5 GB) and ensure that the write succeeds and provides us the
expected object ID. Introduce a test that writes that file and
ensures that we can subsequently read it.
|
|
86219f40
|
2017-11-30T15:40:13
|
|
util: introduce `git__prefixncmp` and consolidate implementations
Introduce `git_prefixncmp` that will search up to the first `n`
characters of a string to see if it is prefixed by another string.
This is useful for examining if a non-null terminated character
array is prefixed by a particular substring.
Consolidate the various implementations of `git__prefixcmp` around a
single core implementation and add some test cases to validate its
behavior.
|
|
b7d36ef4
|
2017-12-12T12:24:11
|
|
zstream: treat `Z_BUF_ERROR` as non-fatal
zlib will return `Z_BUF_ERROR` whenever there is more input to inflate
or deflate than there is output to store the result. This is normal for
us as we iterate through the input, particularly with very large input
buffers.
|
|
a0867242
|
2017-12-19T00:02:52
|
|
Merge pull request #4449 from libgit2/charliesome/git-authors-jonathan-tan
Add Jonathan Tan to git.git-authors
|
|
1ee0628d
|
2017-12-19T10:09:44
|
|
Add Jonathan Tan to git.git-authors
Jonathan has consented via email to have his contributions to git reused in libgit2
|
|
fa8cf14f
|
2017-12-16T21:49:45
|
|
Merge pull request #4447 from pks-t/pks/diff-file-contents-refcount-blob
diff_file: properly refcount blobs when initializing file contents
|
|
8be2a790
|
2017-12-05T23:21:05
|
|
openssl: free the peer certificate
Per SSL_get_peer_certificate docs:
```
The reference count of the X509 object is incremented by one, so that it will not be destroyed when the session containing the peer certificate is freed. The X509 object must be explicitly freed using X509_free().
```
|
|
2518eb81
|
2017-11-24T14:04:10
|
|
openssl: merge all the exit paths of verify_server_cert
This makes it easier to cleanup allocated resources on exit.
|
|
53f2c6b1
|
2017-12-15T15:01:50
|
|
Simplified overflow condition
|
|
2482559d
|
2017-12-15T05:52:02
|
|
Merge pull request #4432 from lhchavez/fix-missing-trailer
libFuzzer: Fix missing trailer crash
|
|
2388a9e2
|
2017-12-15T10:47:01
|
|
diff_file: properly refcount blobs when initializing file contents
When initializing a `git_diff_file_content` from a source whose data is
derived from a blob, we simply assign the blob's pointer to the
resulting struct without incrementing its refcount. Thus, the structure
can only be used as long as the blob is kept alive by the caller.
Fix the issue by using `git_blob_dup` instead of a direct assignment.
This function will increment the refcount of the blob without allocating
new memory, so it does exactly what we want. As
`git_diff_file_content__unload` already frees the blob when
`GIT_DIFF_FLAG__FREE_BLOB` is set, we don't need to add new code
handling the free but only have to set that flag correctly.
|
|
c342c131
|
2017-12-15T04:01:13
|
|
Merge pull request #4444 from tiennou/fix/4440
stransport: provide error message on trust failures
|
|
1b2e83a9
|
2017-12-13T00:19:41
|
|
stransport: provide error message on trust failures
Fixes #4440
|
|
e7fac2af
|
2017-12-09T05:26:27
|
|
Using unsigned instead
|
|
c8aaba24
|
2017-12-06T03:03:18
|
|
libFuzzer: Fix missing trailer crash
This change fixes an invalid memory access when the trailer is missing /
corrupt.
Found using libFuzzer.
|
|
1bf173c3
|
2017-12-08T03:02:32
|
|
Merge pull request #4431 from lhchavez/fix-stream-leak
libFuzzer: Fix a git_packfile_stream leak
|
|
28662c13
|
2017-12-08T06:00:27
|
|
libFuzzer: Prevent a potential shift overflow
The type of |base_offset| in get_delta_base() is `git_off_t`, which is a
signed `long`. That means that we need to make sure that the 8 most
significant bits are zero (instead of 7) to avoid an overflow when it is
shifted by 7 bits.
Found using libFuzzer.
|
|
400caed3
|
2017-12-06T03:22:58
|
|
libFuzzer: Fix a git_packfile_stream leak
This change ensures that the git_packfile_stream object in
git_indexer_append() does not leak when the stream has errors.
Found using libFuzzer.
|
|
2a3e0635
|
2017-12-04T16:56:07
|
|
Do not attempt to check out submodule as blob when merging a submodule modify/deltete conflict
|
|
429bb357
|
2017-12-01T11:45:53
|
|
Merge pull request #4318 from Uncommon/amend_status
Add git_status_file_at
|
|
344b4ead
|
2017-12-01T11:27:15
|
|
Merge pull request #4427 from pks-t/pks/openssl-threadid
openssl: fix thread-safety on non-glibc POSIX systems
|
|
494a2f23
|
2017-11-30T21:45:27
|
|
Merge pull request #4426 from pks-t/pks/diff-flag-set-fix
diff_generate: fix unsetting diff flags
|
|
6cf53e8f
|
2017-11-30T21:41:16
|
|
Merge pull request #4424 from tiennou/fix/incorrect-winhttp-cert-payload
Use the same cert checking payload in WinHTTP
|
|
2d2e70f8
|
2017-11-30T18:10:28
|
|
openssl: fix thread-safety on non-glibc POSIX systems
While the OpenSSL library provides all means to work safely in a
multi-threaded application, we fail to do so correctly. Quoting from
crypto_lock(3):
OpenSSL can safely be used in multi-threaded applications provided
that at least two callback functions are set, locking_function and
threadid_func.
We do in fact provide the means to set up the locking function via
`git_openssl_set_locking()`, where we initialize a set of locks by using
the POSIX threads API and set the correct callback function to lock and
unlock them.
But what we do not do is setting the `threadid_func` callback. This
function is being used to correctly locate thread-local data of the
OpenSSL library and should thus return per-thread identifiers. Digging
deeper into OpenSSL's documentation, the library does provide a fallback
in case that locking function is not provided by the user. On Windows
and BeOS we should be safe, as it simply "uses the system's default
thread identifying API". On other platforms though OpenSSL will fall
back to using the address of `errno`, assuming it is thread-local.
While this assumption holds true for glibc-based systems, POSIX in fact
does not specify whether it is thread-local or not. Quoting from
errno(3p):
It is unspecified whether errno is a macro or an identifier declared
with external linkage.
And in fact, with musl there is at least one libc implementation which
simply declares `errno` as a simple `int` without being thread-local. On
those systems, the fallback threadid function of OpenSSL will not be
thread-safe.
Fix this by setting up our own callback for this setting. As users of
libgit2 may want to set it themselves, we obviously cannot always set
that function on initialization. But as we already set up primitives for
threading in `git_openssl_set_locking()`, this function becomes the
obvious choice where to implement the additional setup.
|
|
5ca3f115
|
2017-11-30T15:12:48
|
|
diff_generate: fix unsetting diff flags
The macro `DIFF_FLAG_SET` can be used to set or unset a flag by
modifying the diff's bitmask. While the case of setting the flag is
handled correctly, the case of unsetting the flag was not. Instead of
inverting the flags, we are inverting the value which is used to decide
whether we want to set or unset the bits.
The value being used here is a simple `bool` which is `false`. As that
is being uplifted to `int` when getting the bitwise-complement, we will
end up retaining all bits inside of the bitmask. As that's only ever
used to set `GIT_DIFF_IGNORE_CASE`, we were actually always ignoring
case for generated diffs.
Fix that by instead getting the bitwise-complement of `FLAG`, not `VAL`.
|
|
90fc7f53
|
2017-11-30T15:09:05
|
|
diff: remove unused macros `DIFF_FLAG_*`
In commit 9be638ecf (git_diff_generated: abstract generated diffs,
2016-04-19), the code for generated diffs was moved out of the generic
"diff.c" and instead into its own module. During that conversion, it was
forgotten to remove the macros `DIFF_FLAG_IS_SET`, `DIFF_FLAG_ISNT_SET`
and `DIFF_FLAG_SET`, which are now only used in "diff_generated.c".
Remove those macros now.
|
|
4ccacdc8
|
2017-07-21T17:07:10
|
|
status: Add a baseline field to git_status_options for comparing to trees other than HEAD
|
|
a9b66677
|
2017-11-30T14:17:04
|
|
Merge pull request #4422 from pks-t/pks/commit-msg-style
CONTRIBUTING: add documentation of our commit message style
|
|
38eaa7ab
|
2017-11-24T12:28:19
|
|
winhttp: pass the same payload as ssh & http transports when checking certificates
|
|
364184ac
|
2017-11-25T11:35:50
|
|
Merge pull request #4423 from apnadkarni/patch-1
Include git2/worktree.h in git2.h
|
|
d439fb20
|
2017-11-25T15:48:03
|
|
Include git2/worktree.h in git2.h
I'm not sure if worktree.h was intentionally left out of git2.h. Looks like an oversight since it is in fact documented.
|
|
fa767daa
|
2017-11-24T22:30:32
|
|
Merge pull request #4410 from libgit2/ethomson/readme
Getting started README improvements
|
|
5bcaba5d
|
2017-11-15T22:52:23
|
|
README: add up some marketing
|
|
b2d54cfa
|
2017-11-12T11:59:56
|
|
README: suggest `ctest -V` for getting started
Suggest that users run `ctest -V` instead of `make test` when getting
started. `ctest -V` is superior over alternatives as:
1. Unlike `make test`, it gives output. Users getting started with
the library believe that it is hung.
2. `ctest -V` shows verbose output; showing suite names is helpful for
giving users more feedback immediately.
|
|
8cbfa183
|
2017-11-15T22:42:35
|
|
README: document test output
|
|
d8c603aa
|
2017-11-12T13:58:37
|
|
TROUBLESHOOTING: introduce guide for common errors
Introduce a simple FAQ for common errors for people getting started with
the project.
|
|
c5d8682f
|
2017-11-12T14:47:11
|
|
README: clarify why one would run libgit2_clar
Since we recommend `ctest -V`, it's not clear why somebody would want to
run `libgit2_clar`. Indicate that it's helpful when running individual
tests or suites.
|
|
9e91a989
|
2017-11-12T13:05:59
|
|
README: provide quick start paragraph
Provide a very simple quick start paragraph that highlights how easy it
is to get started, and points people toward common problems.
|
|
dc985353
|
2017-11-12T12:03:21
|
|
README: drop VS command shell instructions
Users should not be advised to use the VS command prompt; instead, they
should let cmake find their Visual Studio installation.
|
|
d7905450
|
2017-11-24T11:21:54
|
|
CONTRIBUTING: add documentation of our commit message style
While we try to conform to a certain commit message style, this style
has never been documented anywhere. Document it such that new
contributors do not have to go through another needless iteration of
their pull requests just to fix up commit messages.
|
|
59ffb512
|
2017-11-24T10:37:09
|
|
Merge pull request #4298 from tiennou/gather-reflog-messages-tests
Gather the reflog entry content tests
|
|
da635eda
|
2017-11-22T23:47:29
|
|
tests: move free functions at the end
|
|
1e64a446
|
2016-12-02T16:09:21
|
|
fetch: expand fetchhead test to cover providing multiple refspecs
|
|
54510cc6
|
2017-11-19T09:10:02
|
|
Merge pull request #4391 from libgit2/cmn/expose-indent-heuristic
diff: expose the "indent heuristic" in the diff options
|
|
7e3faf58
|
2017-10-29T15:05:28
|
|
diff: expose the "indent heuristic" in the diff options
We default to off, but we might want to consider changing `GIT_DIFF_NORMAL` to
include it.
|
|
a8f19f81
|
2017-11-18T18:41:52
|
|
Merge pull request #4420 from pks-t/pks/strict-aliasing
refcount: make refcounting conform to aliasing rules
|
|
585b5dac
|
2017-11-18T15:43:11
|
|
refcount: make refcounting conform to aliasing rules
Strict aliasing rules dictate that for most data types, you are not
allowed to cast them to another data type and then access the casted
pointers. While this works just fine for most compilers, technically we
end up in undefined behaviour when we hurt that rule.
Our current refcounting code makes heavy use of casting and thus
violates that rule. While we didn't have any problems with that code,
Travis started spitting out a lot of warnings due to a change in their
toolchain. In the refcounting case, the code is also easy to fix:
as all refcounting-statements are actually macros, we can just access
the `rc` field directly instead of casting.
There are two outliers in our code where that doesn't work. Both the
`git_diff` and `git_patch` structures have specializations for generated
and parsed diffs/patches, which directly inherit from them. Because of
that, the refcounting code is only part of the base structure and not of
the children themselves. We can help that by instead passing their base
into `GIT_REFCOUNT_INC`, though.
|
|
530c878d
|
2017-11-15T22:43:37
|
|
Merge pull request #4414 from cpoerschke/master-test-status-codes-legend
add test status codes legend to the 'Started' test trace
|
|
ebe5d8ec
|
2017-07-21T20:12:01
|
|
tests: move static method to the top
|
|
f01a8587
|
2017-07-21T17:45:44
|
|
tests: make reflog_check_entry more clar-y
|
|
b9b1f9f8
|
2017-07-14T03:21:02
|
|
tests: clarify which steps corresponds to each checks
|
|
53672128
|
2017-07-21T17:35:30
|
|
tests: gather the reflog entry content tests
|
|
19f37f97
|
2017-11-13T13:16:28
|
|
add test status codes legend to the 'Started' test trace
motivation: (for someone new to the tests) it's puzzling to find the odd 'S' interspersed in the test output
proposed alternative test output (extract):
$ cmake --build . && ./libgit2_clar -srepo -v
...
Loaded 340 suites:
Started (test status codes: OK='.' FAILURE='F' SKIPPED='S')
repo::config...
repo::discover..........
repo::env.
repo::getters...
repo::hashfile..
repo::head......................
repo::headtree....
repo::init.........................S
repo::message..
repo::new..
repo::open.............
repo::pathspec..........
repo::reservedname.....
repo::setters.....
repo::shallow....
repo::state.............
|
|
15f8d9a2
|
2017-11-13T11:44:30
|
|
Merge pull request #4412 from cpoerschke/master-tests-repo-init-tweak
s/Init/Index comment tweak for test_repo_init__init_with_initial_commit
|
|
732c0b6d
|
2017-11-12T15:17:31
|
|
s/Init/Index comment tweak for test_repo_init__init_with_initial_commit
|
|
fd1492e8
|
2017-11-12T15:34:42
|
|
Merge pull request #4408 from hkleynhans/pos_neg_zero_offset_sig
signature: distinguish +0000 and -0000 UTC offsets
|
|
f063dafb
|
2017-11-12T10:56:50
|
|
signature: distinguish +0000 and -0000 UTC offsets
Git considers '-0000' a valid offset for signature lines. They need to
be treated as _not_ equal to a '+0000' signature offset. Parsing a
signature line stores the offset in a signed integer which does not
distinguish between `+0` and `-0`.
This patch adds an additional flag `sign` to the `git_time` in the
`signature` object which is populated with the sign of the offset. In
addition to exposing this information to the user, this information is
also used to compare signatures.
/cc @pks-t @ethomson
|
|
8c928be4
|
2017-11-12T12:34:51
|
|
Merge pull request #4406 from yoney/clar
Fix clar to verify command line arguments before execute
|
|
80226b5f
|
2017-09-22T13:39:05
|
|
patch_parse: allow parsing ambiguous patch headers
The git patch format allows for having unquoted paths with whitespaces
inside. This format becomes ambiguous to parse, e.g. in the following
example:
diff --git a/file b/with spaces.txt b/file b/with spaces.txt
While we cannot parse this in a correct way, we can instead use the
"---" and "+++" lines to retrieve the file names, as the path is not
followed by anything here but spans the complete remaining line. Because
of this, we can simply bail outwhen parsing the "diff --git" header here
without an actual error and then proceed to just take the paths from the
other headers.
|
|
3892f70d
|
2017-09-22T13:26:47
|
|
patch_parse: treat complete line after "---"/"+++" as path
When parsing the "---" and "+++" line, we stop after the first
whitespace inside of the filename. But as files containing whitespaces
do not need to be quoted, we should instead use the complete line here.
This fixes parsing patches with unquoted paths with whitespaces.
|
|
1d7c15ad
|
2017-11-11T20:15:07
|
|
Merge pull request #4310 from pks-t/pks/common-parser
Common parser interface
|
|
32758631
|
2017-11-11T15:38:27
|
|
clar: verify command line arguments before execute
When executing `libgit2_clar -smerge -invalid_option`, it will first execute
the merge test suite and afterwards output help because of the invalid option.
With this changa, it verifies all options before execute. If there are any
invalid options, it will output help and exit without actually executing
the test suites.
|
|
bbb213c1
|
2017-11-11T13:19:24
|
|
cmake: let USE_ICONV be optional on macOS
Instead of forcing iconv support on macOS (by forcing `USE_ICONV`
on), honor the `USE_ICONV` option only on macOS.
Although macOS includes iconv by default, some macOS users may have a
deficient installation for some reason and they should be provided a
workaround to use libgit2 even in this situation.
iconv support is now disabled entirely on non-macOS platforms. No other
platform supports core.precomposeunicode, and iconv should never be
linked.
|
|
46e1dabb
|
2017-11-11T17:21:13
|
|
Merge pull request #4403 from hkleynhans/select_bundled_zlib
cmake: Allow user to select bundled zlib
|
|
9e66590b
|
2017-07-21T13:01:43
|
|
config_parse: use common parser interface
As the config parser is now cleanly separated from the config file code,
we can easily refactor the code and make use of the common parser
module. This removes quite a lot of duplicated functionality previously
used for handling the actual parser state and replaces it with the
generic interface provided by the parser context.
|
|
1953c68b
|
2017-11-11T17:12:31
|
|
config_file: split out module to parse config files
The configuration file code grew quite big and intermingles both actual
configuration logic as well as the parsing logic of the configuration
syntax. This makes it hard to refactor the parsing logic on its own and
convert it to make use of our new parsing context module.
Refactor the code and split it up into two parts. The config file code
will only handle actual handling of configuration files, includes and
writing new files. The newly created config parser module is then only
responsible for parsing the actual contents of a configuration file,
leaving everything else to callbacks provided to its provided function
`git_config_parse`.
|
|
7bdfc0a6
|
2017-07-14T15:33:32
|
|
parse: always initialize line pointer
Upon initializing the parser context, we do not currently initialize the
current line, line length and line number. Do so in order to make the
interface easier to use and more obvious for future consumers of the
parsing API.
|
|
e72cb769
|
2017-07-14T14:37:07
|
|
parse: implement `git_parse_peek`
Some code parts need to inspect the next few bytes without actually
consuming it yet, for example to examine what content it has to expect
next. Create a new function `git_parse_peek` which returns the next byte
without modifying the parsing context and use it at multiple call sites.
|
|
252f2eee
|
2017-07-14T13:45:05
|
|
parse: implement and use `git_parse_advance_digit`
The patch parsing code has multiple recurring patterns where we want to
parse an actual number. Create a new function `git_parse_advance_digit`
and use it to avoid code duplication.
|
|
65dcb645
|
2017-07-14T13:29:29
|
|
patch_parse: use git_parse_contains_s
Instead of manually checking the parsing context's remaining length and
comparing the leading bytes with a specific string, we can simply re-use
the function `git_parse_ctx_contains_s`. Do so to avoid code duplication
and to further decouple patch parsing from the parsing context's struct
members.
|
|
ef1395f3
|
2017-11-11T15:30:43
|
|
parse: extract parse module
The `git_patch_parse_ctx` encapsulates both parser state as well as
options specific to patch parsing. To advance this state and keep it
consistent, we provide a few functions which handle advancing the
current position and accessing bytes of the patch contents. In fact,
these functions are quite generic and not related to patch-parsing by
themselves. Seeing that we have similar logic inside of other modules,
it becomes quite enticing to extract this functionality into its own
parser module.
To do so, we create a new module `parse` with a central struct called
`git_parse_ctx`. It encapsulates both the content that is to be parsed
as well as its lengths and the current position. `git_patch_parse_ctx`
now only contains this `parse_ctx` only, which is then accessed whenever
we need to touch the current parser. This is the first step towards
re-using this functionality across other modules which require parsing
functionality and remove code-duplication.
|
|
a0b0b808
|
2017-11-11T14:03:14
|
|
cmake: Allow user to select bundled zlib
Under some circumstances the installed / system version of zlib may not
be desirable due to being too old or buggy. This patch adds the option
`USE_BUNDLED_ZLIB` that will cause the bundled version of zlib to be
used.
We may also want to add similar functionality to allow the user to
select other bundled 3rd-party dependencies instead of using the system
versions.
/cc @pks-t @ethomson
|
|
0393ecc6
|
2017-11-11T13:29:27
|
|
Merge pull request #4308 from pks-t/pks/header-state-machine
patch_parse: implement state machine for parsing patch headers
|
|
5a061a23
|
2017-11-10T23:23:02
|
|
Merge pull request #4401 from ktdreyer/describe-h-spelling
describe.h: fix spelling in comments
|
|
38169764
|
2017-11-10T16:19:39
|
|
describe.h: fix spelling in comments
optios -> options
|