Log

Author Commit Date CI Message
Patrick Steinhardt bf15dbf6 2017-11-06T12:47:40 examples: network: fix Win32 linking errors due to getline The getline(3) function call is not part of ISO C and, most importantly, it is not implemented on Microsoft Windows platforms. As our networking example code makes use of getline, this breaks builds on MSVC and MinGW. As this code wasn't built prior to the previous commit, this was never noticed. Fix the error by instead implementing a `readline` function, which simply reads the password from stdin until it reads a newline character.
Patrick Steinhardt 0b98a66b 2017-11-06T11:16:02 appveyor: build examples By default, CMake will not build our examples directory. As we do not instruct either the MinGW or MSVC builds on AppVeyor to enable building these examples, we cannot verify that those examples at least build on Windows systems. Fix that by passing `-DBUILD_EXAMPLES=ON` to AppVeyor's CMake invocation.
Carlos Martín Nieto 8233f6e3 2017-11-04T23:34:14 Merge pull request #4386 from novalis/gitignore-ignore-space ignore spaces in .gitignore files
Carlos Martín Nieto 6f1e4f4f 2017-11-04T18:31:22 CHANGELOG: add note about supporting conditional includes
Carlos Martín Nieto 0d723f39 2017-11-04T18:30:29 Merge pull request #4332 from pks-t/pks/conditional-includes Conditional includes
Carlos Martín Nieto 42627933 2017-11-04T18:03:26 Merge remote-tracking branch 'upstream/master' into pks/conditional-includes
Carlos Martín Nieto 1475b981 2017-11-04T18:00:56 config: keep the output parameter at the start of the function
Carlos Martín Nieto c44b9170 2017-10-31T09:52:33 tests: resolve the real path for the sandbox in includeIf tests We put our repository in the temporary directory which makes macOS map the path into a virtual path. `realpath(3)` can resolve it and we do so during repository opening, but that makes its path have a different prefix from the sandbox path clar thinks we have. Resolve the sandbox path before putting it into the test config files so the paths match as expected.
Carlos Martín Nieto 990d2b85 2017-10-31T00:13:59 Merge pull request #4393 from libgit2/ethomson/pgpkey travis: grab pgp key from www.edwardthomson.com
Carlos Martín Nieto 6f8a6c33 2017-10-31T00:02:52 Merge pull request #4392 from libgit2/cmn/config-write-preserve-case Preserve the input casing when writing config files
Edward Thomson 45c6efd5 2017-10-30T15:40:44 travis: grab pgp key from www.edwardthomson.com Getting the key from the MIT keyserver is surprisingly unreliable. Try getting it from my website instead...
Carlos Martín Nieto 94e30d9b 2017-10-30T15:55:18 config: check for OOM when writing
Carlos Martín Nieto ba1afdc3 2017-10-30T06:29:02 CHANGELOG: add note about config writing changes
Carlos Martín Nieto 8ec806d7 2017-10-30T06:23:31 config: preserve the original case when writing out new sections and vars For sections we will still use the existing one even if the case disagrees, but the variable always gets written with the case given by the caller.
Carlos Martín Nieto bb8bc4b8 2017-10-30T06:21:55 config: add failing test for preserving case when writing keys While most parts of a configuration key are case-insensitive, we should still be case-preserving and write down whatever string the caller provided.
David Turner 5cb6a2c9 2017-10-29T12:28:43 Ignore trailing whitespace in .gitignore files (as git itself does)
Carlos Martín Nieto 9e3fb594 2017-10-29T15:32:18 Merge pull request #4373 from cjhoward92/examples/log-show-log-size example-log: add support for --log-size
Carlos Martín Nieto 79e09e1a 2017-10-29T13:16:09 Merge pull request #3944 from mhagger/diff-indent-heuristic Implement a diff indent heuristic
Carlos Martín Nieto 1b9cc2ec 2017-10-29T12:08:00 Merge remote-tracking branch 'upstream/master' into diff-indent-heuristic
Edward Thomson 781d73bf 2017-10-28T12:08:39 Merge pull request #4357 from invenia/cv/ssh-passphrase-incorrect Ask for SSH credentials again when passphrase is wrong
Edward Thomson 70e4a31a 2017-10-28T12:07:08 Merge pull request #4384 from pks-t/pks/rm-example-makefile examples: remove Makefile
Curtis Vogt f2f14724 2017-09-21T15:51:52 transports: ssh: ask for credentials again when passphrase is wrong When trying to decode the private key it looks like LibSSH2 returns a LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED when the passphrase is incorrect.
Patrick Steinhardt 9b12eb6f 2017-10-20T15:05:26 examples: remove Makefile Back in the days when libgit2 was still young, libgit2 was using plain Makefiles as build infrastructure. We later changed that to instead use the CMake build system to make cross-platform development easier. In the process, we forgot to remove the Makefile from our examples directory, which is fixed by this commit here. Furthermore, remove the accompanying .gitignore file, which ignores build outputs. As we do out-of-tree builds only nowadays, no output is generated in that directory anymore.
Edward Thomson 8f05d2d8 2017-10-20T12:29:53 Merge pull request #4382 from pks-t/pks/cmake-source-dir cmake: use project-relative binary and source directories
Patrick Steinhardt 4da74c83 2017-10-20T07:29:17 cmake: use project-relative binary and source directories Due to our split of CMake files into multiple modules, we had to replace some uses of the `${CMAKE_CURRENT_SOURCE_DIR}` and `${CMAKE_CURRENT_BINARY_DIR}` variables and replace them with `${CMAKE_SOURCE_DIR}` and `${CMAKE_BINARY_DIR}`. This enabled us to still be able to refer to top-level files when defining build instructions inside of a subdirectory. When replacing all variables, it was assumed that the absolute set of variables is always relative to the current project. But in fact, this is not the case, as these variables always point to the source and binary directory as given by the top-levl project. So the change actually broke the ability to include libgit2 directly as a subproject, as source files cannot be found anymore. Fix this by instead using project-specific source and binary directories with `${libgit2_SOURCE_DIR}` and `${libgit2_BINARY_DIR}`.
Patrick Steinhardt 661cf4d4 2017-10-19T08:16:36 Merge pull request #4375 from mhagger/cmake-version-3.0.x Fix compilation for CMake versions 3.0.x where x >= 1
Michael Haggerty 5efe9d12 2017-10-14T08:58:14 Introduce a new `XDL_INLINE` macro and use it instead of `inline` `inline` is not portable enough, and the `xdiff` code doesn't import the `GIT_INLINE` macro. So introduce a new `XDL_INLINE` macro (with the same definition as `GIT_INLINE`). Use the new macro to inline two functions in `xdiffi.c`.
Michael Haggerty 8bbee8f3 2017-10-14T08:36:54 Fix compilation for CMake versions 3.0.x where x >= 1 Apparently policy CMP0015 was added in CMake 3.1. With CMake 3.0.2, the build was failing with CMake Error at CMakeLists.txt:18 (CMAKE_POLICY): Policy "CMP0051" is not known to this version of CMake. This patch makes it work.
Carson Howard 12a888d5 2017-10-13T07:18:54 examples: log: pass options pointer to print_commit Cleaned up the PR to address styling issues.
Carson Howard 27ff888f 2017-10-11T23:07:24 PROJECTS: remove example for --log-size
Carson Howard 1436b0e1 2017-10-11T21:47:58 example-log: add support for --log-size
Edward Thomson 8ac8c78c 2017-10-09T15:15:08 Merge pull request #4356 from pks-t/pks/static-clar cmake: use static dependencies when building static libgit2
Edward Thomson 34ec6f3a 2017-10-09T15:01:29 Merge pull request #4372 from pks-t/pks/xcode-linking cmake: fix linking in Xcode with object libraries only
Edward Thomson 9840dad2 2017-10-09T14:57:33 Merge pull request #4368 from pks-t/pks/smart-negotiate-revwalk-memleak transports: smart: fix memory leak when skipping symbolic refs
Patrick Steinhardt f7d837c8 2017-05-24T12:12:29 config_file: implement "gitdir/i" conditional Next to the "gitdir" conditional for including other configuration files, there's also a "gitdir/i" conditional. In contrast to the former one, path matching with "gitdir/i" is done case-insensitively. This commit implements the case-insensitive condition.
Patrick Steinhardt 071b6c06 2017-05-24T11:13:36 config_file: implement conditional "gitdir" includes Upstream git.git has implemented the ability to include other configuration files based on conditions. Right now, this only includes the ability to include a file based on the gitdir-location of the repository the currently parsed configuration file belongs to. This commit implements handling these conditional includes for the case-sensitive "gitdir" condition.
Carlos Martín Nieto fb11544b 2017-10-09T11:59:19 Merge pull request #4371 from pks-t/pks/test-checkout-tree-refactoring tests: checkout::tree: verify status entrycount changes on chmod
Patrick Steinhardt 9d7a75be 2017-08-25T19:15:00 config_file: make repo and config path accessible to reader The reader machinery will be extended to handle conditional includes. The only conditions that currently exist all match the against the git directory of the repository the config file belongs to. As such, we need to have access to the repository when reading configuration files to properly handle these conditions. One specialty of thes conditional includes is that the actual pattern may also be a relative pattern starting with "./". In this case, we have to match the pattern against the path relative to the config file which is currently being parsed. So besides the repository, we also have to pass down the path to the current config file that is being parsed.
Patrick Steinhardt d5b9d9e9 2017-05-23T10:53:49 config_file: extract function to parse include path The logic inside this function will be required later on, when implementing conditional includes. Extract it into its own function to ease the implementation.
Patrick Steinhardt 529e873c 2017-05-23T11:51:00 config: pass repository when opening config files Our current configuration logic is completely oblivious of any repository, but only cares for actual file paths. Unfortunately, we are forced to break this assumption by the introduction of conditional includes, which are evaluated in the context of a repository. Right now, only one conditional exists with "gitdir:" -- it will only include the configuration if the current repository's git directory matches the value passed to "gitdir:". To support these conditionals, we have to break our API and make the repository available when opening a configuration file. This commit extends the `open` call of configuration backends to include another repository and adjusts existing code to have it available. This includes the user-visible functions `git_config_add_file_ondisk` and `git_config_add_backend`.
Patrick Steinhardt d02cf564 2017-05-23T12:56:41 repository: constify several repo parameters for getters Several functions to retrieve variables from a repository only return immutable values, which allows us to actually constify the passed-in repository parameter. Do so to help a later patch, which will only have access to a constant repository.
Patrick Steinhardt f38ce9b6 2017-05-24T11:09:38 path: expose `git_path_is_dirsep` This function has previously been implemented in Windows-specific path handling code as `path__is_dirsep`. As we will need this functionality in other parts, extract the logic into "path.h" alongside with a non-Windows implementation.
Patrick Steinhardt e54cf1a3 2017-05-24T11:07:20 path: expose `git_path_is_absolute` This function has previously been implemented in Windows-specific path handling code as `path__is_absolute`. As we will need this functionality in other parts, extract the logic into "path.h" alongside with a non-Windows implementation.
Patrick Steinhardt 0e709032 2017-10-09T10:55:02 cmake: fix linking in Xcode with object libraries only CMake is unable to generate a correct Xcode project when trying to link libraries with only object libraries as its input. As our new build infrastructure makes heavy use of object libraries now, this affects our libgit2 library target, as well, leading to linking errors. Fix the issue by adding a dummy file to the libgit2 objects. As we always have the "features.h" header ready which contains defines only, we can simply link it into the resulting library without any effect whatsoever. This fixes building with Xcode.
Patrick Steinhardt 09c15a7f 2017-10-09T09:08:19 tests: checkout::tree: check that the status list catches mode changes While we verify that we have no mode changes after calling `git_checkout_tree`, we do not verify that the `p_chmod` calls actually resulted in a changed entry. While we should assume that this works due to separate tests for the status list, we should test for the change being listed to avoid programming errors in the test.
Patrick Steinhardt 880dfc50 2017-10-09T09:06:24 tests: checkout::tree: extract check for status entrycount There are multiple locations where we have the same code to check whether the count of status list entries of a repository matches an expected number. Extract that into a common function.
Patrick Steinhardt 38e769cb 2017-10-09T09:00:29 Merge pull request #4369 from libgit2/ethomson/checkout_typechange Checkout typechange-only deltas
Patrick Steinhardt 7cb705cb 2017-10-06T12:05:26 transports: smart: fix memory leak when skipping symbolic refs When we setup the revision walk for negotiating references with a remote, we iterate over all references, ignoring tags and symbolic references. While skipping over symbolic references, we forget to free the looked up reference, resulting in a memory leak when the next iteration simply overwrites the variable. Fix that issue by freeing the reference at the beginning of each iteration and collapsing return paths for error and success.
Edward Thomson 21e6a11a 2017-10-07T12:55:16 Merge pull request #4359 from libgit2/cmn/proxy-options-free Plug some leaks in curl's proxy handling
Edward Thomson 19e8faba 2016-06-15T01:59:56 checkout: test force checkout when mode changes Test that we can successfully force checkout a target when the file contents are identical, but the mode has changed.
Edward Thomson 128c5ca9 2017-10-07T12:23:33 checkout: do not test file mode on Windows On Windows, we do not support file mode changes, so do not test for type changes between the disk and tree being checked out. We could have false positives since the on-disk file can only have an (effective) mode of 0100644 since NTFS does not support executable files. If the tree being checked out did have an executable file, we would erroneously decide that the file on disk had been changed.
Carlos Martín Nieto 25fdb3f0 2017-10-07T11:25:12 proxy: rename the options freeing function
Edward Thomson 58deac77 2017-10-07T02:06:43 Merge pull request #4370 from libgit2/example_general Fix Issue #4047 Check return codes and free objects
Edward Thomson e523826c 2017-10-07T01:38:53 Merge pull request #4321 from libgit2/ethomson/libcurl_build travis: add custom apt sources
Douglas Swanson f4770e47 2017-01-01T09:28:39 Fix Issue #4047 Check return codes and free objects
Edward Thomson 668fa071 2017-10-07T00:26:21 Merge pull request #4363 from cjhoward92/typedef-push-update-reference remote: add typedef to normalize push_update_reference callback
Edward Thomson e2e3943d 2017-10-07T00:22:22 Merge pull request #4367 from pks-t/pks/peel-peeled-to-tag refs: do not use peeled OID if peeling to a tag
Edward Thomson 9dc21efd 2017-10-07T00:10:06 travis: add custom apt sources Move back to Travis's VM infrastructure for efficiency.
Edward Thomson 752b7c79 2016-06-15T02:00:35 checkout: treat files as modified if mode differs When performing a forced checkout, treat files as modified when the workdir or the index is identical except for the mode. This ensures that force checkout will update the mode to the target. (Apply this check for regular files only, if one of the items was a file and the other was another type of item then this would be a typechange and handled independently.)
Carson Howard 7138ce37 2017-10-06T07:16:26 remote: add typedef to normalize push_update_reference callback Very many callbacks in libgit2 have some sort of typedef to normalize the name at git_<name_of_operation>_cb. Add a typedef for push_update_references in the remote so the name follows the same conventions.
Patrick Steinhardt 62ac3931 2017-10-06T14:57:02 Merge pull request #4362 from jacwah/graphdoc Document that a commit is not a descendant of itself
Jacob Wahlgren 56ac6c0a 2017-09-30T17:23:11 graph: document that a commit isn't a descendant of itself
Patrick Steinhardt ec76cc48 2017-10-06T13:58:19 Merge pull request #4364 from andoma/master Use SOCK_CLOEXEC when creating sockets
Patrick Steinhardt b112b1e9 2017-10-06T11:24:11 refs: do not use peeled OID if peeling to a tag If a reference stored in a packed-refs file does not directly point to a commit, tree or blob, the packed-refs file will also will include a fully-peeled OID pointing to the first underlying object of that type. If we try to peel a reference to an object, we will use that peeled OID to speed up resolving the object. As a reference for an annotated tag does not directly point to a commit, tree or blob but instead to the tag object, the packed-refs file will have an accomodating fully-peeled OID pointing to the object referenced by that tag. When we use the fully-peeled OID pointing to the referenced object when peeling, we obviously cannot peel that to the tag anymore. Fix this issue by not using the fully-peeled OID whenever we want to peel to a tag. Note that this does not include the case where we want to resolve to _any_ object type. Existing code may make use from the fact that we resolve those to commit objects instead of tag objects, even though that behaviour is inconsistent between packed and loose references. Furthermore, some tests of ours make the assumption that we in fact resolve those references to a commit.
Andreas Smas 9fe70c9e 2017-01-20T23:14:19 Use SOCK_CLOEXEC when creating sockets
Carlos Martín Nieto c7c5f2c4 2017-09-28T18:28:37 Merge pull request #4339 from pks-t/pks/static-linking Static linking for bundled deps
Carlos Martín Nieto 366f4136 2017-09-28T17:19:56 travis: keep installing our custom libcurl build The block in the script installs the packages if we're _not_ on Precise. This was dropped in c17c3f8a ("travis: drop support for Ubuntu Precise") in error.
Carlos Martín Nieto 6f8d1eb9 2017-09-27T15:30:19 curl: free the user-provided proxy credentials
Carlos Martín Nieto 406b47bf 2017-09-27T15:27:32 curl: free the proxy options
Carlos Martín Nieto 44527f5c 2017-09-27T15:17:26 proxy: add a free function for the options's pointers When we duplicate a user-provided options struct, we're stuck with freeing the url in it. In case we add stuff to the proxy struct, let's add a function in which to put the logic.
Patrick Steinhardt 49551254 2017-09-22T09:34:37 cmake: use static dependencies when building static libgit2 CMake allows us to build a static library by simply setting the variable `BUILD_SHARED_LIBS` to `OFF`. While this causes us to create a static libgit2.a archive, it will not automatically cause CMake to only locate static archives when searching for dependencies. This does no harm in case of building our libgit2.a, as we do not want to include all required dependencies in the resulting archive anyway. Instead, we ask users of a static libgit2.a to link against the required set of static archives themselves, typically aided by the libgit2.pc file. Where it does cause harm, though, is when we build the libgit2_clar test suite. CMake has happily populated our LIBGIT2_LIBS variable with shared libraries, and so linking the final libgit2_clar test does not do the right thing. It will simply ignore those shared libraries, we end up with a test suite with undefined symbols. To fix the issue, we can instruct CMake to only locate libraries with a certain suffix. As static libraries are typically identifiable by their ".a" suffix on Unix-based systems, we can instruct CMake to only locate libraries with this suffix to restrict it from finding any shared libraries. This fixes building a static libgit2_clar test suite. Note that this ignores the problem on Windows. The problem here is that we cannot even distinguish static and dynamic libraries by only inspecting their suffix. So we just ignore the problem on Windows, for now.
Patrick Steinhardt 8c19969a 2017-09-06T07:38:48 cmake: fix static linking for bundled deps Our bundled deps are being built as simple static libraries which are then linked into the libgit2 library via `TARGET_LINK_LIBRARIES`. While this works for a dynamically built libgit2 library, using this function to link two static libraries does not have the expected outcome of merging those static libraries into one big library. This leads to symbols of our bundled deps being undefined in the resulting libgit2 archive. As we have bumped our minimum CMake version to 2.8.11, we can now easily make use of object libraries for our bundled dependencies. So build instructions are still self-contained inside of the dependency directories and the resulting object libraries can just be added to the LIBGIT2_OBJECTS list, which will cause them to be linked into the final resulting static library. This fixes the issue of undefined symbols.
Patrick Steinhardt d8d2f21e 2017-09-06T07:52:12 cmake: unify version check for target include directories There are two locations where we check whether CMake supports `TARGET_INCLUDE_DIRECTORIES`. While the first one uses `VERSION_LESS 2.8.12`, the second one uses `VERSION_GREATER 2.8.11`, which are obviously equivalent to each other. It'd still be easier to grep for specific CMake versions being required for some features if both used the same conditional mentioning the actual target version required. So this commit refactors these conditions to make them equal.
Patrick Steinhardt 172a585f 2017-09-05T15:09:34 cmake: always use object library for git2internal As we have bumped our minimum CMake version to 2.8.11, we can now unconditionally make use of object libraries. So remove the version check for the git2internal object library and always use it.
Patrick Steinhardt cf9f3452 2017-09-06T07:38:32 cmake: bump minimum version to 2.8.11 Our current minimum CMake version is 2.8. This version does not yet allow us to use object libraries (introduced in 2.8.8) and target include directories (introduced in 2.8.12), which are both mechanisms we want to use to fix some specific problems. We previously were not able to bump our CMake version to a version supporting object libraries because Ubuntu Precise only had CMake version 2.8.7 in its repositories. But due to Precise being end of life now, we shouldn't need to honor it anymore. A current survey of some of the more conservative distributions brings up the following versions of CMake: - CentOS 5: 2.6.2 - CentOS 6: 2.8.12.2 - Debian 7: 2.8.11 - Fedora 23: 3.3.2 - OpenSUSE 13.2: 3.0.2 - Ubuntu Precise: 2.8.7 - Ubuntu Trusty: 2.8.12 The only two outliers here are CentOS 5 and Ubuntu Precise. CentOS is currently unsupported due to our minimum version being 2.8 and Ubuntu Precise is not maintained anymore. So the next smallest version supported by all major distributions is 2.8.11. While this does not yet support target include directories, it at least enables us to use object libraries. So this becomes our new minimum required version.
Patrick Steinhardt 1d9dd882 2017-09-05T15:06:29 cmake: distinguish libgit2 objects and sources Distinguish variables keeping track of our internal libgit2 sources and the final objects which shall be linked into the library. This will ease the transition to use object libraries for our bundled dependencies instead of linking them in.
Patrick Steinhardt c17c3f8a 2017-09-06T08:04:19 travis: drop support for Ubuntu Precise Ubuntu Precise is end of life since April 2017. At that point in time, Precise was still the main distro on which Travis CI built upon, with the Trusty-based images still being in a beta state. But since June 21st, Trusty has officially moved out of beta and is now the default image for all new builds. Right now, we build on both old and new images to assure we support both. Unfortunately, this leaves us with the highest minimum version for CMake being 2.8.7, as Precise has no greater version in its repositories. And because of this limitation, we cannot actually use object libraries in our build instructions. But considering Precise is end of life and Trusty is now the new default for Travis, we can and should drop support for this old and unmaintained distribution. And so we do.
Edward Thomson 524c1d3c 2017-09-20T07:48:19 Merge pull request #4334 from pks-t/pks/reproducible-builds Reproducible builds
Edward Thomson 212da30d 2017-09-16T19:49:04 Merge pull request #4348 from pks-t/pks/win32-hash-memleak diff: cleanup hash ctx in `git_diff_patchid`
Edward Thomson d378e384 2017-09-15T17:53:01 Merge pull request #4347 from pks-t/pks/appveyor-vs2015 Fix AppVeyor build failures due to CRTDBG linking issue
Patrick Steinhardt 03a95bc5 2017-09-15T11:32:46 appveyor: add jobs to also build on Visual Studio 2015 In order to cover a wider range of build environments, add two more jobs which build and test libgit2 on Visual Studio 14 2015.
Patrick Steinhardt e1076dbf 2017-09-15T10:01:36 appveyor: explicitly specify build images AppVeyor currently does provide three standard build worker images with VS2013, VS2015 and VS2017. Right now, we are using the implicitly, which is the VS2015 one. We want to be more explicit about this, so that we can easily switch build images based on the job. So starting from this commit, we explicitly set the `APPVEYOR_BUILD_WORKER_IMAGE` variable per job, which enables us to choose different images. To be able to test a wider range of build configurations, this commit also switches the jobs for VC2010 over to use the older, VS2013 based images. As the next commit will introduce two new jobs for building with VS2015, we have then covered both build environments. Also, let us be a bit more explicit regarding the CMake generator. Instead of only saying "Visual Studio 10", use the more descriptive value "Visual Studio 10 2010" to at least avoid some confusion surrounding the versioning scheme of Visual Studio.
Patrick Steinhardt 54214d61 2017-09-15T10:28:32 cmake: fix linker error with dbghelper library When the MSVC_CRTDBG option is set by the developer, we will link in the dbghelper library to enable memory lead detection in MSVC projects. We are doing so by adding it to the variable `CMAKE_C_STANDARD_LIBRARIES`, so that it is linked for every library and executable built by CMake. But this causes our builds to fail with a linker error: ``` LINK: fatal error LNK1104: cannot open file 'advapi32.lib;Dbghelp.lib' ``` The issue here is that we are treating the variable as if it were an array of libraries by setting it via the following command: ``` SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}" "Dbghelp.lib") ``` The generated build commands will then simply stringify the variable, concatenating all the contained libraries with a ";". This causes the observed linking failure. To fix the issue, we should just treat the variabable as a simple string. So instead of adding multiple members, we just add the "Dbghelp.lib" library to the existing string, separated by a space character.
Patrick Steinhardt 046b081a 2017-09-15T10:46:26 diff: cleanup hash ctx in `git_diff_patchid` After initializing the hash context in `git_diff_patchid`, we never proceed to call `git_hash_ctx_cleanup` on it. While this doesn't really matter on most hash implementations, this causes a memory leak on Win32 due to CNG system requiring a `malloc` call. Fix the memory leak by always calling `git_hash_ctx_cleanup` before exiting.
Patrick Steinhardt d630887b 2017-08-30T21:47:12 cmake: enable reproducible static linking By default, both ar(1) and ranlib(1) will insert additional information like timestamps into generated static archives and indices. As a consequence, generated static archives are not deterministic when created with default parameters. Both programs do support a deterministic mode, which will simply zero out undeterministic information with `ar D` and `ranlib -D`. Unfortunately, CMake does not provide an easy knob to add these command line parameters. Instead, we have to redefine the complete command definitons stored in the variables CMAKE_C_ARCHIVE_CREATE, CMAKE_C_ARCHIVE_APPEND and CMAKE_C_ARCHIVE_FINISH. Introduce a new build option `ENABLE_REPRODUCIBLE_BUILDS`. This option is available on Unix-like systems with the exception of macOS, which does not have support for the required flags. If the option is being enabled, we add those flags to the invocation of both `ar` and `ranlib` to enable deterministically building the static archive.
Edward Thomson e098b5f5 2017-09-12T20:21:27 Merge pull request #4344 from slavikus/fix-dirty-buffer-in-git-push-update-tips Clear the remote_ref_name buffer in git_push_update_tips()
Edward Thomson 71a8204d 2017-09-12T20:20:48 Merge pull request #4346 from pks-t/pks/wo-features-header features.h: allow building without CMake-generated feature header
Patrick Steinhardt 26f531d3 2017-09-12T13:35:18 features.h: allow building without CMake-generated feature header In commit a390a8464 (cmake: move defines into "features.h" header, 2017-07-01), we have introduced a new "features.h" header. This file is being generated by the CMake build system based on how the libgit2 build has been configured, replacing the preexisting method of simply setting the defines inside of the CMake build system. This was done to help splitting up the build instructions into multiple separate subdirectories. An overlooked shortcoming of this approach is that some projects making use of libgit2 build the library with custom build systems, without making use of CMake. For those users, the introduction of the "features.h" file makes their life harder as they would have to also generate this file. Fix this issue by guarding all inclusions of the generated header file by the `LIBGIT2_NO_FEATURES_H` define. Like this, other build systems can skip the feature header and simply define all used features by specifying `-D` flags for the compiler again.
Slava Karpenko b34fc3fd 2017-09-11T21:34:41 Clear the remote_ref_name buffer in git_push_update_tips() If fetch_spec was a non-pattern, and it is not the first iteration of push_status vector, then git_refspec_transform would result in the new value appended via git_buf_puts to the previous iteration value. Forcibly clearing the buffer on each iteration to prevent this behavior.
Carlos Martín Nieto 5b947b62 2017-09-10T14:47:04 Merge pull request #4342 from mothacehe/master README: Mention Guile-Git bindings.
Mathieu Othacehe b4e0d293 2017-09-09T09:54:58 README: Mention Guile-Git bindings.
Patrick Steinhardt 583e4141 2017-08-30T14:35:57 tests: deterministically generate test suite definitions The script "generate.py" is used to parse all test source files for unit tests. These are then written into a "clar.suite" file, which can be included by the main test executable to make available all test suites and unit tests. Our current algorithm simply collects all test suites inside of a dict, iterates through its items and dumps them in a special format into the file. As the order is not guaranteed to be deterministic for Python dictionaries, this may result in arbitrarily ordered C structs. This obviously defeats the purpose of reproducible builds, where the same input should always result in the exact same output. Fix this issue by sorting the test suites by name previous to dumping them as structs. This enables reproducible builds for the libgit2_clar file.
Edward Thomson 3c216453 2017-08-25T21:06:46 Merge pull request #4296 from pks-t/pks/pattern-based-gitignore Fix negative ignore rules with patterns
Edward Thomson 4b000fc0 2017-08-25T21:05:20 Merge pull request #4305 from pks-t/pks/submodule-with-bare-repo Submodules with bare repo
Edward Thomson bcb7e92d 2017-08-25T21:04:04 Merge pull request #4279 from pks-t/pks/error-builds -Werror builds for Travis
Patrick Steinhardt 477b3e04 2017-07-10T12:25:43 submodule: refuse lookup in bare repositories While it is technically possible to look up submodules inside of a bare repository by reading the submodule configuration of a specific commit, we do not offer this functionality right now. As such, calling both `git_submodule_lookup` and `git_submodule_foreach` should error out early when these functions encounter a bare repository. While `git_submodule_lookup` already does return an error due to not being able to parse the configuration, `git_submodule_foreach` simply returns success and never invokes the callback function. Fix the issue by having both functions check whether the repository is bare and returning an error in that case.
Patrick Steinhardt a889c05f 2017-07-10T11:55:33 tests: submodule: add explicit cleanup function in lookup tests
Patrick Steinhardt 64d1e0b3 2017-07-10T11:52:08 tests: submodule: fix declaration of test The testcase "submodule::lookup::cached" was declared with a single underscore separating the test suide and test name, only. As the clar parser only catches tests with two underscores, it was never executed. Add in the second underscore to actually have it detected and executed.
Patrick Steinhardt 2d9ff8f5 2017-07-10T09:36:19 ignore: honor case insensitivity for negative ignores When computing negative ignores, we throw away any rule which does not undo a previous rule to optimize. But on case insensitive file systems, we need to keep in mind that a negative ignore can also undo a previous rule with different case, which we did not yet honor while determining whether a rule undoes a previous one. So in the following example, we fail to unignore the "/Case" directory: /case !/Case Make both paths checking whether a plain- or wildcard-based rule undo a previous rule aware of case-insensitivity. This fixes the described issue.
Patrick Steinhardt 38b44c3b 2017-07-07T17:10:57 tests: status: additional test for negative ignores with pattern This test is by Carlos Martín Nieto.