]> git.proxmox.com Git - libgit2.git/log
libgit2.git
9 years agomerge: add simple recursive test
Edward Thomson [Fri, 23 Oct 2015 00:20:07 +0000 (20:20 -0400)]
merge: add simple recursive test

Add a simple recursive test - where multiple ancestors exist and
creating a virtual merge base from them would prevent a conflict.

9 years agomerge: rename `git_merge_tree_flags_t` -> `git_merge_flags_t`
Edward Thomson [Thu, 22 Oct 2015 21:00:09 +0000 (17:00 -0400)]
merge: rename `git_merge_tree_flags_t` -> `git_merge_flags_t`

9 years agoMerge pull request #3517 from jacquesg/warnings-fixes
Edward Thomson [Fri, 20 Nov 2015 22:57:04 +0000 (17:57 -0500)]
Merge pull request #3517 from jacquesg/warnings-fixes

Fix some warnings

9 years agoMerge pull request #3514 from jacquesg/stat-fixes
Edward Thomson [Fri, 20 Nov 2015 22:52:00 +0000 (17:52 -0500)]
Merge pull request #3514 from jacquesg/stat-fixes

Stat fixes

9 years agoMerge pull request #3516 from libgit2/cmn/repository-state-sequencer
Edward Thomson [Fri, 20 Nov 2015 20:38:33 +0000 (15:38 -0500)]
Merge pull request #3516 from libgit2/cmn/repository-state-sequencer

repository: distinguish sequencer cherry-pick and revert

9 years agoDetect stat's structure
Jacques Germishuys [Fri, 20 Nov 2015 16:57:13 +0000 (18:57 +0200)]
Detect stat's structure

9 years agoFix some warnings
Jacques Germishuys [Fri, 20 Nov 2015 18:48:51 +0000 (20:48 +0200)]
Fix some warnings

9 years agorepository: distinguish sequencer cherry-pick and revert
Carlos Martín Nieto [Fri, 20 Nov 2015 18:19:23 +0000 (13:19 -0500)]
repository: distinguish sequencer cherry-pick and revert

These are not quite like their plain counterparts and require special handling.

9 years agoMerge pull request #3511 from ethomson/racy_fixes_2
Carlos Martín Nieto [Tue, 17 Nov 2015 18:21:18 +0000 (13:21 -0500)]
Merge pull request #3511 from ethomson/racy_fixes_2

Racy fixes for writing new indexes

9 years agoMerge pull request #3512 from ethomson/windows_sysdir
Carlos Martín Nieto [Tue, 17 Nov 2015 18:20:48 +0000 (13:20 -0500)]
Merge pull request #3512 from ethomson/windows_sysdir

Protect windows SYSDIR when running tests

9 years agotests: use out-of-the-way config dir in sandbox
Edward Thomson [Tue, 17 Nov 2015 16:22:01 +0000 (11:22 -0500)]
tests: use out-of-the-way config dir in sandbox

Don't put the configuration in a subdir of the sandbox named
`config`, lest some tests decide to create their own directory
called `config`.  Prefix with some underscores for uniqueness.

9 years agotests: set PROGRAMDATA directory for running tests
Edward Thomson [Tue, 17 Nov 2015 04:34:26 +0000 (23:34 -0500)]
tests: set PROGRAMDATA directory for running tests

9 years agoconfig::global: use PROGRAMDATA configuration
Edward Thomson [Tue, 17 Nov 2015 13:38:46 +0000 (08:38 -0500)]
config::global: use PROGRAMDATA configuration

Query the `GIT_CONFIG_LEVEL_PROGRAMDATA` location when setting it up
for tests, in case the test runner has sandboxed it.

9 years agosettings: allow users to set PROGRAMDATA
Edward Thomson [Tue, 17 Nov 2015 04:31:19 +0000 (23:31 -0500)]
settings: allow users to set PROGRAMDATA

Allow users to set the `git_libgit2_opts` search path for the
`GIT_CONFIG_LEVEL_PROGRAMDATA`.  Convert `GIT_CONFIG_LEVEL_PROGRAMDATA`
to `GIT_SYSDIR_PROGRAMDATA` for setting the configuration.

9 years agoracy: make git_index_read_index handle raciness
Edward Thomson [Mon, 16 Nov 2015 23:06:52 +0000 (18:06 -0500)]
racy: make git_index_read_index handle raciness

