summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* refs: explicitly catch leading slashesCarlos Martín Nieto2013-03-071-0/+3
| | | | | | | | | | 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().
* added missing free for git_note in clar testsNico von Geyso2013-03-061-1/+1
|
* fixed minor issues with new note iteratorNico von Geyso2013-03-062-51/+37
| | | | | * fixed style issues * use new iterator functions for git_note_foreach()
* use git_note_iterator type instead of non-public git_iterator oneNico von Geyso2013-03-061-4/+13
|
* basic note iterator implementationNico von Geyso2013-03-062-9/+62
| | | | | * git_note_iterator_new() - create a new note iterator * git_note_next() - retrieves the next item of the iterator
* Merge pull request #1369 from arrbee/repo-init-template-hooksVicent Martí2013-03-055-88/+184
|\ | | | | More tests (and fixes) for initializing repo from template
| * Make mode handling during init more like gitRussell Belfer2013-02-274-26/+31
| | | | | | | | | | | | | | | | | | | | | | 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.)
| * Fix portability issues on WindowsRussell Belfer2013-02-262-5/+11
| | | | | | | | | | | | The new tests were not taking core.filemode into account when testing file modes after repo initialization. Fixed that and some other Windows warnings that have crept in.
| * Fix initialization of repo directoriesRussell Belfer2013-02-263-74/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When PR #1359 removed the hooks from the test resources/template directory, it made me realize that the tests for git_repository_init_ext using templates must be pretty shabby because we could not have been testing if the hooks were getting created correctly. So, this started with me recreating a couple of hooks, including a sample and symlink, and adding tests that they got created correctly in the various circumstances, including with the SHARED modes, etc. Unfortunately this uncovered some issues with how directories and symlinks were copied and chmod'ed. Also, there was a FIXME in the code related to the chmod behavior as well. Going back over the directory creation logic for setting up a repository, I found it was a little difficult to read and could result in creating and/or chmod'ing directories that the user almost certainly didn't intend. So that let to this work which makes repo initialization much more careful (and hopefully easier to follow). It required a couple of extensions / changes to core fileops utilities, but I also think those are for the better, at least for git_futils_cp_r in terms of being careful about what actions it takes.
* | Merge pull request #1380 from phkelley/index_icaseVicent Martí2013-03-043-3/+21
|\ \ | | | | | | Disable ignore_case when writing the index to a tree
| * | Rename function to __ prefixPhilip Kelley2013-03-013-6/+6
| | |
| * | Disable ignore_case when writing the index to a treePhilip Kelley2013-03-013-3/+21
| | |
* | | clear REUC on checkoutEdward Thomson2013-03-042-19/+21
| | |
* | | Fix a few leaksCarlos Martín Nieto2013-03-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | `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.
* | | indexer: use a hashtable for keeping track of offsetsCarlos Martín Nieto2013-03-034-26/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | indexer: kill git_indexerCarlos Martín Nieto2013-03-031-327/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Allow empty config object and use itRussell Belfer2013-03-011-6/+0
|/ / | | | | | | | | | | | | 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.
* | Clone should not delete directories it did not createJameson Miller2013-03-013-2/+54
| |
* | Merge pull request #1373 from arrbee/why-cdecl-whyVicent Martí2013-02-284-12/+22
|\ \ | | | | | | Why cdecl why?
| * | Fix some deprecation warnings on WindowsRussell Belfer2013-02-283-4/+10
| | | | | | | | | | | | | | | This fixes some snprintf and vsnprintf related deprecation warnings we've been having on Windows with recent compilers.
| * | Add GIT_STDLIB_CALLRussell Belfer2013-02-283-10/+7
| | | | | | | | | | | | | | | | | | 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.
| * | fixing some warnings on WindowsRussell Belfer2013-02-271-5/+5
| | |
| * | use cdecl for hashsig sorting functions on WindowsRussell Belfer2013-02-271-3/+10
| | |
* | | w32-posix: Wrap the `timezone` declaration with a clauseVicent Marti2013-02-281-0/+3
|/ / | | | | | | Allows compilation in newer versions of MinGW that already defined it.
* | Merge pull request #1233 from arrbee/file-similarity-metricVicent Martí2013-02-277-167/+817
|\ \ | | | | | | Add file similarity scoring to diff rename/copy detection
| * | Minor improvements to find_similar codeRussell Belfer2013-02-221-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves a couple of checks outside of the inner loop of the find_similar rename/copy detection phase that are only dependent on the "from" side of a detection. Also, this replaces the inefficient initialization of the options structure when a value is not provided explicitly by the user.
| * | Replace static data with configured metricRussell Belfer2013-02-221-42/+29
| | | | | | | | | | | | | | | | | | | | | | | | Instead of creating three git_diff_similarity_metric statically for the various config options, just create the metric structure on demand and populate it, using the payload to specific the extra flags that should be passed to the hashsig. This removes a level of obfuscation from the code, I think.
| * | Add diff rename tests with partial similarityRussell Belfer2013-02-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds some new tests that actually exercise the similarity metric between files to detect renames, copies, and split modified files that are too heavily modified. There is still more testing to do - these tests are just partially covering the cases. There is also one bug fix in this where a change set with only MODIFY being broken into ADD/DELETE (due to low self-similarity) without any additional RENAMED entries would end up not processing the split requests (because the num_rewrites counter got reset).
| * | Initial integration of similarity metric to diffRussell Belfer2013-02-212-69/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the initial integration of the similarity metric into the `git_diff_find_similar()` code path. The existing tests all pass, but the new functionality isn't currently well tested. The integration does go through the pluggable metric interface, so it should be possible to drop in an alternative to the internal metric that libgit2 implements. This comes along with a behavior change for an existing interface; namely, passing two NULLs to git_diff_blobs (or passing NULLs to git_diff_blob_to_buffer) will now call the file_cb parameter zero times instead of one time. I know it's strange that that change is paired with this other change, but it emerged from some initialization changes that I ended up making.
| * | Replace diff delta binary with flagsRussell Belfer2013-02-205-90/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the git_diff_delta recorded if the delta was binary. This replaces that (with no net change in structure size) with a full set of flags. The flag values that were already in use for individual git_diff_file objects are reused for the delta flags, too (along with renaming those flags to make it clear that they are used more generally). This (a) makes things somewhat more consistent (because I was using a -1 value in the "boolean" binary field to indicate unset, whereas now I can just use the flags that are easier to understand), and (b) will make it easier for me to add some additional flags to the delta object in the future, such as marking the results of a copy/rename detection or other deltas that might want a special indicator. While making this change, I officially moved some of the flags that were internal only into the private diff header. This also allowed me to remove a gross hack in rename/copy detect code where I was overwriting the status field with an internal value.
| * | Refine pluggable similarity APIRussell Belfer2013-02-203-4/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This plugs in the three basic similarity strategies for handling whitespace via internal use of the pluggable API. In so doing, I realized that the use of git_buf in the hashsig API was not needed and actually just made it harder to use, so I tweaked that API as well. Note that the similarity metric is still not hooked up in the find_similarity code - this is just setting out the function that will be used.
| * | Change similarity metric to sampled hashesRussell Belfer2013-02-205-410/+438
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the similarity metric code out of buf_text and into a new file. Also, this implements a different approach to similarity measurement based on a Rabin-Karp rolling hash where we only keep the top 100 and bottom 100 hashes. In theory, that should be sufficient samples to given a fairly accurate measurement while limiting the amount of data we keep for file signatures no matter how large the file is.
| * | wip: adding metric to diffRussell Belfer2013-02-201-2/+8
| | |
| * | Some similarity metric adjustmentsRussell Belfer2013-02-201-11/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the text similarity metric treat \r as equivalent to \n and makes it skip whitespace immediately following a line terminator, so line indentation will have less effect on the difference measurement (and so \r\n will be treated as just a single line terminator). This also separates the text and binary hash calculators into two separate functions instead of have more if statements inside the loop. This should make it easier to have more differentiated heuristics in the future if we so wish.
| * | Initial implementation of similarity scoring algoRussell Belfer2013-02-202-0/+350
| | | | | | | | | | | | | | | | | | | | | This adds a new `git_buf_text_hashsig` type and functions to generate these hash signatures and compare them to give a similarity score. This can be plugged into diff similarity scoring.
* | | Merge pull request #1372 from ethomson/checkout_workdir_endRussell Belfer2013-02-271-2/+4
|\ \ \ | | | | | | | | don't dereference at the end of the workdir iterator
| * | | don't dereference at the end of the workdir iteratorEdward Thomson2013-02-271-2/+4
| | | |
* | | | Win32: Use constants in version resource definitions where possibleSven Strickroth2013-02-271-2/+2
|/ / / | | | | | | | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | | Increment reference counter in git_repository_set_configSascha Cunz2013-02-261-0/+1
| | | | | | | | | | | | This fixes #1365
* | | Revert "hash: remove git_hash_init from internal api"Michael Schubert2013-02-264-3/+5
| | | | | | | | | | | | | | | This reverts commit efe7fad6c96a3d6197a218aeaa561ec676794499, except for the indentation fixes.
* | | hash: remove git_hash_init from internal apiMichael Schubert2013-02-264-6/+4
| |/ |/| | | | | Along with that, fix indentation in tests-clar/object/raw/hash.c
* | Merge pull request #1355 from phkelley/developmentVicent Martí2013-02-232-14/+33
|\ \ | | | | | | Portability fixes for Solaris
| * | Portability fixes for SolarisPhilip Kelley2013-02-222-14/+33
| | |
* | | Do not fail if .gitignore is directoryRussell Belfer2013-02-221-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | This is designed to fix libgit2sharp #350 where if .gitignore is a directory we abort all operations that process ignores instead of just skipping it as core git does. Also added test that fails without this change and passes with it.
* | | Merge pull request #1343 from nulltoken/topic/remote_orphaned_branchVicent Martí2013-02-223-7/+13
|\ \ \ | | | | | | | | Teach git_branch_remote_name() to work with orphaned heads
| * | | branch: Make git_branch_remote_name() cope with orphaned headsnulltoken2013-02-223-7/+13
| |/ /
* | | stash: Update the reference when dropping the topmost stashnulltoken2013-02-221-0/+6
|/ /
* | add a sorter to the reuc on index creationEdward Thomson2013-02-211-1/+2
|/
* Merge pull request #1350 from arrbee/fix-1292Vicent Martí2013-02-202-57/+57
|\ | | | | Add explicit entrycount to tree builder
| * Some code cleanups in tree.cRussell Belfer2013-02-201-54/+44
| | | | | | | | | | | | | | This replaces most of the explicit vector iteration with calls to git_vector_foreach, adds in some git__free and giterr_clear calls to clean up during some error paths, and a couple of other code simplifications.