summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | Make diff and status perform soft index reloadRussell Belfer2013-11-015-18/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes `git_index_read` to have two modes - a hard index reload that always resets the index to match the on-disk data (which was the old behavior) and a soft index reload that uses the timestamp / file size information and only replaces the index data if the file on disk has been modified. This then updates the git_status code to do a soft reload unless the new GIT_STATUS_OPT_NO_REFRESH flag is passed in. This also changes the behavior of the git_diff functions that use the index so that when an index is not explicitly passed in (i.e. when the functions call git_repository_index for you), they will also do a soft reload for you. This intentionally breaks the file signature of git_index_read because there has been some confusion about the behavior previously and it seems like all existing uses of the API should probably be examined to select the desired behavior.
| * | | | | | | Fix some of the glaring errors in GIT_DIFF_REVERSERussell Belfer2013-11-012-17/+34
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These changes fix the basic problem with GIT_DIFF_REVERSE being broken for text diffs. The reversed diff entries were getting added to the git_diff correctly, but some of the metadata was kept incorrectly in a way that prevented the text diffs from being generated correctly. Once I fixed that, it became clear that it was not possible to merge reversed diffs correctly. This has a first pass at fixing that problem. We probably need more tests to make sure that is really fixed thoroughly.
* | | | | | | remote: don't write too much when dealing with multivarsCarlos Martín Nieto2013-11-021-6/+12
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to move `data_start` forward, which is wrong as that needs to point to the beginning of the buffer in order to perform size calculations. Introduce a `write_start` variable which indicates where we should start writing from, which is what the `data_start` was being wrongly reused to be.
* | | | | | preserve windows error numbers as wellEdward Thomson2013-11-012-2/+26
|/ / / / /
* | | | | Merge pull request #1933 from libgit2/vmg/gcc-warningsRussell Belfer2013-11-019-21/+43
|\ \ \ \ \ | | | | | | | | | | | | Warnings for Windows x64 (MSVC) and GCC on Linux
| * | | | | iconv: Do not fake an API when iconv is not availableVicent Marti2013-11-013-12/+35
| | | | | |
| * | | | | checkout: Remove unused vectorVicent Marti2013-11-011-1/+0
| | | | | |
| * | | | | array: Wrap `array_alloc` as a single statementVicent Marti2013-11-011-2/+2
| | | | | |
| * | | | | pack: `__object_header` always returns unsigned valuesVicent Marti2013-11-013-5/+4
| | | | | |
| * | | | | Fix warning on win64Linquize2013-11-014-6/+7
| | | | | |
* | | | | | Merge pull request #1918 from libgit2/cmn/indexer-namingVicent Martí2013-11-015-43/+43
|\ \ \ \ \ \ | | | | | | | | | | | | | | indexer: remove the stream infix
| * | | | | | indexer: remove the stream infixCarlos Martín Nieto2013-10-305-43/+43
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was there to keep it apart from the one which read in from a file on disk. This other indexer does not exist anymore, so there is no need for anything other than git_indexer to refer to it. While here, rename _add() function to _append() and _finalize() to _commit(). The former change is cosmetic, while the latter avoids talking about "finalizing", which OO languages use to mean something completely different.
* | | | | | config_file: Style fixesVicent Marti2013-11-011-9/+6
| | | | | |
* | | | | | Merge remote-tracking branch 'drodriguez/fix-remote-save' into developmentVicent Marti2013-11-013-3/+111
|\ \ \ \ \ \ | |_|/ / / / |/| | | | |
| * | | | | Set new multivar values using unmatcheable regexp.Daniel Rodríguez Troitiño2013-11-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seems that regexp in Mac OS X and Linux were behaving differently: while in OS X the empty string didn't match any value, in Linux it was matching all of them, so the the second fetch refspec was overwritting the first one, instead of creating a new one. Using an unmatcheable regular expression solves the problem (and seems to be portable).
| * | | | | Fix memory leaks.Daniel Rodríguez Troitiño2013-11-011-0/+2
| | | | | |
| * | | | | Fix saving remotes with several fetch/push ref specs.Daniel Rodríguez Troitiño2013-11-013-3/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At some moment git_config_delete_entry lost the ability to delete one entry of a multivar configuration. The moment you had more than one fetch or push ref spec for a remote you will not be able to save that remote anymore. The changes in network::remote::remotes::save show that problem. I needed to create a new git_config_delete_multivar because I was not able to remove one or several entries of a multivar config with the current API. Several tries modifying how git_config_set_multivar(..., NULL) behaved were not successful. git_config_delete_multivar is very similar to git_config_set_multivar, and delegates into config_delete_multivar of config_file. This function search for the cvar_t that will be deleted, storing them in a temporal array, and rebuilding the linked list. After calling config_write to delete the entries, the cvar_t stored in the temporal array are freed. There is a little fix in config_write, it avoids an infinite loop when using a regular expression (case for the multivars). This error was found by the test network::remote::remotes::tagopt.
* | | | | | Prevent another segfault from bad URLBen Straub2013-10-312-6/+7
| | | | | |
* | | | | | Prevent segfault with a badly-formed URLBen Straub2013-10-311-3/+4
|/ / / / /
* | | | | Initialize variablesBen Straub2013-10-301-2/+2
| | | | |
* | | | | Merge pull request #1919 from libgit2/cmn/multi-ack-detailedVicent Martí2013-10-303-29/+58
|\ \ \ \ \ | | | | | | | | | | | | protocol: basic support for multi_ack_detailed
| * | | | | protocol: basic support for multi_ack_detailedCarlos Martín Nieto2013-10-303-29/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tells the server that we speak it, but we don't make use of its extra information to determine if there's a better place to stop negotiating. In a somewhat-related change, reorder the capabilities so we ask for them in the same order as git does. Also take this opportunity to factor out a fairly-indented portion of the negotiation logic.
* | | | | | merge: any non-zero return from the user is an errorCarlos Martín Nieto2013-10-301-1/+1
|/ / / / / | | | | | | | | | | | | | | | This fixes #1703.
* | | | | pack-objects: Depth can be negativeVicent Marti2013-10-301-4/+3
|/ / / /
* | | | Merge pull request #1891 from libgit2/cmn/fix-thin-packsVicent Martí2013-10-289-80/+327
|\ \ \ \ | | | | | | | | | | Add support for thin packs
| * | | | indexer: include the delta statsCarlos Martín Nieto2013-10-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user is unable to derive the number of deltas in the pack, as that would require them to capture the stats exactly in the moment between download and final processing, which is abstracted away in the fetch. Capture these numbers for the user and expose them in the progress struct. The clone and fetch examples now also present this information to the user.
| * | | | indexer: clearer stats for thin packsCarlos Martín Nieto2013-10-111-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't increase the number of total objects, as it can produce suprising progress output. The only addition compared to pre-thin is the addition of local_objects to allow an output similar to git's "completed with %d local objects".
| * | | | indexer: inject one base at a timeCarlos Martín Nieto2013-10-081-27/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There may be multiple deltas referencing the same base as well as OFS deltas which rely on a thin delta. Deal with both at the same time by injecting a single object and going back up to the main delta-resolving loop.
| * | | | net: advertise our support for fixing thin packsCarlos Martín Nieto2013-10-043-1/+12
| | | | |
| * | | | indexer: fix thin packsCarlos Martín Nieto2013-10-044-40/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When given an ODB from which to read objects, the indexer will attempt to inject the missing bases at the end of the pack and update the header and trailer to reflect the new contents.
| * | | | pack: move the object header function hereCarlos Martín Nieto2013-10-043-35/+35
| | | | |
| * | | | indexer: do multiple passes over the delta listCarlos Martín Nieto2013-10-041-12/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Though unusual, a packfile may contain a delta whose base is a delta that comes later. In order index such a packfile, we must not give up on the first failure to resolve a delta, but keep it around. If there is a pass which makes no progress, this indicates that the packfile is broken, so fail accordingly.
* | | | | Merge pull request #1904 from libgit2/cmn/ssh-namingVicent Martí2013-10-282-25/+25
|\ \ \ \ \ | | | | | | | | | | | | Rename the ssh credentials
| * | | | | Rename the ssh credentialsCarlos Martín Nieto2013-10-232-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The names from libssh2 are somewhat obtuse for us. We can simplify the usual key/passphrase credential's name, as well as make clearer what the custom signature function is.
* | | | | | Merge pull request #1802 from libgit2/cmn/reflog-backendBen Straub2013-10-288-336/+435
|\ \ \ \ \ \ | | | | | | | | | | | | | | Make reflog part of refdb
| * | | | | | reflog: bring _append and _drop back to the frontendCarlos Martín Nieto2013-10-022-117/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions act purely on the reflog data structure.
| * | | | | | reflog: add a convenience append functionCarlos Martín Nieto2013-10-021-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a function that reads a reflog, performs an append and writes back to the backend in one call.
| * | | | | | reflog: move the reflog implementation into refdb_fsCarlos Martín Nieto2013-10-028-409/+520
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | References and their logs are logically coupled, let's make it so in the code by moving the fs-based reflog implementation to live next to the fs-based refs one. As part of the change, make the function take names rather than references, as only the names are relevant when looking up and handling reflogs.
* | | | | | The "common.h" should be included before "config.h".Cheng Zhao2013-10-283-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building libgit2 for ia32 architecture on a x64 machine, including "config.h" without a "common.h" would result the following error: C:\Program Files\Microsoft SDKs\Windows\v7.1\include\winbase.h(2288): error C2373: 'InterlockedIncrement' : redefinition; different type modifiers [C:\cygwin\home\zcbenz\codes\git-utils\build\libgit2.vcxproj] C:\Program Files\Microsoft SDKs\Windows\v7.1\include\winbase.h(2295): error C2373: 'InterlockedDecrement' : redefinition; different type modifiers [C:\cygwin\home\zcbenz\codes\git-utils\build\libgit2.vcxproj] C:\Program Files\Microsoft SDKs\Windows\v7.1\include\winbase.h(2303): error C2373: 'InterlockedExchange' : redefinition; different type modifiers [C:\cygwin\home\zcbenz\codes\git-utils\build\libgit2.vcxproj] C:\Program Files\Microsoft SDKs\Windows\v7.1\include\winbase.h(2314): error C2373: 'InterlockedExchangeAdd' : redefinition; different type modifiers [C:\cygwin\home\zcbenz\codes\git-utils\build\libgit2.vcxproj]
* | | | | | Use two calls to set two headersEdward Thomson2013-10-251-4/+17
| | | | | |
* | | | | | transport: let the progress output return an errorCarlos Martín Nieto2013-10-231-1/+4
| |/ / / / |/| | | | | | | | | | | | | | | | | | | There are any number of issues that can come up in the progress callback, and we should let the user cancel at that point as well.
* | | | | Merge pull request #1897 from libgit2/split-patch-from-diffVicent Martí2013-10-2216-518/+549
|\ \ \ \ \ | | | | | | | | | | | | RFC: Proposed reworking of diff APIs
| * | | | | Implement patience and minimal diff flagsRussell Belfer2013-10-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems that to implement these options, we just have to pass the appropriate flags through to the libxdiff code taken from core git. So let's do it (and add a test).
| * | | | | Fix warnings for win64Russell Belfer2013-10-211-5/+5
| | | | | |
| * | | | | Create git_diff_line and extend git_diff_hunkRussell Belfer2013-10-213-160/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having functions with so very many parameters to pass hunk and line data, this takes the existing git_diff_hunk struct and extends it with more hunk data, plus adds a git_diff_line. Those structs are used to pass back hunk and line data instead of the old APIs that took tons of parameters. Some work that was previously only being done for git_diff_patch creation (scanning the diff content for exact line counts) is now done for all callbacks, but the performance difference should not be noticable.
| * | | | | Tweak to git_diff_delta structure for nfilesRussell Belfer2013-10-212-20/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the base git_diff_delta structure always contains two files, when we introduce conflict data, it will be helpful to have an indicator when an additional file is involved.
| * | | | | Diff API cleanupRussell Belfer2013-10-158-172/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lays groundwork for separating formatting options from diff creation options. This groups the formatting flags separately from the diff list creation flags and reorders the options. This also tweaks some APIs to further separate code that uses patches from code that just looks at git_diffs.
| * | | | | Rename diff objects and split patch.hRussell Belfer2013-10-1116-200/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes no functional change to diff but renames a couple of the objects and splits the new git_patch (formerly git_diff_patch) into a new header file.
* | | | | | Implement `git_odb_object_dup`Vicent Marti2013-10-221-0/+7
| | | | | |
* | | | | | Allowed credential types should be a bitfieldEdward Thomson2013-10-212-2/+3
| | | | | |