Ensure that `git_index_read_index` clears the uptodate bit on
files that it modifies.

Further, do not propagate the cache from an on-disk index into
another on-disk index.  Although this should not be done, as
`git_index_read_index` is used to bring an in-memory index into
another index (that may or may not be on-disk), ensure that we do
not accidentally bring in these bits when misused.

9 years agoracy: ensure git_index_read_tree clears uptodate
Edward Thomson [Mon, 16 Nov 2015 23:05:46 +0000 (18:05 -0500)]
racy: ensure git_index_read_tree clears uptodate

Ensure that `git_index_read_tree` clears the uptodate bit on files
that it modifies.

9 years agoindex: clear uptodate bit on save
Edward Thomson [Fri, 13 Nov 2015 21:31:51 +0000 (16:31 -0500)]
index: clear uptodate bit on save

The uptodate bit should have a lifecycle of a single read->write
on the index.  Once the index is written, the files within it should
be scanned for racy timestamps against the new index timestamp.

9 years agoindex: test for smudged entries on write only
Edward Thomson [Fri, 13 Nov 2015 21:30:39 +0000 (16:30 -0500)]
index: test for smudged entries on write only

Test that entries are only smudged when we write the index: the
entry smudging is to prevent us from updating an index in a way
that it would be impossible to tell that an item was racy.
Consider when we load an index:  any entries that have the same
(or newer) timestamp than the index itself are considered racy,
and are subject to further scrutiny.

If we *save* that index with the same entries that we loaded,
then the index would now have a newer timestamp than the entries,
and they would no longer be given that additional scrutiny, failing
our racy detection!  So test that we smudge those entries only on
writing the new index, but that we can detect them (in diff) without
having to write.

9 years agocheckout::crlf test: don't crash when no idx entry
Edward Thomson [Fri, 13 Nov 2015 20:36:45 +0000 (15:36 -0500)]
checkout::crlf test: don't crash when no idx entry

When there's no matching index entry (for whatever reason), don't
try to dereference the null return value to get at the id.

Otherwise when we break something in the index API, the checkout
test crashes for confusing reasons and causes us to step through
it in a debugger thinking that we had broken much more than we
actually did.

9 years agoindex: don't detect raciness in uptodate entries
Edward Thomson [Fri, 13 Nov 2015 20:32:48 +0000 (15:32 -0500)]
index: don't detect raciness in uptodate entries

Keep track of entries that we believe are up-to-date, because we
added the index entries since the index was loaded.  This prevents
us from unnecessarily examining files that we wrote during the
cleanup of racy entries (when we smudge racily clean files that have
a timestamp newer than or equal to the index's timestamp when we
read it).  Without keeping track of this, we would examine every
file that we just checked out for raciness, since all their timestamps
would be newer than the index's timestamp.

9 years agoracy-git: do a single index->workdir diff
Edward Thomson [Fri, 6 Nov 2015 22:15:35 +0000 (17:15 -0500)]
racy-git: do a single index->workdir diff

When examining paths that are racily clean, do a single index->workdir
diff over the entirety of the racily clean files, instead of a diff
per file.

9 years agoMerge pull request #3506 from libgit2/vmg/pool-align
Carlos Martín Nieto [Fri, 13 Nov 2015 04:41:18 +0000 (05:41 +0100)]
Merge pull request #3506 from libgit2/vmg/pool-align

pool: Never return unaligned buffers

9 years agopool: Never return unaligned buffers
Vicent Marti [Thu, 12 Nov 2015 19:51:01 +0000 (20:51 +0100)]
pool: Never return unaligned buffers

9 years agoMerge pull request #3170 from CmdrMoozy/nsec_fix
Carlos Martín Nieto [Thu, 12 Nov 2015 18:53:09 +0000 (19:53 +0100)]
Merge pull request #3170 from CmdrMoozy/nsec_fix

git_index_entry__init_from_stat: set nsec fields in entry stats

9 years agoMerge pull request #3499 from ethomson/ref_dir_errmsgs
Carlos Martín Nieto [Thu, 12 Nov 2015 18:22:31 +0000 (19:22 +0100)]
Merge pull request #3499 from ethomson/ref_dir_errmsgs

