Commit Graph

4488 Commits

Author SHA1 Message Date
Edward Thomson
d00d54645d immutable references and a pluggable ref database 2013-03-07 11:01:52 -06:00
Vicent Martí
6a9ef01237 Merge pull request #1401 from carlosmn/leading-slash
refs: explicitly catch leading slashes
2013-03-07 07:47:20 -08:00
Carlos Martín Nieto
bb45c57f94 refs: explicitly catch leading slashes
It's somewhat common to try to write "/refs/tags/something". There is
no easy way to catch it during the main body of the function, as there
is no way to distinguish whether it's a leading slash or a double
slash somewhere in the middle.

Catch this at the beginning so we don't trigger the assert in
is_all_caps_and_underscore().
2013-03-07 16:38:44 +01:00
Nathan Osman
e7da9acdcd Added build option SONAME to control whether VERSION and SOVERSION were set for the git2 target, as some platforms require that this NOT be set. 2013-03-06 17:51:38 -08:00
Russell Belfer
9bea03ce77 Add INCLUDE_TREES, DONT_AUTOEXPAND iterator flags
This standardizes iterator behavior across all three iterators
(index, tree, and working directory).  Previously the working
directory iterator behaved differently from the other two.

Each iterator can now operate in one of three modes:

1. *No tree results, auto expand trees* means that only non-
   tree items will be returned and when a tree/directory is
   encountered, we will automatically descend into it.
2. *Tree results, auto expand trees* means that results will
   be given for every item found, including trees, but you
   only need to call normal git_iterator_advance to yield
   every item (i.e. trees returned with pre-order iteration).
3. *Tree results, no auto expand* means that calling the
   normal git_iterator_advance when looking at a tree will
   not descend into the tree, but will skip over it to the
   next entry in the parent.

Previously, behavior 1 was the only option for index and tree
iterators, and behavior 3 was the only option for workdir.

The main public API implications of this are that the
`git_iterator_advance_into()` call is now valid for all
iterators, not just working directory iterators, and all the
existing uses of working directory iterators explicitly use
the GIT_ITERATOR_DONT_AUTOEXPAND (for now).

Interestingly, the majority of the implementation was in the
index iterator, since there are no tree entries there and now
have to fake them.  The tree and working directory iterators
only required small modifications.
2013-03-06 16:52:01 -08:00
Russell Belfer
cc216a01ee Retire spoolandsort iterator
Since the case sensitivity is moved into the respective iterators,
this removes the spoolandsort iterator code.
2013-03-06 16:52:01 -08:00
Russell Belfer
169dc61607 Make iterator APIs consistent with standards
The iterator APIs are not currently consistent with the parameter
ordering of the rest of the codebase.  This rearranges the order
of parameters, simplifies the naming of a number of functions, and
makes somewhat better use of macros internally to clean up the
iterator code.

This also expands the test coverage of iterator functionality,
making sure that case sensitive range-limited iteration works
correctly.
2013-03-06 16:52:01 -08:00
Russell Belfer
ed4f95e5d9 Add const to some buffer functions 2013-03-06 16:44:53 -08:00
Russell Belfer
9952f24e6c No longer need clar_main.c 2013-03-06 16:02:26 -08:00
Russell Belfer
1b405a232f Merge pull request #1396 from cholin/features/note-iterator
[RFC] basic note iterator implementation
2013-03-06 13:58:21 -08:00
Nico von Geyso
aa518c709c added missing free for git_note in clar tests 2013-03-06 22:51:20 +01:00
Nico von Geyso
f7b1850215 fixed minor issues with new note iterator
* fixed style issues
* use new iterator functions for git_note_foreach()
2013-03-06 22:36:19 +01:00
Philip Kelley
69c28b75df MSVC: Define NDEBUG to disable asserts in release builds 2013-03-06 13:22:50 -05:00
Nico von Geyso
1a90dcf64e use git_note_iterator type instead of non-public git_iterator one 2013-03-06 19:07:56 +01:00
Nico von Geyso
6edb427b76 basic note iterator implementation
* git_note_iterator_new() - create a new note iterator
* git_note_next() - retrieves the next item of the iterator
2013-03-06 17:01:33 +01:00
Vicent Martí
d1bcc1a874 Merge pull request #1392 from ethomson/push_test_fix
remote push test fix
2013-03-06 03:05:10 -08:00
Edward Thomson
4cc326e9dd remote push test fix 2013-03-05 22:45:26 -06:00
Vicent Martí
b72f5d4038 Merge pull request #1369 from arrbee/repo-init-template-hooks
More tests (and fixes) for initializing repo from template
2013-03-05 15:35:28 -08:00
Carlos Martín Nieto
3d74702eec Make sure docurium can see git_packbuilder_foreach 2013-03-05 23:50:43 +01:00
Vicent Martí
b8daa9e0fc Merge pull request #1380 from phkelley/index_icase
Disable ignore_case when writing the index to a tree
2013-03-04 16:19:38 -08:00
Vicent Martí
f6d96409a8 Merge pull request #1390 from ethomson/reuc_clear
clear REUC on checkout
2013-03-04 16:13:31 -08:00
Edward Thomson
5bddabcca5 clear REUC on checkout 2013-03-04 18:10:57 -06:00
Carlos Martín Nieto
323bb88514 Fix a few leaks
`git_diff_get_patch()` would unconditionally load the patch object and
then simply leak it if the user hadn't requested it. Short-circuit
loading the object if the user doesn't want it.

