summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1627 from arrbee/iterator-api-improvementsvmg/full-ref-iteratorVicent Martí2013-05-3111-187/+329
|\ | | | | Make iterators use GIT_ITEROVER & smart advance
| * Make iterators use GIT_ITEROVER & smart advanceRussell Belfer2013-05-3111-187/+329
|/ | | | | | | | | | | | | | | 1. internal iterators now return GIT_ITEROVER when you go past the last item in the iteration. 2. git_iterator_advance will "advance" to the first item in the iteration if it is called immediately after creating the iterator, which allows a simpler idiom for basic iteration. 3. if git_iterator_advance encounters an error reading data (e.g. a missing tree or an unreadable file), it returns the error but also attempts to advance past the invalid data to prevent an infinite loop. Updated all tests and internal usage of iterators to account for these new behaviors.
* FreesVicent Marti2013-05-301-2/+2
|
* RefcountingVicent Marti2013-05-303-3/+8
|
* ...Aaaand this worksVicent Marti2013-05-3010-404/+194
|
* What are the chances, reallyVicent Marti2013-05-2911-448/+234
|
* Liike thisVicent Marti2013-05-2810-81/+90
|
* This refs iterator pleases the gods.Vicent Marti2013-05-281-78/+69
|
* Fixing unwrapped callocRussell Belfer2013-05-271-1/+1
|
* Merge pull request #1614 from schu/packbuilder-writeVicent Martí2013-05-272-25/+45
|\ | | | | packbuilder: also write index in git_packbuilder_write
| * packbuilder: also write index in git_packbuilder_writeMichael Schubert2013-05-272-25/+45
|/ | | | | | git_packbuilder_write() used to write a packfile to the passed file path. Instead, ask for a destination directory and create both the packfile and an index, as most users probably do expect.
* Merge pull request #1613 from schu/transport-sshVicent Martí2013-05-271-0/+2
|\ | | | | tests: don't verify SSH unsupported with GIT_SSH
| * tests: don't verify SSH unsupported with GIT_SSHMichael Schubert2013-05-271-0/+2
|/
* Merge pull request #1612 from drodriguez/fix-branch-delete-docsRussell Belfer2013-05-261-1/+2
|\ | | | | Fix documentation of git_branch_delete.
| * Fix documentation of git_branch_delete.Daniel Rodríguez Troitiño2013-05-261-1/+2
|/ | | | The reference should be freed by the user, not the library.
* Merge pull request #1609 from ethomson/qsort_r_glibcVicent Martí2013-05-251-1/+2
|\ | | | | qsort_r appeared in glibc 2.8
| * qsort_r appeared in glibc 2.8Edward Thomson2013-05-251-1/+2
|/
* Merge pull request #1608 from arrbee/various-cleanups-and-tweaksVicent Martí2013-05-2413-59/+164
|\ | | | | Various cleanups and tweaks
| * Add ~ expansion to global attributes and excludesRussell Belfer2013-05-243-13/+59
| | | | | | | | | | | | | | | | | | This adds ~/ prefix expansion for the value of core.attributesfile and core.excludesfile, plus it fixes the fact that the attributes cache was holding on to the string data from the config for a long time (instead of making its own strdup) which could have caused a problem if the config was refreshed. Adds a test for the new expansion capability.
| * Clarify GIT_DIFF_INCLUDE_UNTRACKED_CONTENT optionRussell Belfer2013-05-242-5/+14
| | | | | | | | | | | | | | | | This improves the docs for GIT_DIFF_INCLUDE_UNTRACKED_CONTENT as well as the other flags related to UNTRACKED items in diff, plus it makes that flag now automatically turn on GIT_DIFF_INCLUDE_UNTRACKED which seems like a reasonable dwim type of change.
| * Typedef git_config_level_t and use it everywhereRussell Belfer2013-05-244-29/+44
| | | | | | | | | | | | | | | | The GIT_CONFIG_LEVEL constants actually work well as an enum because they are mutually exclusive, so this adds a typedef to the enum and uses that everywhere that one of these constants are expected, instead of the old code that typically used an unsigned int.
| * Docs for git_libgit2_opts and cache disable tweakRussell Belfer2013-05-242-2/+36
| | | | | | | | | | | | | | This adds docs for the cache control options to git_libgit2_opts and also tweaks the cache code so that if the cache is disabled, then the next time we attempt to insert something into the cache in question, we will actually clear any old cached objects.
| * Add typedefs on some public enumsRussell Belfer2013-05-243-10/+11
|/ | | | Apparently this makes things easier to bind in some languages.
* Merge pull request #1607 from ethomson/hurdRussell Belfer2013-05-241-1/+2
|\ | | | | qsort_r is broken on HURD, avoid
| * qsort_r is broken on HURD, avoidEdward Thomson2013-05-241-1/+2
|/
* Merge pull request #1605 from ethomson/replace_reuc_fixVicent Martí2013-05-241-6/+8
|\ | | | | Cherry picking REUC fixes
| * Ensure reuc vector is always validRussell Belfer2013-05-241-6/+8
|/ | | | | | | | | In theory, if there was a problem reading the REUC data, the read_reuc() routine could have left uninitialized and invalid data in the git_index vector. This moves the line that inserts a new entry into the vector down to the bottom of the routine so we know all the content is already valid. Also, per @linquize, this uses calloc to ensure no uninitialized data.
* Merge pull request #1593 from ethomson/conflict_iteratorVicent Martí2013-05-246-40/+215
|\ | | | | introduce git_conflict_iterator
| * introduce git_conflict_iteratorEdward Thomson2013-05-176-40/+215
| |
* | Merge pull request #1592 from ethomson/merge_setupVicent Martí2013-05-245-59/+1476
|\ \ | | | | | | merge setup
| * | merge setupEdward Thomson2013-05-175-59/+1476
| |/
* | Merge pull request #1603 from ben/shallowVicent Martí2013-05-2410-0/+71
|\ \ | | | | | | Shallow-clone detection
| * | Stop leaking memoryBen Straub2013-05-231-1/+6
| | |
| * | Improve test failure outputBen Straub2013-05-2310-0/+66
| | |
* | | Merge pull request #1595 from arrbee/even-more-rename-fixesVicent Martí2013-05-2416-284/+1109
|\ \ \ | | | | | | | | Even more rename detection fixes
| * | | Fill out diff rename test coverageRussell Belfer2013-05-232-1/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This extends the rename tests to make sure that every rename scenario in the inner loop of git_diff_find_similar is actually exercised. Also, fixes an incorrect assert that was in one of the clauses that was not previously being exercised.
| * | | Move core.abbrev lookup out of diff print loopRussell Belfer2013-05-231-43/+48
| | | | | | | | | | | | | | | | | | | | | | | | This moves the GIT_CVAR_ABBREV lookup out of the loop. Also, this fixes git_diff_print_raw to actually use that constant instead of hardcoding 7 characters.
| * | | More diff rename tests; better split swap handlingRussell Belfer2013-05-236-24/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a couple more tests of different rename scenarios. Also, this fixes a problem with the case where you have two "split" deltas and the left half of one matches the right half of the other. That case was already being handled, but in the wrong order in a way that could result in bad output. Also, if the swap also happened to put the other two halves into the correct place (i.e. two files exchanged places with each other), then the second delta was left with the SPLIT flag set when it really should be cleared.
| * | | Fix dereference of freed deltaRussell Belfer2013-05-231-7/+12
| | | | | | | | | | | | | | | | | | | | I was accidentally using a value that I had just freed. This moves the clearing of the delta internal flags into a better place.
| * | | Significant rename detection rewriteRussell Belfer2013-05-225-220/+319
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This flips rename detection around so instead of creating a forward mapping from deltas to possible rename targets, instead it creates a reverse mapping, looking at possible targets and trying to find a source that they could have been renamed or copied from. This is important because each output can only have a single source, but a given source could map to multiple outputs (in the form of COPIED records). Additionally, this makes a couple of tweaks to the public rename detection APIs, mostly renaming a couple of options that control the behavior to make more sense and to be more like core Git. I walked through the tests looking at the exact results and updated the expectations based on what I saw. The new code is different from the old because it cannot give some nonsense results (like A was renamed to both B and C) which were part of the outputs previously.
| * | | Add more diff rename detection testsRussell Belfer2013-05-204-20/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a bunch more rename detection tests including checks vs the working directory, the new exact match options, some more whitespace variants, etc. This also adds a git_futils_writebuffer helper function and uses it in checkout. This is mainly added because I wanted an easy way to write out a git_buf to disk inside my test code.
| * | | More git_diff_find_similar improvementsRussell Belfer2013-05-203-71/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add new GIT_DIFF_FIND_EXACT_MATCH_ONLY flag to do similarity matching without using the similarity metric (i.e. only compare the SHA). - Clean up the similarity measurement code to more rigorously distinguish between files that are not similar and files that are not comparable (previously, a 0 could either mean that the files could not be compared or that they were totally different) - When splitting a MODIFIED file into a DELETE/ADD pair, actually make a DELETED/UNTRACKED pair if the right side of the diff is from the working directory. This prevents an odd mix of ADDED and UNTRACKED files on workdir diffs.
| * | | Extend diff exampleRussell Belfer2013-05-171-6/+44
| | | | | | | | | | | | | | | | | | | | Add --raw output format and (some) options to invoke rename/copy detection on the diff.
| * | | Fix issues with git_diff_find_similarRussell Belfer2013-05-174-85/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a number of bugs in the rename code that only were obvious when I started testing it against large old repos with more complex patterns. (The code to do that testing is not ready to merge with libgit2, but I do plan to add more thorough tests.) This contains a significant number of changes and also tweaks the public API slightly to make emulating core git easier. Most notably, this separates the GIT_DIFF_FIND_AND_BREAK_REWRITES flag into FIND_REWRITES (which adds a self-similarity score to every modified file) and BREAK_REWRITES (which splits the modified deltas into add/remove pairs in the diff list). When you do a raw output of core git, rewrites show up as M090 or such, not at A and D output, so I wanted to be able to emulate that. Publicly, this also changes the flags to be uint16_t since we don't need values out of that range. Internally, this contains significant changes from a number of small bug fixes (like using the wrong side of the diff to decide if the object could be found in the ODB vs the workdir) to larger issues about which files can and should be compared and how the various edge cases of similarity scores should be treated. Honestly, I don't think this is the last update that will have to be made to this code, but I think this moves us closer to correct behavior and I tried to document the code so it would be easier to follow..
| * | | Fix delta compare to use correct pathnameRussell Belfer2013-05-171-1/+14
| | | | | | | | | | | | | | | | | | | | The delta cmp function needs to choose the correct path for ordering when a delta is ADDED, RENAMED, or COPIED.
| * | | Add git_diff_print_raw printing helperRussell Belfer2013-05-172-6/+78
| | | | | | | | | | | | | | | | Makes it easier to emulate the --raw option
| * | | Add git_oid_nfmt - a flexible OID formatterRussell Belfer2013-05-173-23/+82
| | | | | | | | | | | | | | | | | | | | | | | | I frequently want to the the first N digits of an OID formatted as a string and I'd like it to be efficient. This function makes that easy and I could rewrite the OID formatters in terms of it.
* | | | Merge pull request #1604 from arrbee/config-file-checksVicent Martí2013-05-242-25/+164
|\ \ \ \ | |_|/ / |/| | | Extend checking for config with no files
| * | | More config code checks and cleanupsRussell Belfer2013-05-231-23/+34
| | | |
| * | | More tests of config with various absent filesRussell Belfer2013-05-232-3/+131
|/ / / | | | | | | | | | | | | Plus a bit of extra paranoia to ensure config object has valid contents.