Commit Graph

1650 Commits

Author SHA1 Message Date
Carlos Martín Nieto
eb07a4d1dd http: add more modularity to the code
Not every request needs a new connection if we're using a keep-alive
connection. Store the HTTP parser, host and port in the transport in
order to have it available in later calls.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-12 21:33:18 +02:00
Vicent Marti
502dd2dadb msvc: Fix resourc embedding 2011-10-12 12:09:56 -07:00
Vicent Martí
92e2081f40 Merge pull request #449 from csware/include-win-version-information
Include windows version information in git2.dll
2011-10-12 11:03:58 -07:00
Vicent Martí
bff5f4e396 Merge pull request #452 from carlosmn/cmake-respect-user
Assorted CMake fixes
2011-10-11 15:11:23 -07:00
Carlos Martín Nieto
5cb7a1addf Explain how to build universal OSX binaries
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-11 18:14:13 +02:00
Carlos Martín Nieto
5b216d1a6f CMake: don't overwrite the user's CFLAGS
If either CFLAGS is defined or the user passes -DCMAKE_C_FLAGS to
cmake, the variable already contains flags. Don't overwrite them, but
append them to our settings.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-11 18:08:54 +02:00
Carlos Martín Nieto
dcd62cb2e9 CMake: Only add the STDCALL option when using MSVC
This option is only ever used with MSVC.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-11 17:57:00 +02:00
Carlos Martín Nieto
8f9be31677 fetch: move 'head' so it's visible to the whole function
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-09 21:49:10 +02:00
Vicent Martí
6aac5afb6d Merge pull request #444 from carlosmn/fetch-fixes
A couple of fetch fixes
2011-10-09 12:09:57 -07:00
Sven Strickroth
cf9bf6b787 include version information in git2.dll on Windows
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2011-10-09 18:55:28 +02:00
Sven Strickroth
96fab093e3 put version information in separate file
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2011-10-09 18:39:52 +02:00
Sven Strickroth
da2281c7c0 libgit2 doesn't use -LIB define
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2011-10-09 18:35:42 +02:00
Vicent Martí
5a1d2b2a17 Merge pull request #447 from csware/fix-win64-build
fix build for x64
2011-10-08 21:18:09 -07:00
Sven Strickroth
314f54eb06 fix build for x64
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2011-10-09 05:29:57 +02:00
Carlos Martín Nieto
517bda196e fetch: store FETCH_HEAD
We should always save the remote's HEAD as FETCH_HEAD locally.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-08 02:28:02 +02:00
Carlos Martín Nieto
4a3b18a62f A missing refspec is not an error
It's rare for a configured remote, but for one given as an URL on the
command line, it's more often than not the case.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-08 02:12:26 +02:00
Vicent Martí
d322d10ae0 Merge pull request #439 from carlosmn/network-examples
Add network examples
2011-10-07 14:20:53 -07:00
Vicent Martí
01be6f37d1 Merge pull request #446 from schu/tests-clay-update
tests-clay: update
2011-10-07 14:20:25 -07:00
schu
1d33bf9d02 tests-clay: add a readme file
Signed-off-by: schu <schu-github@schulog.org>
2011-10-07 23:13:09 +02:00
schu
681008c768 tests-clay: update clay
The clay script didn't match the latest version from upstream.
Additionaly, add core/strtol.c to complete porting the core tests to
clay.

Signed-off-by: schu <schu-github@schulog.org>
2011-10-07 23:02:02 +02:00
Vicent Marti
3eaf34f4c6 libgit2 v0.15.0 "Das Wunderbar Release"
I am aware the codename is not gramatically correct in any language.

Check the COPYING file for the detailed terms on libgit2's license. Check
the AUTHORS file for the full list of guilty parties.

As we slowly stabilize the API, we've dropped 1 function from the library,
and changed the signature of only 5 of them. There's of course a good
chunk of new functionality, and a thousand bug fixes.

In this release of libgit2:

	- Changed `git_blob_rawsize`: Now returns `size_t` instead of int, allowing
	files >4GB in 64 bit systems.

	- Removed `git_commit_message_short`: Please use `git_commit_message`
	to get the full message and decide which is the "short view" according
	to your needs (first line, first 80 chars...)

	- Added `git_commit_message_encoding`: Returns the encoding field of a commit
	message, if it exists.

	- Changed `git_commit_create`, `git_commit_create_v`: New argument `encoding`, which
	adds a encoding field to the generated commit object.

	- Added `git_config_find_system`: Returns the path to the system's global config
	file (according to the Core Git standards).

	- Changed `git_config_get_XX`, `git_config_set_XX`: the `long` and `int` types have
	been replaced by `int64` and `int32` respectively, to make their meaning more
	obvious.

	- Added `git_indexer`: An interface to index Git Packfiles has been added in the
	`git2/indexer.h` header.

	- Changed `git_reflog_entry_XX`: Reflog entries are now returned as `git_oid *` objects
	instead of hexadecimal OIDs.

	- Added `git_remote`: More fetch functionality has been added to the `git2/remote.h`
	functionality. Local, Smart HTTP and Git protocols are now supported.

	- Added `git_repository_head`: Returns the HEAD of the repository.

	- Added `git_repository_config_autoload`: Opens the configuration file of a repository,
	including the user's and the system's global config files, if they can be found.

	- Changed `git_signature_now`: Now returns an error code; the signature is stored by
	reference.
