Commit Graph

2522 Commits

Author SHA1 Message Date
nulltoken
9bea8e8590 filebuf: add git_filebuf_flush() 2012-05-27 19:54:53 +02:00
Vicent Martí
4c977a61e5 Merge pull request #734 from scottjg/travis-mingw
Enable mingw cross-compilation in travis-ci
2012-05-26 20:08:04 -07:00
Scott J. Goldman
64ab0ba7fb Enable mingw cross-compile stage in travis-ci 2012-05-26 18:48:49 -07:00
Scott J. Goldman
2eb1844990 Refactor CMakeLists.txt for mingw cross-compile
Two things:
1) By default, Linux CMake puts -fPIC on the link line. So we remove that
for MINGW to avoid warnings that it will be ignored.
2) Similarly, move -fvisibility=hidden flag to be for non-mingw
compilation only to avoid warnings that it will be ignored.
2012-05-26 18:37:40 -07:00
Scott J. Goldman
c1318f7125 Use lowercase names for Windows headers
Otherwise we can't cross-compile on Linux.
2012-05-26 18:16:13 -07:00
Carlos Martín Nieto
250b95b24b ssl: allow skipping the server certificate check
Sometimes it's useful not to perform the check. Allow it to be
configurable.
2012-05-26 21:17:08 +02:00
Vicent Martí
539e6c138e Merge pull request #732 from schu/fix-gcc-nonnull
tests-clar/core: fix non-null warning
2012-05-26 10:38:24 -07:00
Michael Schubert
dbab04594c tests-clar/core: fix non-null warning
gcc 4.7.0 apparently doesn't see that we won't call setenv with NULL as
second argument.
2012-05-26 14:59:07 +02:00
Russell Belfer
29ef309e2c Make errors for system and global files consistent
The error codes from failed lookups of system and global files
on Windows were not consistent with the codes returned on other
platforms.  This makes the error detection patterns match and
adds a unit test for the various errors.
2012-05-25 09:44:56 -07:00
Vicent Martí
4728b55ac6 Merge pull request #729 from arrbee/fix-728
Fix bugs for status
2012-05-24 17:43:17 -07:00
Russell Belfer
2a99df6909 Fix bugs for status with spaces and reloaded attrs
This fixes two bugs:

* Issue #728 where git_status_file was not working for files
  that contain spaces.  This was caused by reusing the "fnmatch"
  parsing code from ignore and attribute files to interpret the
  "pathspec" that constrained the files to apply the status to.
  In that code, unescaped whitespace was considered terminal to
  the pattern, so a file with internal whitespace was excluded
  from the matched files.  The fix was to add a mode to that code
  that allows spaces and tabs inside patterns.  This mode only
  comes into play when parsing in-memory strings.

* The other issue was undetected, but it was in the recently
  added code to reload gitattributes / gitignores when they were
  changed on disk.  That code was not clearing out the old values
  from the cached file content before reparsing which meant that
  newly added patterns would be read in, but deleted patterns
  would not be removed.  The fix was to clear the vector of
  patterns in a cached file before reparsing the file.
2012-05-24 17:14:56 -07:00
Vicent Martí
a4452eb1b9 Merge pull request #727 from libgit2/env-expansion
windows: Properly expand all environment variables
2012-05-24 15:12:18 -07:00
Russell Belfer
9cde607c95 Clean up system file finding tests on Win32 2012-05-24 15:08:55 -07:00
Vicent Martí
349fb6d7ac windows: Properly expand all environment variables 2012-05-24 23:10:12 +02:00
Russell Belfer
5f60fd0098 Merge pull request #726 from arrbee/utf16-home-dir
Get user's home dir in UTF-16 clean manner
2012-05-24 13:56:03 -07:00
Russell Belfer
9e35d7fd6e Fix bugs in UTF-8 <-> UTF-16 conversion
The function to convert UTF-16 to UTF-8 was only allocating a
buffer of wcslen(utf16str) bytes for the UTF-8 string, but that
is not sufficient if you have multibyte characters, and so when
those occured, the conversion was failing.  This updates the
conversion functions to use the Win APIs to calculate the correct
buffer lengths.