The rest of the plugs are simply calling the free functions of objects
allocated during the tests.
2013-03-04 00:21:56 +01:00
Vicent Martí
dce5f26f4d Merge pull request #1388 from carlosmn/hash-ref-delta
indexer: use a hashtable for keeping track of offsets
2013-03-03 14:46:01 -08:00
Carlos Martín Nieto
0e040c031e indexer: use a hashtable for keeping track of offsets
These offsets are needed for REF_DELTA objects, which encode which
object they use as a base, but not where it lies in the packfile, so
we need a list.

These objects are mostly from older packfiles, before OFS_DELTA was
widely spread. The time spent in indexing these packfiles is greatly
reduced, though remains above what git is able to do.
2013-03-03 23:18:29 +01:00
Vicent Martí
29ab8774e5 Merge pull request #1387 from carlosmn/kill-indexer
indexer: kill git_indexer
2013-03-03 06:38:33 -08:00
Carlos Martín Nieto
447ae791e5 indexer: kill git_indexer
This was the first implementation and its goal was simply to have
something that worked. It is slow and now it's just taking up
space. Remove it and switch the one known usage to use the streaming
indexer.
2013-03-03 15:19:21 +01:00
Vicent Martí
bb19532c5f Merge pull request #1386 from arrbee/update-docs
Update contributing and conventions
2013-03-02 14:29:39 -08:00
Russell Belfer
a313de0d9e Fixed a couple typos 2013-03-02 13:58:05 -08:00
Russell Belfer
7bd53bf385 Simplify diff example using revparse
When the examples/diff.c was written, there was not yet a revparse
API.  Now we can use it to make command line parsing way better
with less code.  Yay!
2013-03-02 13:52:38 -08:00
Russell Belfer
1631147c19 Updates to CONTRIBUTING and CONVENTIONS
The discussion about converting some of our foreach-style APIs to
use iterator objects got me wanting to make a list of good starter
projects.  I put it in CONTRIBUTING.md and then went crazy with
updates to that file and to CONVENTIONS.md.
2013-03-02 13:51:31 -08:00
Vicent Martí
01be786319 Merge pull request #1382 from arrbee/fix-diff-patch-a-different-way
Allow empty config object and use it for tests
2013-03-01 14:28:47 -08:00
Russell Belfer
487fc724ff Allow empty config object and use it
This removes assertions that prevent us from having an empty
git_config object and then updates some tests that were
dependent on global config state to use an empty config before
running anything.
2013-03-01 13:41:53 -08:00
Philip Kelley
cb53669e14 Rename function to __ prefix 2013-03-01 16:38:13 -05:00
Philip Kelley
47f70846aa Merge pull request #1379 from arrbee/fix-tests-with-autocrlf-input-on-windows
Control for core.autocrlf during testing
2013-03-01 13:27:46 -08:00
Philip Kelley
3f0d0c85d0 Disable ignore_case when writing the index to a tree 2013-03-01 15:46:21 -05:00
Russell Belfer
7d46b34baf Control for core.autocrlf during testing 2013-03-01 12:26:05 -08:00
Vicent Martí
426b2e2fce Merge pull request #1378 from jamill/clone_no_delete
Clone should not clean up directories it did not create
2013-03-01 12:10:06 -08:00
Jameson Miller
926acbcf8e Clone should not delete directories it did not create 2013-03-01 14:56:09 -05:00
Vicent Martí
cc427158d4 Merge pull request #1373 from arrbee/why-cdecl-why
Why cdecl why?
2013-02-28 15:09:32 -08:00
Russell Belfer
f443a72d33 Fix some deprecation warnings on Windows
This fixes some snprintf and vsnprintf related deprecation
warnings we've been having on Windows with recent compilers.
2013-02-28 14:41:26 -08:00
Russell Belfer
97b7137459 Add GIT_STDLIB_CALL
This removes the one-off GIT_CDECL and adds a new standard way of
doing this named GIT_STDLIB_CALL with a src/win32 specific def
when on the Windows platform.
2013-02-28 14:14:45 -08:00
Vicent Marti
5fa8abb868 w32-posix: Wrap the timezone declaration with a clause
Allows compilation in newer versions of MinGW that already defined it.
2013-02-28 17:36:20 +01:00
Russell Belfer
f708c89fa6 fixing some warnings on Windows 2013-02-27 15:15:39 -08:00
Russell Belfer
11b5beb7ba use cdecl for hashsig sorting functions on Windows 2013-02-27 15:07:28 -08:00
Vicent Martí
e68e33f33d Merge pull request #1233 from arrbee/file-similarity-metric
Add file similarity scoring to diff rename/copy detection
2013-02-27 14:50:32 -08:00
Russell Belfer
9f9477d650 Merge pull request #1372 from ethomson/checkout_workdir_end
don't dereference at the end of the workdir iterator
2013-02-27 14:21:41 -08:00
Russell Belfer
18f0826408 Make mode handling during init more like git
When creating files, instead of actually using GIT_FILEMODE_BLOB
and the other various constants that happen to correspond to
mode values, apparently I should be just using 0666 and 0777, and
relying on the umask to clear bits and make the value sane.

This fixes the rules for copying a template directory and fixes
the checks to match that new behavior.  (Further changes to the
checkout logic to follow separately.)
2013-02-27 13:44:15 -08:00
Edward Thomson
395509ffcd don't dereference at the end of the workdir iterator 2013-02-27 15:35:52 -06:00
Vicent Martí
c493f8211f Merge pull request #1371 from csware/version-constants
Win32: Use constants in version resource definitions where possible
2013-02-27 11:01:16 -08:00