2011-10-05 16:48:36 -04:00
Vicent Marti
d3fb6a81c3 cmake: Set the old test suite as default for the release 2011-10-05 16:46:34 -04:00
Vicent Marti
dd3fd68266 msvc: Remove superfluous includes 2011-10-05 13:44:27 -07:00
Vicent Marti
c060854ed5 msvc: Properly handle inttypes.h/stdint.h 2011-10-05 16:21:16 -04:00
Carlos Martín Nieto
72d6a20be0 indexer: NUL-terminate the filename
As we no longer use the STRLEN macro, the NUL-terminator in the string
was not copied over. Fix this.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-05 20:25:28 +02:00
Vicent Martí
24ce105b40 Merge pull request #441 from csware/ignore-missing-pack-file
ignore missing pack file
2011-10-03 14:42:52 -07:00
Vicent Martí
ef1e5da127 Merge pull request #438 from jdavid/development
Make git_oid_fromstrn support hex strings of odd length
2011-10-03 14:40:06 -07:00
Sven Strickroth
599297fdc3 ignore missing pack file as git does
See http://code.google.com/p/tortoisegit/issues/detail?id=862

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2011-10-03 23:28:24 +02:00
Carlos Martín Nieto
2401262778 examples: add ls-remote, fetch and index-pack examples
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-03 02:32:32 +02:00
J. David Ibáñez
0e058e789b oid: add missing check to git_oid_fromstrn
Signed-off-by: J. David Ibáñez <jdavid.ibp@gmail.com>
2011-10-02 21:53:04 +02:00
Carlos Martín Nieto
cd19ca9584 Squelch a couple of warnings
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 20:16:13 +02:00
Carlos Martín Nieto
9ac581bf7f config: behave like git with [section.subsection]
The documentation is a bit misleading. The subsection name is always
case-sensitive, but with a [section.subsection] header, the subsection
is transformed to lowercase when the configuration is parsed.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 19:58:26 +02:00
Carlos Martín Nieto
92be7908bd indexer: return immediately if passed a NULL value
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 14:46:30 +02:00
Carlos Martín Nieto
922bc22532 pkt: send all of the wants in the negotiation
A missing if caused the function to return after the first want line
without capabilities.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 14:34:51 +02:00
Carlos Martín Nieto
7ad994bb60 transport-git: fix git request length calculation
There was an off-by-one error that was uncovered when we used the
right length from git_buf.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 13:46:35 +02:00
Vicent Marti
dfd0abda4d clay: Fix compilation under MSVC 2011-10-01 13:25:24 +02:00
Vicent Marti
10063aeb41 transport-git: Encapsulation ist gut 2011-10-01 13:10:29 +02:00
Vicent Marti
657ce4b5b6 http-transport: Properly cleanup the WSA context 2011-10-01 13:03:19 +02:00
Vicent Marti
1e5b263577 http-transport: Update copyright 2011-10-01 12:58:17 +02:00
Vicent Martí
f77d4f7fc6 Merge pull request #437 from carlosmn/networking-windows
Fix networking on Windows
2011-10-01 03:56:19 -07:00
Carlos Martín Nieto
dc8e3096d6 Include stdint.h in git2/config.h
Otherwise MSVC doesn't know what we're talking about when we say
int32_t or int64_t.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 02:09:35 +02:00
Carlos Martín Nieto
bad53552e5 netops: abstract away socket closing
Winsock wants us to use closesocket() instead of close(), so introduce
the gitno_close function, which does the right thing.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 00:41:09 +02:00
Carlos Martín Nieto
a28889198c local transport: don't segfault on wrong URL
memset the structure on initialisation and don't try to dereference
the vector with the heads if we didn't find a repository.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 00:41:09 +02:00
Carlos Martín Nieto
ccc9872d4d Initialise the winsock DLL
Windows wants us to initialise the networking DLL before we're allowed
to send data through a socket. Call WSASetup and WSACleanup if
GIT_WIN32 is defined.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 00:41:08 +02:00
Carlos Martín Nieto
a95aeb489f Use git_buf in the git request
This is clearer and sidesteps the issue of what the return value of
snprintf is on the particular OS we're running on.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 00:41:08 +02:00
Vicent Martí
a70b3c7386 Merge pull request #436 from libgit2/config-int-types
config: Proper type declarations for 64 bit ints
2011-09-30 13:52:01 -07:00
J. David Ibáñez
b9caa1859d oid: now git_oid_fromstrn checks whether the given string is too short
Signed-off-by: J. David Ibáñez <jdavid.ibp@gmail.com>
2011-09-30 19:50:13 +02:00
J. David Ibáñez
6d8d3f195c oid: optimize git_oid_fromstrn by using memset
Signed-off-by: J. David Ibáñez <jdavid.ibp@gmail.com>
2011-09-30 19:41:29 +02:00
J. David Ibáñez
e724b058b2 oid: make git_oid_fromstrn support hex strings of odd length
This fixes issue #433.

Signed-off-by: J. David Ibáñez <jdavid.ibp@gmail.com>
2011-09-30 19:08:48 +02:00
Vicent Marti
107e30e9c5 core: One last long long 2011-09-30 16:25:03 +02:00