Also fixes a comparison in the unit tests that would fail if
you did not have a particular environment variable set.
2012-05-24 13:44:24 -07:00
Carlos Martín Nieto
d3e9c4a5fc repository: default to core.bare = false if it's not set
We used to consider a missing core.bare option to mean that the
repository was corrupt. This is too strict. Consider it a non-bare
repository if it's not set.
2012-05-24 21:54:19 +02:00
Russell Belfer
2305913007 Get user's home dir in UTF-16 clean manner
On Windows, we are having problems with home directories
that have non-ascii characters in them.  This rewrites the
relevant code to fetch environment variables as UTF-16 and
then explicitly map then into UTF-8 for our internal usage.
2012-05-24 12:45:20 -07:00
Carlos Martín Nieto
7eeec8f22d examples/network: consistently use tabs for indentation 2012-05-24 16:41:53 +02:00
Carlos Martín Nieto
88bfe790c0 README: use docs/rel-notes/ for the release notes 2012-05-24 13:38:25 +02:00
Vicent Martí
87ac556f2f Merge pull request #720 from nulltoken/fix/libgit2sharp_issue_153
Make git_futils_mkdir_r() able to cope with Windows network paths
2012-05-23 15:05:03 -07:00
Vicent Martí
c4c9de6a27 Merge pull request #712 from waywardmonkeys/embedded_makefile_fixes
Embedded makefile fixes
2012-05-23 15:03:07 -07:00
Vicent Martí
25804185b5 Merge pull request #716 from scottjg/examples-cleanup
Build fixes for examples/
2012-05-23 15:01:52 -07:00
Vicent Martí
335932651b Merge pull request #723 from carlosmn/rel-notes
Add notice about release notes
2012-05-23 10:10:04 -07:00
Carlos Martín Nieto
0f4d78d29d README: add rules about writing release notes as they happen 2012-05-23 17:12:14 +02:00
Carlos Martín Nieto
902bfd31f4 CONVENTIONS: Update error code names 2012-05-23 16:42:02 +02:00
Carlos Martín Nieto
8bf10dbab2 Remove left-over debugging output 2012-05-23 12:59:21 +02:00
nulltoken
dc07184fa9 fileops: Make git_futils_mkdir_r() able to cope with Windows network paths
Partially fix libgit2/libgit2sharp#153
2012-05-23 12:57:13 +02:00
Scott J. Goldman
62986ff6de Add CMake build for examples / add them to Travis
By default, they are still not built, but hopefully, now that Travis is
building them, this will help stave off some of the bitrot.
2012-05-20 00:52:49 -07:00
Scott J. Goldman
ab4aa138ad Fix examples/general.c compilation
git_reference_listall() -> git reference_list()
2012-05-20 00:40:31 -07:00
Vicent Martí
7a361e93f3 Merge pull request #715 from schu/cleanup-misc
Cleanup
2012-05-19 10:48:15 -07:00
Michael Schubert
e203e9d472 config: do not set an error for GIT_ENOTFOUND
An unset config variable isn't bad per se -- let the call site set an
error in case GIT_ENOTFOUND isn't acceptable.
2012-05-19 18:57:13 +02:00
Michael Schubert
54db1a18df Cleanup
* indexer: remove leftover printf

* commit: remove unused macros COMMIT_BASIC_PARSE, COMMIT_FULL_PARSE
  and COMMIT_PRINT
2012-05-19 18:49:32 +02:00
Carlos Martín Nieto
441df990b4 ssl: look up the last CN the alternative names don't match 2012-05-19 17:51:53 +02:00
Carlos Martín Nieto
3f9eb1e502 ssl: add support for certificates issues to an IP address 2012-05-19 17:51:53 +02:00
Carlos Martín Nieto
d3e1367f61 ssl: remove GnuTLS support
It's too much work for now to redo everything.

Move the ssl context struct to transport.h
2012-05-19 17:51:53 +02:00
Carlos Martín Nieto
16768191c7 ssl: match host names according to RFC 2818 (HTTP over TLS) 2012-05-19 17:51:53 +02:00
Carlos Martín Nieto
dbb36e1b42 ssl: check certificates against the system's trusted CAs 2012-05-19 17:51:53 +02:00
Carlos Martín Nieto
89460f3f57 ssl: teardown the connection on close
This should help us free some resources, though the libraries do keep
some buffers allocated regardless.
2012-05-19 17:50:52 +02:00
Carlos Martín Nieto
a6f24a5b3a https: make it work with OpenSSL as well
Add specific functions that use OpenSSL instead of GnuTLS
2012-05-19 17:50:52 +02:00
Carlos Martín Nieto
66024c7cbc http: add https support when GnuTLS is available
If it's not available, an error saying so will be returned when trying
to use a https:// URL.

