summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* changelog: document that we always build cdeclethomson/cdeclEdward Thomson2019-01-171-0/+3
|
* Introduce GIT_CALLBACK macro to enforce cdeclEdward Thomson2019-01-1734-155/+162
| | | | | | | | | Since we now always build the library with cdecl calling conventions, our callbacks should be decorated as such so that users will not be able to provide callbacks defined with other calling conventions. The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as appropriate.
* cmake: error when STDCALL is specifiedEdward Thomson2019-01-171-0/+4
| | | | | | | To explicitly break end-users who were specifying STDCALL, explicitly fail the cmake process to ensure that they know that they need to change their bindings. Otherwise, we would quietly ignore their option and the resulting cdecl library would produced undefined behavior.
* Use cdecl calling conventions on Win32Edward Thomson2019-01-173-14/+3
| | | | | | | | | | | | | | | | | | | The recommendation from engineers within Microsoft is that libraries should have a calling convention specified in the public API, and that calling convention should be cdecl unless there are strong reasons to use a different calling convention. We previously offered end-users the choice between cdecl and stdcall calling conventions. We did this for presumed wider compatibility: most Windows applications will use cdecl, but C# and PInvoke default to stdcall for WINAPI compatibility. (On Windows, the standard library functions are are stdcall so PInvoke also defaults to stdcall.) However, C# and PInvoke can easily call cdecl APIs by specifying an annotation. Thus, we will explicitly declare ourselves cdecl and remove the option to build as stdcall.
* buffer: wrap EXTERN in DEPRECATEDEdward Thomson2019-01-171-1/+1
| | | | | The GIT_EXTERN macro needs to provide order-specific attributes; update users of the GIT_DEPRECATED macro to allow for that.
* Merge pull request #4932 from libgit2/ethomson/changelogEdward Thomson2019-01-171-0/+94
|\ | | | | changelog: document changes since 0.27
| * changelog: document git_merge_analysis_for_refethomson/changelogEdward Thomson2019-01-171-0/+3
| |
| * changelog: document openssl fixesEdward Thomson2019-01-171-0/+2
| |
| * changelog: document core.logallrefupdates=alwaysEdward Thomson2019-01-171-0/+2
| |
| * fixup! changelog: document changes since 0.27Edward Thomson2019-01-171-1/+1
| |
| * changelog: document changes since 0.27Edward Thomson2019-01-171-0/+87
|/
* Merge pull request #4925 from lhchavez/fix-a-bunch-of-warningsEdward Thomson2019-01-1711-46/+32
|\ | | | | Fix a bunch of warnings
| * Explanation for the rationale behind splitting formattinglhchavez2019-01-091-0/+1
| |
| * Move the intrinsics part of the change to its own PRlhchavez2019-01-081-20/+10
| | | | | | | | Less controversial changes together is better.
| * Windows is hard.lhchavez2019-01-064-4/+7
| |
| * Attempt at fixing the MingW64 compilationlhchavez2019-01-066-21/+40
| | | | | | | | It seems like MingW64's size_t is defined differently than in Linux.
| * Fix a bunch of warningslhchavez2019-01-056-40/+13
| | | | | | | | | | | | | | | | | | | | | | This change fixes a bunch of warnings that were discovered by compiling with `clang -target=i386-pc-linux-gnu`. It turned out that the intrinsics were not necessarily being used in all platforms! Especially in GCC, since it does not support __has_builtin. Some more warnings were gleaned from the Windows build, but I stopped when I saw that some third-party dependencies (e.g. zlib) have warnings of their own, so we might never be able to enable -Werror there.
* | Merge pull request #4941 from libgit2/ethomson/mailmapEdward Thomson2019-01-171-2/+2
|\ \ | | | | | | mailmap: prefer ethomson@edwardthomson.com
| * | mailmap: prefer ethomson@edwardthomson.comethomson/mailmapEdward Thomson2019-01-171-2/+2
| | | | | | | | | | | | My @github.com address is no more.
* | | Merge pull request #4937 from lhchavez/fix-crlfEdward Thomson2019-01-151-55/+55
|\ \ \ | | | | | | | | Convert tests/resources/push.sh to LF endings
| * | | Convert tests/resources/push.sh to LF endingslhchavez2019-01-151-55/+55
|/ / / | | | | | | | | | | | | This changes that file to use UNIX line-endings, which makes sense since this is a UNIXy file.
* | | Merge pull request #4936 from implausible/remove/unnecessary-test-filesEdward Thomson2019-01-142151-11979/+0
|\ \ \ | | | | | | | | Get rid of some test files that were accidentally committed
| * | | Get rid of some test files that were accidentally committedTyler Wanek2019-01-142151-11979/+0
|/ / /
* | | Merge pull request #4934 from stinb/proxy-crashEdward Thomson2019-01-142-0/+10
|\ \ \ | | | | | | | | Fix crash on remote connection when GIT_PROXY_AUTO is set but no proxy is detected
| * | | proxy: fix crash on remote connection with GIT_PROXY_AUTO but no proxy is ↵Jason Haslam2019-01-142-0/+10
| | | | | | | | | | | | | | | | detected
* | | | Merge pull request #4924 from lhchavez/werrorEdward Thomson2019-01-102-10/+9
|\ \ \ \ | | | | | | | | | | Make ENABLE_WERROR actually work
| * | | | Make ENABLE_WERROR actually worklhchavez2019-01-102-10/+9
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change explicitly adds -Werror to the CFLAGS. Due to the way that the ADD_C_FLAG_IF_SUPPORTED() macro was mangling the flag name to convert it into a define name, any warning that had a dash in its name was not being correctly enabled. Additionally, any flag that is enabled implicitly by the compiler (like -Wunused-result and -Wdeprecated-declarations) would not cause an error unless they were explicitly enabled with the ENABLE_WARNINGS() macro.
* | | | Merge pull request #4931 from tiennou/cmake/osx-deprecated-warnEdward Thomson2019-01-101-3/+0
|\ \ \ \ | |/ / / |/| | | Remove unconditional -Wno-deprecated-declaration on macOS
| * | | cmake: remove unconditional -Wno-deprecated-declaration on APPLEEtienne Samson2019-01-101-3/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After taking into consideration the following, I think this should be removed : - OpenSSL isn't the default on Apple platforms - you have to jump through hoops to get CMake to use OpenSSL on macOS (headers aren't in `/usr/include`, so you have to provide `-DOPENSSL_*` overrides) - users are likely (as getting anywhere near the installed 0.9.8 version is insanity IMHO) to package a "modern" version, which wouldn't be marked as deprecated
* | | Merge pull request #4926 from csware/warning-c4133Edward Thomson2019-01-091-1/+1
|\ \ \ | | | | | | | | Fix warning 'function': incompatible types - from 'git_cvar_value *' to 'int *' (C4133) on VS
| * | | Fix warning 'function': incompatible types - from 'git_cvar_value *' to 'int ↵Sven Strickroth2019-01-071-1/+1
| | |/ | |/| | | | | | | | | | | | | *' (C4133) on VS Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | | Merge pull request #4928 from lhchavez/fix-warningsEdward Thomson2019-01-092-9/+9
|\ \ \ | | | | | | | | Fix Linux warnings
| * | | Fix Linux warningslhchavez2019-01-082-9/+9
|/ / / | | | | | | | | | | | | This change fixes -Wmaybe-uninitialized and -Wdeprecated-declarations warnings on Linux builds
* | | Merge pull request #4922 from tiennou/fix/coverity-cidsEdward Thomson2019-01-086-1/+32
|\ \ \ | |/ / |/| | Coverity fixes
| * | coverity: attempt to model clar's assertionsEtienne Samson2019-01-041-0/+23
| | | | | | | | | | | | | | | | | | Coverity considers that anything that looks like assert() behaves like it (ie. side-effects would be skipped on a NDEBUG build). As we have a bunch of those in the test suite (128), this would ensure Coverity isn't confused.
| * | tests: add missing assertsEtienne Samson2019-01-041-0/+2
| | | | | | | | | CID 1398597, 1398598
| * | refs: assert that we're passed valid refs when renamingEtienne Samson2019-01-041-0/+2
| | | | | | | | | CID 1382962
| * | diff: assert that we're passed a valid git_diff objectEtienne Samson2019-01-041-0/+2
| | | | | | | | | CID 1386176, 1386177, 1388219
| * | submodule: grab the error while loading from configEtienne Samson2019-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously, an error in `git_config_next` would be mistaken as a successful load, because the previous call would have succeeded. Coverity saw the subsequent check for a completed iteration as dead, so let's make it useful again. CID 1391374
| * | config: assert that our parameters are validEtienne Samson2019-01-041-0/+2
|/ / | | | | CID 1395011
* | Merge pull request #4919 from pks-t/pks/shutdown-cb-countEdward Thomson2019-01-037-20/+49
|\ \ | | | | | | Shutdown callback count
| * | global: move init callbacks into an arrayPatrick Steinhardt2019-01-021-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have an explicit callchain of all the initialization callbacks in our `init_common` function. This is perfectly fine, but requires us to manually keep track of how many shutdown callbacks there may be installed: to avoid allocations before libgit2 is fully initialized, we assume that every initializer may register at most one shutdown function. These shutdown functions are stored in a static array of size `MAX_SHUTDOWN_CB`, which then needs to be updated manually whenever a new initializer function is being added. The situation can be easily fixed: convert the callchain of init functions into an array and iterate over it to initialize all subsystems. This allows us to define the `git__shutdown_callbacks` array with the same size as the initializer array and rids us of the need to always update `MAX_SHUTDOWN_CB`.
| * | hash: convert `global_init` macros to real functionPatrick Steinhardt2019-01-026-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `git_hash_global_init` function is simply defined as a macro to zero for most of the different hash implementations. This makes it impossible to treat it like a function pointer, which is required for a later commit where we want to improve the way global initialization works. Fix the issue by converting all no-op macros to an inline function returning zero. There's a small gotcha here, though: as most hash implementations only have a header file, but not a corresponding implementation file, we cannot declare the function as non-static. But declaring it as `static inline` fails, too, as there is a previous declaration as non-static. So we have to move the function declaration after the include that brings in the function definition, as it is allowed to have a non-static declaration after a static definition, but not the other way round.
* | | Merge pull request #4904 from libgit2/ethomson/crlfEdward Thomson2019-01-037654-238/+33402
|\ \ \ | | | | | | | | Update CRLF filtering to match modern git
| * | | checkout::crlf: ensure successethomson/crlfEdward Thomson2018-12-191-30/+33
| | | | | | | | | | | | | | | | | | | | Wrap function calls in the `checkout::crlf` tests with `cl_git_pass`, `cl_assert`, etc. to ensure that they're successful.
| * | | Additional core.autocrlf and core.safecrlf testsSven Strickroth2018-12-032-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a cherry-pick of the tests from the following commits: core.autocrlf=true and core.safecrlf=true did not fail on LF-only file as vanilla git does Adding a CRLF-file with core.autocrlf=input and core.safecrlf=true does not fail as with vanilla git Make files with #CR!=#CRLF not fail with core.safecrlf=true Reported-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw> Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * | | crlf: update to match git's logicEdward Thomson2018-12-033-201/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Examine the recent CRLF changes to git by Torsten Bögershausen and include similar changes to update our CRLF logic to match. Note: Torsten Bögershausen has previously agreed to allow his changes to be included in libgit2.
| * | | index::crlf: better error reporting in core git testsEdward Thomson2018-12-031-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't simply fail when the expected output does not match the data in the index; instead, provide a detailed output about the system, file, and settings that caused the failure so that developers can better isolate the problem(s).
| * | | index::crlf: simplify test caseEdward Thomson2018-12-031-60/+42
| | | |
| * | | crlf tests: use known-good data produced by gitSven Strickroth2018-12-031-1/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given a variety of combinations of core.autocrlf, core.safecrlf settings and attributes settings, test that we add files to index the same way (regarding OIDs and fatal errors) as a known-good test resource created by git.git. Signed-off-by: Sven Strickroth <email@cs-ware.de>