Improve error messages when dirs prevent ref/reflog creation

9 years agoMerge pull request #3448 from libgit2/cmn/custom-agent
Carlos Martín Nieto [Thu, 12 Nov 2015 18:20:36 +0000 (19:20 +0100)]
Merge pull request #3448 from libgit2/cmn/custom-agent

Support setting custom user-agent

9 years agoCHANGELOG: add note about custom user-agent
Carlos Martín Nieto [Thu, 12 Nov 2015 16:20:30 +0000 (17:20 +0100)]
CHANGELOG: add note about custom user-agent

9 years agowinhttp: use a custom user-agent if the user has set it
Carlos Martín Nieto [Fri, 2 Oct 2015 01:57:14 +0000 (03:57 +0200)]
winhttp: use a custom user-agent if the user has set it

We also keep the "git/1.0" prefix in order to maintain compatibility
with hosters.

9 years agohttp: use a custom user-agent if the user has set it
Carlos Martín Nieto [Fri, 2 Oct 2015 01:46:34 +0000 (03:46 +0200)]
http: use a custom user-agent if the user has set it

We still prefix it with "git/1.0" since that's required in many
situations, but we replace the area which mentions libgit2.

9 years agosettings: add a setter for a custom user-agent
Carlos Martín Nieto [Fri, 2 Oct 2015 01:43:11 +0000 (03:43 +0200)]
settings: add a setter for a custom user-agent

9 years agoMerge pull request #2534 from libgit2/ntk/case_index_conflicts
Edward Thomson [Thu, 12 Nov 2015 15:13:11 +0000 (10:13 -0500)]
Merge pull request #2534 from libgit2/ntk/case_index_conflicts

Failing test for case sensitive conflicts in the index

9 years agoreflog: error when a directory is at reflog path
Edward Thomson [Tue, 3 Nov 2015 22:34:54 +0000 (17:34 -0500)]
reflog: error when a directory is at reflog path

When a non-empty directory exists and prevents the creation of a
reflog, provide a more informative error message.

9 years agorefs: complain when a directory exists at ref
Edward Thomson [Tue, 3 Nov 2015 22:18:00 +0000 (17:18 -0500)]
refs: complain when a directory exists at ref

When a (non-empty) directory exists at the reference target
location, complain with a more actionable error message.

9 years agoindex: overwrite the path when inserting conflicts
Carlos Martín Nieto [Thu, 12 Nov 2015 10:54:06 +0000 (11:54 +0100)]
index: overwrite the path when inserting conflicts

When we insert a conflict in a case-insensitive index, accept the
new entry's path as the correct case instead of leaving the path we
already had.

This puts `git_index_conflict_add()` on the same level as
`git_index_add()` in this respect.

9 years agoindex: correctly report which conflict stage has a wrong filemode
Carlos Martín Nieto [Tue, 10 Nov 2015 23:36:15 +0000 (00:36 +0100)]
index: correctly report which conflict stage has a wrong filemode

When we're at offset 'i', we're dealing with the 'i+1' stage, since
conflicts start at 1.

9 years agoFailing test for case sensitive conflicts in the index
nulltoken [Tue, 26 Aug 2014 11:51:37 +0000 (13:51 +0200)]
Failing test for case sensitive conflicts in the index

9 years agoMerge pull request #3498 from ethomson/windows_symlinks
Carlos Martín Nieto [Sun, 8 Nov 2015 04:10:18 +0000 (05:10 +0100)]
Merge pull request #3498 from ethomson/windows_symlinks

Diff: Honor `core.symlinks=false` and fake symlinks

9 years agoMerge pull request #3500 from ethomson/submodules_with_path
Carlos Martín Nieto [Sun, 8 Nov 2015 03:54:55 +0000 (04:54 +0100)]
Merge pull request #3500 from ethomson/submodules_with_path

Handle submodules with paths in `git_submodule_update`

9 years agosubmodule: reload HEAD/index after reading config
Edward Thomson [Wed, 4 Nov 2015 21:17:51 +0000 (16:17 -0500)]
submodule: reload HEAD/index after reading config

Reload the HEAD and index data for a submodule after reading the
configuration.  The configuration may specify a `path`, so we must
update HEAD and index data with that path in mind.