This also unifies a lot of the network code to use git_transport in
many places instead of an socket descriptor.
2012-05-19 17:50:52 +02:00
Vicent Martí
f7ed0c3447 Merge pull request #713 from waywardmonkeys/spelling
Fix spelling errors.
2012-05-19 07:10:22 -07:00
Bruce Mitchener
d73c94b21c Fix spelling errors. 2012-05-19 20:26:52 +07:00
Bruce Mitchener
8e1742ab13 Allow passing additional defines and cflags to Makefile.embed. 2012-05-19 18:06:19 +07:00
Bruce Mitchener
56e1e2bf70 Build xdiff as well in Makefile.embed. 2012-05-19 18:05:56 +07:00
Vicent Marti
ad5df35a47 libgit2 v0.17.0 "Lord of Diffstruction"
Welcome to yet another libgit2 release, this one being the
biggest we've shipped so far. Highlights on this release
include diff, branches, notes and submodules support. The new
diff API is shiny and powerful. Check it out.

Apologies, one more time, to all the early adopters for the
breaking API changes. We've been iterating on the error
handling for the library until we reached its current state,
which we believe it's significantly more usable both for normal
users and for developers of bindings to other languages.
Also, we've renamed a few legacy calls to ensure that the whole
external API uses a consistent naming scheme.

As always, check the API docs for the full list of new API calls
and backwards-incompatible changes.

	http://libgit2.github.com/libgit2/

Changelog of new features follows:

Attributes:
	- Added function macros to check attribute values instead of having
	to manually compare them
	- Added support for choosing the attribute loading order (workdir files
	vs index) and to skip the systems' default `.gitattributes`
	- Fixed issues when fetching attribute data on bare repositories

Blob:
	- Added support for creating blobs from any file on disk (not
	restricted to the repository's working directory)
	- Aded support for smudge filters when writing blobs to the ODB
		- So far only CRLF normalization is available

Branches:
	- Added a high-level branch API:
		- git_branch_create
		- git_branch_delete
		- git_branch_list
		- git_branch_move

Commit:
	- Commit messages are now filtered to match Git rules (stripping
	comments and adding proper whitespacing rules)

Config:
	- Added support for setting and getting multivars
	- Added `git_config_get_mapped` to map the value of a config
	variable based on its defaults

Diff:
	- Added full diff API:
		- tree to tree
		- index to tree
		- workdir to index
		- workdir to tree
		- blob to blob

	- Added helper functions to print the diffs as valid patchfiles

Error handling:
	- New design for the error handling API, taking into consideration
	the requirements of dynamic languages

Indexer:
	- Added streaming packfile indexer

Merge:
	- Added support for finding the merge base between two commits

Notes:
	- Full git-notes support:
		- git_note_read
		- git_note_message/git_note_oid
		- git_note_create
		- git_note_remove
		- git_note_free
		- git_note_foreach

References:
	- Added `git_reference_name_to_oid` helper to resolve
	a reference to its final OID

	- Added `git_reference_cmp` to compare two references with
	a stable order

Remotes:
	- Added support for writing and saving remotes
		- `git_remote_add`
		- `git_remote_save`
		- Setters for all the attributes of a remote
	- Switched remote download to the new streaming packfile indexer
	- Fixed fetch on HTTP and Git under Windows
	- Added `git_remote_supported_url` helper to check if a protocol
	can be accessed by the library
	- Added `git_remote_list`

Repository:
	- Made `git_repository_open` smarter when finding the `.git` folder.
	- Added `git_repository_open_ext` with extra options when
	opening a repository

Revwalk:
	- Added support for pushing/hiding several references through a glob
	- Added helper to push/hide the current HEAD to the walker
	- Added helper to push/hide a single reference to the walker

Status:
	- Greatly improved Status implementation using the new `diff` code
	as a backend

Submodules:
	- Added a partial submodules API to get information about a
	submodule and list all the submodules in a repository
		- git_submodule_foreach
		- git_submodule_lookup

Tag:
	- Added `git_tag_peel` helper to peel a tag to its pointed object
	- Tag messages are now filtered to match Git rules (stripping comments
	and adding proper whitespacing rules)

Tree:
	- Killed the old `git_tree_diff` API, which is replaced by the
	new diff code.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2012-05-19 01:40:46 +02:00
Vicent Martí
59d91979d8 Merge pull request #710 from libgit2/breaking-changes
Break everything before the release
2012-05-18 13:53:38 -07:00
Vicent Martí
498b72eb6f Merge pull request #711 from schu/fetch-local-dummy
fetch: set dummy function for local fetch
2012-05-18 04:38:15 -07:00
Michael Schubert
a167002f9e fetch: set dummy function for local fetch
Local fetch isn't implemented yet. Don't segfault on call, but set a
dummy for negotiate_fetch and terminate gracefully.

Reported-by: Brad Harder <bch@methodlogic.net>
2012-05-18 12:44:01 +02:00
Vicent Martí
6ec01e6361 Merge pull request #685 from nulltoken/fix/list-remote-branches
branch: retrieve symbolic references when listing the branches
2012-05-17 16:51:17 -07:00