|
5da5321d
|
2011-06-27T20:01:57
|
|
Initialize memory in git transport
At the same time, do mark the transport as connected.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
9ba49bb5
|
2011-06-23T03:04:23
|
|
Add git_remote_connect and git_remote_ls
These allow you to implement git-ls-remote when given a reference name
and a repository.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
ea7a5452
|
2011-06-24T16:25:26
|
|
Add gitno_buffer as a recv wrapper
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
c7c787ce
|
2011-06-24T18:19:00
|
|
Use gitno_buffer in the git transport
This allows us to leave out the buffer handling logic.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
ce90a407
|
2011-06-22T15:34:37
|
|
Remove the repo param from git_transport_new
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
4e913309
|
2011-06-17T16:38:21
|
|
Move transports to an inheritance model
Rather than an 'private' pointer, make the private structures inherit
from the generic git_transport struct. This way, we only have to worry
about one memory allocation instead of two. The structures are so
simple that this may even make the code use less memory overall.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
7e305056
|
2011-06-06T18:44:19
|
|
local transport: sort the refs before resolving them
By pre-sorting the references, they are already in the right order if
we want to peel them.
With this, we get output-parity with git.git's ls-remote.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
fd679021
|
2011-06-16T02:17:49
|
|
Move git_pkt_{gen_proto,send_request} to transport_git.c
This is where they really belong. Remvoe the prefix and make them
static.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
cbf742ac
|
2011-06-26T19:40:02
|
|
Use (s)size_t
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
c4d0fa85
|
2011-06-16T01:54:19
|
|
Implement and use git_pkt_send_request
This makes it easier to send a requqest for an URL. It assumes there
is a socket where the string should go out to.
Make git_pkt_gen_proto accept a command parameter, which defaults to
git-upload-pack
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
4e95ef02
|
2011-06-16T00:59:46
|
|
Implement and use gitno_send
|
|
1b4f8140
|
2011-06-16T00:39:35
|
|
Create netops and start moving git:// to it
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
0a9a38e5
|
2011-06-06T19:21:05
|
|
local transport: keep better track of memory
Store the ref information in a private struct so we can free it
together with the rest.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
7632e249
|
2011-06-13T23:01:12
|
|
Correctly handle network input
Add a parameter to git_pkt_parse_line to tell it how much data you
have in your buffer. If the buffer is too short, it returns an error
saying so. Adapt the git transport to use this and fix the offset
calculation.
Add the GIT_ESHORTBUFFER error code.
|
|
ecb6ca0e
|
2011-06-08T13:09:47
|
|
Implement the git TCP transport up to ls-remote
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
be9fe679
|
2011-06-08T23:38:22
|
|
Implement and use git_pkt_free
A git_pkt object can be one of several structs. Add this function for
convenience and clarity.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
6a9597c5
|
2011-06-08T19:11:38
|
|
Add function to generate a request
Add git_pkt_gen_proto to crete a request from an url.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
8b9e8de5
|
2011-06-08T10:51:32
|
|
pkt-line: read capabilities
Try to read the server capabilities and add them to the git_pkt_ref
struct.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
b31803f3
|
2011-05-28T11:59:10
|
|
pkt-line: parse other-ref lines
Add support for parsing other-ref lines.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
78fae478
|
2011-06-06T14:19:47
|
|
pkt: make sure we really only read the length
A pkt-line's length are described in its first four bytes in ASCII
hex. Copy this substring to another string before feeding it to
git__strtol32. Otherwise, it will read the whole hash.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
1d27446c
|
2011-05-28T10:56:19
|
|
Move flush-pkt creation into its own function
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
f7fc68df
|
2011-05-27T12:50:07
|
|
Lay the foundations for pkt-line parsing
This are the types I intend to use for pkt-line parsing and (later)
creation. git_pkt serves as a base pointer type and once you know what
type it is you can use the real one (command, tip list, etc.)
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
d6258deb
|
2011-06-25T15:10:09
|
|
Implement ls-remote on local drive
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
8f866dae
|
2011-05-16T22:07:08
|
|
Lay down the fundations for the network code
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
92cb6aa9
|
2011-06-23T15:41:29
|
|
Add git_refspec_transform
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
63f91e1c
|
2011-06-22T16:52:30
|
|
Add git.git's fnmatch, which is really GNU's and the git__fnmatch wrapper
If the strings match, git__fnmatch returns GIT_SUCCESS and
GIT_ENOMATCH on failure to match.
MSVC fixes: Added a test for _MSC_VER and (in that case) defined
HAVE_STRING_H to 1 so it doesn't try to include <strings.h> which
doesn't exist in the MSVC world. Moved the function declarations to
use the modern inline ones so MSVC doesn't have a fit. Added casts
everywhere so MSVC doesn't crap its pants.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
2dc31040
|
2011-06-20T18:58:57
|
|
Abstract the refspec query and parse
Move them to their own functions to avoid duplication and to make it
easier to ignore missing configuration.
Not finding 'fetch' is considered fatal, though this might not be
correct behaviour (push-only remotes?)
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
9c82357b
|
2011-06-17T18:13:14
|
|
Add a remotes API
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
ce90d81f
|
2011-06-24T15:30:10
|
|
revwalk: Do not set error string on revwalk over
|
|
3101a3e5
|
2011-06-23T02:28:29
|
|
refs: Do not overflow when normalizing refnames
|
|
3bf3ad9f
|
2011-06-21T13:53:48
|
|
Merge pull request #269 from schu/infinite-append
gitfo_read: fix read-loop
|
|
4cea2f03
|
2011-06-20T17:53:21
|
|
Stat files with full pathnames
Call gitfo_lstat with the full pathname instead of the relative one,
which fails in case the current working directory is different from
the workdir.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
cdb6f9bf
|
2011-06-20T17:34:01
|
|
Allocate enough memory for the terminator in commit parsing
Also allow space for the null-terminator when allocating the buffer in
packfile_unpack_compressed. Up to now, the last newline had served as
a terminator, but 858ef372 searches for a double-newline and exposes
the problem.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
28f7869d
|
2011-06-20T17:25:13
|
|
gitfo_read: fix read-loop
Signed-off-by: schu <schu-github@schulog.org>
|
|
984ed6b6
|
2011-06-19T12:48:16
|
|
odb: Add GIT_EPASSTHROUGH
Allows a custom user backend to passthrough one of the callbacks. Used
for e.g. caching backends.
|
|
e35e9fb4
|
2011-06-18T13:23:19
|
|
mingw: Fix compilation
|
|
2a406ab5
|
2011-06-18T02:08:56
|
|
config: Fix sorting of repository config files
|
|
19cb6857
|
2011-06-18T01:50:48
|
|
config: Bring back `git_config_open_global`
Scott commands, I obey.
|
|
dbe70bd5
|
2011-06-18T01:12:58
|
|
config: Fix compilation in MSVC
|
|
40070445
|
2011-06-18T00:54:24
|
|
config: Typorrrrl
|
|
deee4766
|
2011-06-17T15:44:26
|
|
Merge pull request #267 from Jopie64/development
Fix compilation error in MSVC when compiling for c++
|
|
07ff8817
|
2011-06-18T00:39:39
|
|
config: Cleanup external API
Do not mess with environment variables anymore. The new external API has
more helper methods, and everything is explicit.
|
|
f0619886
|
2011-06-07T22:09:22
|
|
Fix compilation error in MSVC when compiling for c++
|
|
f3dad3ac
|
2011-06-16T20:06:36
|
|
Add fall-back support to the configuration
If a config has several files, we need to check all of them before we
can say that a variable doesn't exist.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
b22d1479
|
2011-06-16T17:46:06
|
|
Add git_repository_config API
This function puts the global and repository configurations in one
git_config object and gives it to the user.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
b76934de
|
2011-06-16T16:55:11
|
|
Remove double-space
Noticed by txdv
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
9ba9e513
|
2011-06-16T19:54:37
|
|
Parse the repo's configuration when we load it
It's not enough to load the config, we also need to explicitely parse
it after we create it.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
c716b187
|
2011-06-17T19:47:58
|
|
config: Fix unitialized variable warning
|
|
2414d000
|
2011-06-17T10:32:22
|
|
Merge pull request #266 from carlosmn/valgrind
Plug memory leaks
|
|
02285482
|
2011-06-17T19:19:30
|
|
fileops: Cast the GetProcAddress value
|
|
9c11bd0a
|
2011-06-17T19:08:06
|
|
fileops: Fix 'GetFinalPathNameByHandleA' in old platforms
|
|
b2e361cc
|
2011-06-16T20:22:05
|
|
Plug two leaks in config writing
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
e7e0e20f
|
2011-06-16T16:39:20
|
|
Simplify loose ref writing
There is no need to store the format outselves, as the library
provides git_filebuf_printf which takes care of the formatting itself.
Also get rid of an use of strcat + strcpy which is always a nice
thing.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
f1d01851
|
2011-06-16T02:48:48
|
|
oid: Uniformize ncmp methods
Drop redundant methods. The ncmp method is now public
|
|
fa48608e
|
2011-06-16T02:36:21
|
|
oid: Rename methods
Yeah. Finally. Fuck the old names, this ain't POSIX
and they don't make any sense at all.
|
|
43521d06
|
2011-06-16T02:27:43
|
|
refs: Rename git_referece_listcb to _foreach
Same name as `git_config_foreach`
|
|
607d1643
|
2011-06-15T17:24:04
|
|
Merge pull request #248 from carlosmn/config
Implement config writing
|
|
536955f9
|
2011-06-16T02:21:33
|
|
Add method to get the compiled version of the lib
|
|
ef9a6f4c
|
2011-06-15T13:47:41
|
|
Merge pull request #261 from Romain-Geissler/discovery-path-v2
Fix: GIT_PATH_PATH_SEPARATOR is now a semi-colon under Windows.
|
|
0657e46d
|
2011-06-15T12:36:08
|
|
Fix: GIT_PATH_PATH_SEPARATOR is now a semi-colon under Windows.
GIT_PATH_LIST_SEPARATOR and GIT_PATH_MAX are made public so
that it's can be used by a client.
|
|
f2bb894e
|
2011-06-15T12:15:11
|
|
Merge pull request #251 from nulltoken/fix/msvc-warnings
Fix compilation warnings in MSVC
|
|
1aa1b09e
|
2011-06-15T12:11:59
|
|
Merge pull request #260 from nulltoken/fix/git_index_add
Fix git_index_add()
|
|
a64bf21b
|
2011-06-15T16:05:33
|
|
blob: Fix git_blob_create_fromfile()
|
|
63fadf99
|
2011-06-15T17:04:11
|
|
Add mode_t definition in MSVC compat layer
|
|
737406b7
|
2011-06-14T09:31:19
|
|
fix gid_ misspelling
|
|
b0233216
|
2011-06-12T11:40:14
|
|
Remove custom backends
All the custom backend code will be moved to a separate project,
together with the new MySQL backend.
|
|
2e18e29b
|
2011-06-14T16:35:57
|
|
Remove uneeded arpa/inet.h include
This header isn't needed at all and it shows a lot of warnings on
OpenBSD.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
711b1096
|
2011-06-14T13:08:30
|
|
Indent config variables with tags
Confg variables are indended using tags and not four spaces as was
being done by the code.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
9e3aa947
|
2011-06-08T20:39:38
|
|
Fix compilation warnings in MSVC
|
|
e6480970
|
2011-06-10T14:00:54
|
|
Add missing function declarations to avoid MSVC compiler warnings
The better solution would probably be to turn the gitfo_lstat /
gitfo_readlink macros into real functions that wrap either lstat or
gitfo_lstat__w32 (and readlink or gitfo_readlink__w32). However, that
would introduce an indirection unless inlined. For now, this is the less
intrusive change.
|
|
3f66c202
|
2011-06-10T13:57:01
|
|
Use "__inline" instead of "inline" with MSVC
MSVC supports "inline" only in C++ code, not in C code.
|
|
c1802641
|
2011-06-10T13:56:24
|
|
Prefer to use file mode defines instead of raw numbers
|
|
535ff384
|
2011-06-10T13:54:47
|
|
Prefer to use S_IFLNK instead of _S_IFLNK for consistency
|
|
732eb0a8
|
2011-06-10T13:54:25
|
|
Add some missing MSVC compatibility defines
|
|
e3f56a2b
|
2011-06-08T08:11:26
|
|
Merge pull request #216 from glesserd/development
git_tag_create{,_o,_frombuffer} correction and improvement
|
|
4e1543ff
|
2011-06-08T08:09:54
|
|
Merge pull request #250 from pegonma/commit_short_message
Commit short message should be the same as git's
|
|
ae496955
|
2011-06-08T17:03:41
|
|
windows: Fix Symlink issues
Handle Symlinks if they can be handled in Win32. This is not even
compiled. Needs review.
The lstat implementation is modified from core Git.
The readlink implementation is modified from PHP.
|
|
1071c565
|
2011-06-08T04:16:47
|
|
Merge pull request #246 from carlosmn/keep-lock
Keep the lockfile if we fail to lock it
|
|
858ef372
|
2011-06-08T11:16:31
|
|
Changed commit short messages so that they match git log --oneline output.
In git, the short message of a commit is the part of the commit message before 2 consecutive line breaks. In the short message, line breaks are replaced by space characters.
|
|
8bb198e6
|
2011-05-17T16:39:09
|
|
config: implement config writing
After each variable gets set, we store it in our list (not completely
in the right position, but the close enough). Then we write out the
new config file in the same way that git.git does it (keep the rest of
the file intact and insert or replace the variable in its line).
Overwriting variables and adding new ones is supported (even on new
sections), though deleting isn't yet.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
3b3577c7
|
2011-06-07T23:32:14
|
|
config: store new variables with the internal representation of the section
The section name should be stored in its case-sensitive variant when
we are adding a new variable. Use the internalize_section function to
do just that.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
5ab50417
|
2011-06-07T22:49:13
|
|
Remove an unfortunate optimisation from cvar_match_section
The (rather late) early-exit code, which provides a negligible
optimisation causes cvar_match_section to return false negatives when
it's called with a section name instead of a full variable name.
Remove this optimisation.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
bb9272dd
|
2011-06-07T17:03:07
|
|
filebuf cleanup: only unlink lockfile if we've opened it
Add a check for the file descriptor in git_filebuf_cleanup. Without
it, an existing lockfile would be deleted if we tried to acquire it
(but failed, as the lockfile already existed).
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
3a12891f
|
2011-06-07T07:07:45
|
|
Merge pull request #243 from jpfender/symlinks2
Symlinks NEW
|
|
a5aa5bd1
|
2011-06-07T07:04:51
|
|
Merge pull request #245 from schu/use-normalized
rename-reference: use normalized path
|
|
b0a46745
|
2011-06-07T07:03:37
|
|
Merge pull request #241 from nulltoken/fix/msvc-warnings
Fix compilation warnings in MSVC
|
|
275c6a0b
|
2011-06-07T07:03:14
|
|
Merge pull request #242 from schu/fix-unused-2
fileops.c: fix unused warning v2
|
|
52b188f6
|
2011-06-07T14:18:20
|
|
rename-reference: use normalized path
Signed-off-by: schu <schu-github@schulog.org>
|
|
27a1b382
|
2011-06-07T14:15:55
|
|
Export gitfo_shallow_exists
|
|
fdd1e04c
|
2011-06-07T14:10:06
|
|
fileops: Allow differentiation between deep and shallow exists()
When calling gitfo_exists() on a symbolic link, sometimes we need to
simply check whether the link exists and sometimes we need to check
whether the file pointed to by the symlink exists.
Introduce a new function gitfo_shallow_exists that only checks if the
link exists and revert gitfo_exists to the original functionality of
checking whether the file pointed to by the link exists.
|
|
ee4912bf
|
2011-06-07T11:15:23
|
|
Revert "common: Include stat.h in include/git2/common.h instead of src/common.h"
This reverts commit df1c98ab6d6171ed63729195bd190b54b67fe530.
As 8a27b6b reverts the exposition of struct stat to the external API, we
do not need - indeed, do not want - struct stat to be in the outer
include layer.
|
|
b74c867a
|
2011-06-07T11:11:09
|
|
blob: Stat path inside git_blob_create_fromfile
00582bc introduced a change that required the caller of
git_blob_create_fromfile() to pass a struct stat with the stat
information for the file. Several developers pointed out that this would
make life hard for the bindings developers as struct stat isn't widely
supported by other languages.
Make git_blob_create_fromfile() stat the path itself, eliminating the
need for the file to be stat'ed by the caller. This makes
index_init_entry() more costly as the file will be stat'ed twice but
makes life easier for everyone else.
|
|
cbf4f9f4
|
2011-05-25T16:31:14
|
|
common: Include stat.h in include/git2/common.h instead of src/common.h
00582bcb introduced a change to git_blob_create_fromfile() that required
the caller to pass a stat struct. This means that we need to include
stat.h higher in the hierarchy of includes.
|
|
c1a2a14e
|
2011-05-25T16:16:41
|
|
index: Correctly write entry mode
The entry mode flags for an entry created from a path name were not
correctly written if the entry was a symlink. The st_mode of a statted
symlink is 0120777, however git requires the mode to read 0120000,
because it does not care about permissions of symlinks.
Introduce index_create_mode() that correctly writes the mode flags in
the form expected by git.
|
|
1869b31e
|
2011-05-25T16:11:57
|
|
index/fileops: Correctly process symbolic links
gitfo_exists() used to error out if the given file was a symbolic link,
due to access() returning an error code. This is not expected behaviour,
as gitfo_exists() should only check whether the file itself exists, not
its link target if it is a symbolic link.
Fix this by calling gitfo_lstat() instead, which is just a wrapper for
lstat().
Also fix the same error in index_init_entry().
|
|
4d7905c5
|
2011-05-25T16:04:29
|
|
blob: Require stat information for git_blob_create_fromfile()
In order to be able to write symlinks with git_blob_create_fromfile(),
we need to check whether the file to be written is a symbolic link or
not. Since the calling function of git_blob_create_fromfile() is likely to have
stated the file before calling, we make it pass the stat.
The reason for this is that writing symbolic link blobs is significantly
different from writing ordinary files - we do not want to open the link
destination but instead want to write the link itself, regardless of
whether it exists or not.
Previously, index_init_entry() used to error out if the file to be added
was a symlink that pointed to a nonexistent file. Fix this behaviour to
add the file regardless of whether it exists. This mimics git.git's
behaviour.
|
|
1c68d27d
|
2011-06-07T10:15:31
|
|
Fix the error pointed out by tanoku.
Now the code shoulb be c89.
|
|
f120e92b
|
2011-06-07T08:41:33
|
|
Fix compilation warnings in MSVC
|
|
1097dacd
|
2011-06-06T18:33:38
|
|
Merge pull request #240 from Romain-Geissler/tree-object-type
Tree: Added a function that returns the type of a tree entry.
|
|
1b0d92b1
|
2011-06-06T18:28:11
|
|
Merge pull request #238 from pegonma/git_oid_ncmp
Better name for git_oid_match
|