9 years agosubmodule: test updating a submodule w/ a path
Edward Thomson [Wed, 4 Nov 2015 21:16:51 +0000 (16:16 -0500)]
submodule: test updating a submodule w/ a path

Test that `git_submodule_update` can handle a submodule that is
freshly cloned and has a path differing from its name.

9 years agoMerge pull request #3465 from libgit2/cmn/tls-register
Edward Thomson [Wed, 4 Nov 2015 19:16:24 +0000 (14:16 -0500)]
Merge pull request #3465 from libgit2/cmn/tls-register

stream: allow registering a user-provided TLS constructor

9 years agoMerge branch 'pr/3487'
Edward Thomson [Tue, 3 Nov 2015 22:52:21 +0000 (17:52 -0500)]
Merge branch 'pr/3487'

9 years agoFix git_commit_summary to convert newlines to spaces even after
Stjepan Rajko [Fri, 9 Oct 2015 17:41:06 +0000 (10:41 -0700)]
Fix git_commit_summary to convert newlines to spaces even after
whitespace.  Collapse spaces around newlines for the summary.

9 years agofilebuf: detect directories in our way
Edward Thomson [Tue, 3 Nov 2015 22:02:07 +0000 (17:02 -0500)]
filebuf: detect directories in our way

When creating a filebuf, detect a directory that exists in our
target file location.  This prevents a failure later, when we try
to move the lock file to the destination.

9 years agoreflog: test reflog is deleted when ref is deleted
Edward Thomson [Tue, 3 Nov 2015 19:48:31 +0000 (14:48 -0500)]
reflog: test reflog is deleted when ref is deleted

9 years agoindex: test that add_bypath preserves symlinks
Edward Thomson [Tue, 3 Nov 2015 16:27:31 +0000 (11:27 -0500)]
index: test that add_bypath preserves symlinks

