Commit Graph

2958 Commits

Author SHA1 Message Date
Russell Belfer
aa13bf05c8 Major submodule rewrite
This replaces the old submodule API with a new extended API that
supports most of the things that can be done with `git submodule`.
2012-08-24 11:00:26 -07:00
Russell Belfer
decff7b4c1 New submodule test data 2012-08-24 11:00:26 -07:00
Russell Belfer
2eb4edf5f2 Fix errors on Win32 with new repo init 2012-08-24 10:48:48 -07:00
Vicent Martí
c920e16232 Merge pull request #844 from arrbee/init-extended
Add git_repository_init_ext for power initters
2012-08-23 14:10:47 -07:00
Russell Belfer
e9ca852e4d Fix warnings and merge issues on Win64 2012-08-23 09:20:17 -07:00
Russell Belfer
85bd174626 Some cleanup suggested during review
This cleans up a number of items suggested during code review
with @vmg, including:

* renaming "outside repo" config API to `git_config_open_default`
* killing the `git_config_open_global` API
* removing the `git_` prefix from the static functions in fileops
* removing some unnecessary functionality from the "cp" command
2012-08-22 16:16:42 -07:00
Russell Belfer
b769e936d0 Don't reference stack vars in cleanup callback
If you use the clar cleanup callback function, you can't pass a
reference pointer to a stack allocated variable because when the
cleanup function runs, the stack won't exist anymore.
2012-08-22 16:07:19 -07:00
Russell Belfer
0e26202cd5 fix missing validation and type cast warning 2012-08-22 16:07:19 -07:00
Russell Belfer
ca1b6e5409 Add template dir and set gid to repo init
This extends git_repository_init_ext further with support for
initializing the repository from an external template directory
and with support for the "create shared" type flags that make a
set GID repository directory.

This also adds tests for much of the new functionality to the
existing `repo/init.c` test suite.

Also, this adds a bunch of new utility functions including a
very general purpose `git_futils_mkdir` (with the ability to
make paths and to chmod the paths post-creation) and a file
tree copying function `git_futils_cp_r`.  Also, this includes
some new path functions that were useful to keep the code
simple.
2012-08-22 16:07:19 -07:00
Russell Belfer
662880ca60 Add git_repository_init_ext for power initters
The extended version of repository init adds support for many
of the things that you can do with `git init` and sets up
structures that will make it easier to extend further in the
future.
2012-08-22 16:06:22 -07:00
Russell Belfer
5fdc41e765 Minor bug fixes in diff code
In looking at PR #878, I found a few small bugs in the diff code,
mostly related to work that can be avoided when processing tree-
to-tree diffs that was always being carried out.  This commit has
some small fixes in it.
2012-08-22 13:57:57 -07:00
Vicent Martí
cfda29e382 Merge pull request #891 from arrbee/internal-ignore-api
API for managing in-memory ignore rules
2012-08-22 13:15:14 -07:00
Russell Belfer
2fb4e9b3c5 Wrap up ignore API and add tests
This fills out the ignore API and adds tests.
2012-08-22 11:42:00 -07:00
Russell Belfer
f004c4a8a7 Add public API for internal ignores
This creates a public API for adding to the internal ignores
list, which already existing but was not accessible.

This adds the new default value for core.excludesfile also.
2012-08-21 17:26:39 -07:00
Vicent Martí
697665c0c1 Merge pull request #889 from nulltoken/filemode-enum
Filemode enum
2012-08-21 14:32:09 -07:00
nulltoken
9d7ac675d0 tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode() 2012-08-21 23:15:13 +02:00
nulltoken
a7dbac0b23 filemode: deploy enum usage 2012-08-21 23:15:10 +02:00
nulltoken
d854d59e31 filemode: introduce enum to ease use of attributes 2012-08-21 23:15:08 +02:00
Ben Straub
b2be351aad Win32: test core.autocrlf 2012-08-21 10:55:39 -07:00
Ben Straub
c35881420d Tests: close file handles before asserting
Avoids getting ERROR_SHARING_VIOLATION on win32
and killing the entire clar run.
2012-08-20 20:24:20 -07:00
Vicent Martí
5c27da1f48 Merge pull request #884 from carlosmn/global-windows
Make the memory-window conrol structures global
2012-08-20 12:10:23 -07:00
Carlos Martín Nieto
8cef828d8d Make the memory-window conrol structures global
Up to now, the idea was that the user would do all the operations for
one repository in the same thread. Thus we could have the
memory-mapped window information thread-local and avoid any locking.

This is not practical in a few environments, such as Apple's GCD which
allocates threads arbitrarily or the .NET CLR, where the OS-level
thread can change at any moment.