Test that on platforms without `core.symlinks`, we preserve symlinks
in `git_index_add_bypath`.  (Users should correct the actual index
entry's mode to change a link to a regular file.)

9 years agodiff: on win32, treat fake "symlinks" specially
Edward Thomson [Tue, 3 Nov 2015 14:43:18 +0000 (09:43 -0500)]
diff: on win32, treat fake "symlinks" specially

On platforms that lack `core.symlinks`, we should not go looking for
symbolic links and `p_readlink` their target.  Instead, we should
examine the file's contents.

9 years agodiff: test "symlinks" in wd are respected on win32
Edward Thomson [Tue, 3 Nov 2015 14:40:30 +0000 (09:40 -0500)]
diff: test "symlinks" in wd are respected on win32

When `core.symlinks = false`, we write the symlinks content (target)
to a regular file.  We should ensure that when we later see that
regular file, we treat it specially - and that changing that regular
file would actually change the symlink target.  (For compatibility
with Git for Windows).

9 years agoMerge pull request #3494 from leoyanggit/fix_unit_test_build
Carlos Martín Nieto [Tue, 3 Nov 2015 16:13:41 +0000 (08:13 -0800)]
Merge pull request #3494 from leoyanggit/fix_unit_test_build

Fix build for unit test

9 years agostream: allow registering a user-provided TLS constructor
Carlos Martín Nieto [Tue, 13 Oct 2015 09:25:41 +0000 (11:25 +0200)]
stream: allow registering a user-provided TLS constructor

This allows the application to use their own TLS stream, regardless of
the capabilities of libgit2 itself.

9 years agostream: accept NULL in the free function
Carlos Martín Nieto [Tue, 13 Oct 2015 17:34:07 +0000 (19:34 +0200)]
stream: accept NULL in the free function

9 years agoMerge branch 'pr/3147'
Edward Thomson [Mon, 2 Nov 2015 21:36:28 +0000 (16:36 -0500)]
Merge branch 'pr/3147'

9 years agoAdd diff progress callback.
Jason Haslam [Thu, 16 Jul 2015 16:17:16 +0000 (10:17 -0600)]
Add diff progress callback.

9 years agoFix build for unit test
Leo Yang [Fri, 30 Oct 2015 17:53:53 +0000 (13:53 -0400)]
Fix build for unit test

If none of GIT_OPENSSL, GIT_WINHTTP or GIT_SECURE_TRANSPORT
is defined we should also be able to build the unit test.

9 years agoMerge pull request #3491 from libgit2/cmn/config-checksum
Edward Thomson [Mon, 2 Nov 2015 20:09:19 +0000 (15:09 -0500)]
Merge pull request #3491 from libgit2/cmn/config-checksum

Use checksums to detect config file changes

9 years agoMerge pull request #3495 from leoyanggit/fix_transport_build
Edward Thomson [Mon, 2 Nov 2015 20:04:26 +0000 (15:04 -0500)]
Merge pull request #3495 from leoyanggit/fix_transport_build

Fix build for custom transport users

9 years agoMerge pull request #3492 from libgit2/vmg/redundant
Vicent Marti [Mon, 2 Nov 2015 13:27:10 +0000 (14:27 +0100)]
Merge pull request #3492 from libgit2/vmg/redundant

merge-base: Remove redundant merge bases

9 years agomerge: Fix memory leak in test
Vicent Marti [Mon, 2 Nov 2015 11:06:50 +0000 (12:06 +0100)]
merge: Fix memory leak in test

9 years agoAdd test case
Vicent Marti [Fri, 30 Oct 2015 17:32:34 +0000 (18:32 +0100)]
Add test case

9 years agomerge-base: Style
Vicent Marti [Fri, 30 Oct 2015 13:02:01 +0000 (14:02 +0100)]
merge-base: Style

9 years agomerge-base: Do not read parents from the root
Vicent Marti [Fri, 30 Oct 2015 10:50:43 +0000 (11:50 +0100)]
merge-base: Do not read parents from the root

9 years agomerge-base: Remove redundant merge bases
Vicent Marti [Fri, 30 Oct 2015 10:45:52 +0000 (11:45 +0100)]
merge-base: Remove redundant merge bases

9 years agofilebuf: use an internal buffer
Carlos Martín Nieto [Fri, 30 Oct 2015 20:36:51 +0000 (21:36 +0100)]
filebuf: use an internal buffer

This reduces the chances of a crash in the thread tests. This shouldn't
affect general usage too much, since the main usage of these functions
are to read into an empty buffer.

9 years agofilebuf: use a checksum to detect file changes
Carlos Martín Nieto [Thu, 29 Oct 2015 20:12:37 +0000 (21:12 +0100)]
filebuf: use a checksum to detect file changes

Instead of relying on the size and timestamp, which can hide changes
performed in the same second, hash the file content's when we care about
detecting changes.

9 years agoconfig: add failing test for an external modification
Carlos Martín Nieto [Thu, 29 Oct 2015 19:31:25 +0000 (20:31 +0100)]
config: add failing test for an external modification

We currently use the timestamp in order to decide whether a config file
has changed since we last read it.

This scheme falls down if the file is written twice within the same
second, as we fail to detect the file change after the first read in
that second.

9 years agoMerge pull request #3493 from ethomson/read_index
Carlos Martín Nieto [Fri, 30 Oct 2015 18:36:16 +0000 (19:36 +0100)]
Merge pull request #3493 from ethomson/read_index

index: read_index must update hashes

9 years agoFix build for custom transport users
Leo Yang [Fri, 30 Oct 2015 18:12:19 +0000 (14:12 -0400)]
Fix build for custom transport users

We should explicitly include the declaration of git_strarray
from "include/git2/sys/transport.h"

9 years agogit: put NULL check at the top
Carlos Martín Nieto [Fri, 30 Oct 2015 17:23:17 +0000 (18:23 +0100)]
git: put NULL check at the top

9 years agoindex: read_index must update hashes
Edward Thomson [Fri, 30 Oct 2015 17:07:02 +0000 (13:07 -0400)]
index: read_index must update hashes

9 years agogit: accept NULL as argument to its stream free
Carlos Martín Nieto [Fri, 30 Oct 2015 16:51:50 +0000 (17:51 +0100)]
git: accept NULL as argument to its stream free

9 years agoMerge pull request #3486 from srajko/reflog-segfault-fix
Carlos Martín Nieto [Thu, 29 Oct 2015 19:37:48 +0000 (20:37 +0100)]
Merge pull request #3486 from srajko/reflog-segfault-fix

Fix segfault when reading reflog with extra newlines

9 years agoPrevent segfault when parsing a reflog with oid parse error
Stjepan Rajko [Mon, 26 Oct 2015 22:33:00 +0000 (15:33 -0700)]
Prevent segfault when parsing a reflog with oid parse error

Using calloc instead of malloc because the parse error will lead to an immediate free of committer (and its properties, which can segfault on free if undefined - test_refs_reflog_reflog__reading_a_reflog_with_invalid_format_returns_error segfaulted before the fix).

#3458

9 years agopool: fix documentation
Edward Thomson [Wed, 28 Oct 2015 14:53:03 +0000 (10:53 -0400)]
pool: fix documentation

9 years agoMerge pull request #3488 from libgit2/vmg/pool
Vicent Marti [Wed, 28 Oct 2015 14:34:16 +0000 (15:34 +0100)]
Merge pull request #3488 from libgit2/vmg/pool

pool: Simplify implementation

9 years agomerge: Do not mallocz unecessary entries
Vicent Marti [Wed, 28 Oct 2015 13:49:28 +0000 (14:49 +0100)]
merge: Do not mallocz unecessary entries

9 years agopool: update comment
Vicent Marti [Wed, 28 Oct 2015 13:31:09 +0000 (14:31 +0100)]
pool: update comment

9 years agopool: Dot not assume mallocs are zeroed out
Vicent Marti [Wed, 28 Oct 2015 09:50:25 +0000 (10:50 +0100)]
pool: Dot not assume mallocs are zeroed out

9 years agopool: Handle 32 bit systems
Vicent Marti [Wed, 28 Oct 2015 09:29:00 +0000 (10:29 +0100)]
pool: Handle 32 bit systems

9 years agopool: Take into account malloc overhead & pool page size
Vicent Marti [Wed, 28 Oct 2015 09:28:43 +0000 (10:28 +0100)]
pool: Take into account malloc overhead & pool page size

9 years agorepository: plug memory leak
Vicent Marti [Wed, 28 Oct 2015 09:15:24 +0000 (10:15 +0100)]
repository: plug memory leak

cc @carlosmn

9 years agopool: Simplify implementation
Vicent Marti [Tue, 27 Oct 2015 16:26:04 +0000 (17:26 +0100)]
pool: Simplify implementation

9 years agoMerge pull request #3489 from libgit2/vmg/reuc-insert
Vicent Marti [Wed, 28 Oct 2015 08:55:20 +0000 (09:55 +0100)]
Merge pull request #3489 from libgit2/vmg/reuc-insert

Better REUC generation when merging

9 years agomerge: Plug memory leak
Vicent Marti [Tue, 27 Oct 2015 21:42:40 +0000 (22:42 +0100)]
merge: Plug memory leak

9 years agomerge: Implement `GIT_MERGE_TREE_SKIP_REUC`
Vicent Marti [Tue, 27 Oct 2015 21:42:15 +0000 (22:42 +0100)]
merge: Implement `GIT_MERGE_TREE_SKIP_REUC`

9 years agoreuc: Be smarter when inserting new REUC entries
Vicent Marti [Tue, 27 Oct 2015 21:17:32 +0000 (22:17 +0100)]
reuc: Be smarter when inserting new REUC entries

Inserting new REUC entries can quickly become pathological given that
each insert unsorts the REUC vector, and both subsequent lookups *and*
insertions will require sorting it again before being successful.

To avoid this, we're switching to `git_vector_insert_sorted`: this keeps
the REUC vector constantly sorted and lets us use the `on_dup` callback
to skip an extra binary search on each insertion.

9 years agoMerge pull request #3485 from srajko/giterr_clear-typo-fix
Carlos Martín Nieto [Mon, 26 Oct 2015 20:13:54 +0000 (21:13 +0100)]
Merge pull request #3485 from srajko/giterr_clear-typo-fix

Fix docs typo geterr_clear -> giterr_clear

9 years agoFix docs typo geterr_clear -> giterr_clear
Stjepan Rajko [Wed, 14 Oct 2015 16:41:27 +0000 (09:41 -0700)]
Fix docs typo geterr_clear -> giterr_clear

9 years agoMerge pull request #3477 from linquize/inttypes.h
Edward Thomson [Fri, 23 Oct 2015 15:13:14 +0000 (10:13 -0500)]
Merge pull request #3477 from linquize/inttypes.h

inttypes.h is built-in header file since MSVC 2013

9 years agoMerge pull request #3483 from ethomson/cmake_xcode
Carlos Martín Nieto [Fri, 23 Oct 2015 13:16:21 +0000 (15:16 +0200)]
Merge pull request #3483 from ethomson/cmake_xcode

cmake: split sources into original paths for Xcode and MSVC

9 years agoMerge pull request #3481 from ethomson/xdiff_include
Carlos Martín Nieto [Fri, 23 Oct 2015 13:13:38 +0000 (15:13 +0200)]
Merge pull request #3481 from ethomson/xdiff_include

xdiff: reference util.h in parent directory

9 years agoMerge pull request #3482 from ethomson/merge_fail_on_conflict
Vicent Marti [Fri, 23 Oct 2015 11:37:02 +0000 (13:37 +0200)]
Merge pull request #3482 from ethomson/merge_fail_on_conflict

merge: add GIT_MERGE_TREE_FAIL_ON_CONFLICT

9 years agocmake: split sources into original paths for Xcode and MSVC
Edward Thomson [Fri, 23 Oct 2015 01:17:19 +0000 (20:17 -0500)]
cmake: split sources into original paths for Xcode and MSVC

The MSVC_SPLIT_SOURCES function is helpful for other IDEs, like Xcode,
and will split the source files up into their target directories,
instead of merely placing them all in a "Sources" directory.

Rename MSVC_SPLIT_SOURCES to IDE_SPLIT_SOURCES and enable it for Xcode.

9 years agomerge: add GIT_MERGE_TREE_FAIL_ON_CONFLICT
Edward Thomson [Thu, 22 Oct 2015 18:39:20 +0000 (14:39 -0400)]
merge: add GIT_MERGE_TREE_FAIL_ON_CONFLICT

Provide a new merge option, GIT_MERGE_TREE_FAIL_ON_CONFLICT, which
will stop on the first conflict and fail the merge operation with
GIT_EMERGECONFLICT.

9 years agoMerge pull request #3480 from ethomson/nsecs
Carlos Martín Nieto [Thu, 22 Oct 2015 16:35:43 +0000 (18:35 +0200)]
Merge pull request #3480 from ethomson/nsecs

Nanoseconds in the index: ignore for diffing

9 years agoxdiff: reference util.h in parent directory
Edward Thomson [Thu, 22 Oct 2015 14:29:51 +0000 (10:29 -0400)]
xdiff: reference util.h in parent directory

Although CMake will correctly configure include directories for us,
some people may use their own build system, and we should reference
`util.h` based on where it actually lives.

9 years agodiff: ignore nsecs when diffing
Edward Thomson [Thu, 22 Oct 2015 13:30:41 +0000 (09:30 -0400)]
diff: ignore nsecs when diffing

Although our index contains the literal time present in the index,
we do not read nanoseconds from disk, and thus we should not use
them in any comparisons, lest we always think our working directory
is dirty.

Guard this behind a `GIT_USE_NSECS` for future improvement.

9 years agoindex: test that we round-trip nsecs
Edward Thomson [Thu, 22 Oct 2015 13:29:40 +0000 (09:29 -0400)]
index: test that we round-trip nsecs

Test that nanoseconds are round-tripped correctly when we read
an index file that contains them.  We should, however, ignore them
because we don't understand them, and any new entries in the index
should contain a `0` nsecs field, while existing preserving entries.

9 years agointtypes.h is built-in header file since MSVC 2013
Linquize [Wed, 21 Oct 2015 23:56:34 +0000 (07:56 +0800)]
inttypes.h is built-in header file since MSVC 2013

The reason is that the types defined in libgit2's inttypes.h collide with system inttypes.h
3rd party library header files may directly reference MSVC's built-in inttypes.h

Fixes #3476

9 years agoMerge pull request #3475 from libgit2/cmn/programdata-config
Edward Thomson [Wed, 21 Oct 2015 20:43:22 +0000 (13:43 -0700)]
Merge pull request #3475 from libgit2/cmn/programdata-config

config: add a ProgramData level

9 years agoMerge pull request #3479 from ethomson/cplusplus
Carlos Martín Nieto [Wed, 21 Oct 2015 18:36:38 +0000 (20:36 +0200)]
Merge pull request #3479 from ethomson/cplusplus

api: be explicit about our C linkage