Make the control structure global and protect it with a mutex so we
don't depend on the thread currently executing the code.
2012-08-20 12:02:52 +02:00
Vicent Martí
6cb64ce34f Merge pull request #879 from nulltoken/deprecated-mode
Handling of 100664 deprecated mode in tree entries
2012-08-19 15:12:43 -07:00
nulltoken
66439b0b1a treebuilder: enhance attributes handling on insertion 2012-08-19 14:11:59 +02:00
nulltoken
a7e3bd9b0f Add deprecated-mode.git test repository 2012-08-19 14:11:57 +02:00
Vicent Martí
f98c32f3fe Merge pull request #778 from ben/clone
Clone
2012-08-19 01:26:06 -07:00
Vicent Martí
1a10fded40 Merge pull request #877 from nulltoken/minor-fixes
Minor fixes
2012-08-15 14:34:49 -07:00
nulltoken
e0db9f1117 refs: fix missing parameter documentation 2012-08-15 17:54:05 +02:00
nulltoken
5fd17fc217 notes: slight documentation enhancements 2012-08-15 17:50:02 +02:00
nulltoken
1a0537e450 Fix compilation warning 2012-08-15 00:08:38 +02:00
Carlos Martín Nieto
fc1826d149 tests: fix tree walking test
Return -1 to stop the iteration instead of not-0
2012-08-14 20:54:13 +02:00
Carlos Martín Nieto
85f28ba891 Merge pull request #873 from carlosmn/tree-walk
git_tree_walk callback return value semantic does not match documentation
2012-08-14 11:43:20 -07:00
Russell Belfer
3a6bc301c5 Merge pull request #875 from arrbee/fix-message-prettify-length-check
Fix message prettify length check
2012-08-14 11:30:18 -07:00
Russell Belfer
85a0e28b80 Make git_message_prettify return bytes written
If you want to be absolutely safe with git_message_prettify, you
can now pass a NULL pointer for the buffer and get back the number
of bytes that would be copied into the buffer.

This means that an error is a non-negative return code and a
success will be greater than zero from this function.
2012-08-14 10:50:58 -07:00
Vicent Martí
e08ca0d4a7 Merge pull request #871 from joshtriplett/fix-note_foreach-docs
git_note_foreach: Fix documentation for notes_ref parameter
2012-08-13 21:04:27 -07:00
Vicent Martí
a6ee620185 Merge pull request #870 from joshtriplett/fix-note_create-docs
git_note_oid: Fix the documentation to reference parameters using the correct names
2012-08-13 21:02:35 -07:00
Vicent Martí
0374e6abe7 Merge pull request #872 from joshtriplett/fix-note_remove-docs
git_note_create: Copyediting on documentation for the oid parameter
2012-08-13 21:02:12 -07:00
Vicent Martí
b7916444d9 Merge pull request #867 from joshtriplett/fix-array-size-for-git_config_get_mapped
Fix incorrect array size in example for git_config_get_mapped
2012-08-13 21:01:24 -07:00
Vicent Martí
c86dd38a64 Merge pull request #866 from arrbee/fix-config-file-parsing
Config file parser includes = in name if no space around it
2012-08-13 20:56:28 -07:00
Carlos Martín Nieto
a6bf16878a tree: allow the user to skip an entry or cancel the walk
Returning a negative cancels the walk, and returning a positive one
causes us to skip an entry, which was previously done by a negative
value.

This allows us to stay consistent with the rest of the functions that
take a callback and keeps the skipping functionality.
2012-08-13 14:07:47 +02:00
Carlos Martín Nieto
53ae12359d tree: bring back the documented behaviour for a walk
However, there should be a way to cancel the walk and another to skip
the entry.
2012-08-13 14:00:53 +02:00
Russell Belfer
616c1433b8 Clean up code
Okay, this is probably cleaner and it is also less net change
from the original version
2012-08-12 11:53:58 -07:00
Josh Triplett
39a60efd39 git_note_remove: Copyediting on documentation for the oid parameter 2012-08-12 11:31:12 -07:00
Russell Belfer
fdc637c4e2 Check prettify message output buffer after cleanup
This makes the message prettify buffer length check accurate.
2012-08-12 09:08:45 -07:00
Russell Belfer
a1ecddf01c Fix config parser boundary logic
The config file parser was not working right if there was no
whitespace between the value name and the equals sign.  This
fixes that.
2012-08-12 07:59:30 -07:00
Josh Triplett
d45ada03cf git_note_foreach: Fix documentation for notes_ref parameter 2012-08-12 06:31:42 -07:00
Josh Triplett
22408f4d5f git_note_oid: Fix the documentation to reference parameters using the correct names 2012-08-12 05:53:30 -07:00
Josh Triplett
b90202bbdd Fix incorrect array size in example for git_config_get_mapped
In the documentation for git_config_get_mapped, the sample mapping
array uses [3] but has 4 entries.  Fix by dropping the size entirely and
letting the compiler figure it out.
2012-08-12 03:56:15 -07:00
Vicent Martí
c9d78bde94 Merge pull request #863 from joshtriplett/export-git_attr_value
Export git_attr_value
2012-08-11 18:21:44 -07:00
Josh Triplett
5389005d93 Export git_attr_value
Commit 0c9eacf3d2 introduced the function
git_attr_value and switched the GIT_ATTR_* macros to use it, but
attempting to use that function leads to a linker error (undefined
reference to `git_attr_value').  Export git_attr_value so programs can
actually call it.
2012-08-11 18:14:07 -07:00