summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix remaining init_options inconsistenciesrb/diff-update-index-stat-cacheRussell Belfer2014-04-3010-86/+37
| | | | | There were a couple of "init_opts()" functions a few more cases of structure initialization that I somehow missed.
* Make init_options fns use unsigned ints and macroRussell Belfer2014-04-308-85/+51
| | | | | Use an unsigned int for the version and add a helper macro so the code is simplified (and so the error message is a common string).
* Remove trace / add git_diff_perfdata struct + apiRussell Belfer2014-04-297-66/+88
|
* Get rid of redundant git_diff_options_init fnRussell Belfer2014-04-291-14/+0
| | | | Since git_diff_init_options was introduced, remove this old fn.
* Add payloads, bitmaps to trace APIRussell Belfer2014-04-294-22/+28
| | | | | | | | | This is a proposed adjustment to the trace APIs. This makes the trace levels into a bitmask so that they can be selectively enabled and adds a callback-level payload, plus a message-level payload. This makes it easier for me to a GIT_TRACE_PERF callbacks that are simply bypassed if the PERF level is not set.
* Add GIT_STATUS_OPT_UPDATE_INDEX and use trace APIRussell Belfer2014-04-286-35/+36
| | | | | | This adds an option to refresh the stat cache while generating status. It also rips out the GIT_PERF stuff I had an makes use of the trace API to keep statistics about what happens during diff.
* Add diff option to update index stat cacheRussell Belfer2014-04-283-6/+34
| | | | | | | | | | When diff is scanning the working directory, if it finds a file where it is not sure if the index entry matches the working dir, it will recalculate the OID (which is pretty expensive). This adds a new flag to diff so that if the OID calculation finds that the file actually has not changed (i.e. just the modified time was altered or such), then it will refresh the stat cache in the index so that future calls to diff will not have to check the oid again.
* Lay groundwork for updating stat cache in diffRussell Belfer2014-04-284-21/+36
| | | | | | | | | | | This reorganized the diff OID calculation to make it easier to correctly update the stat cache during a diff once the flags to do so are enabled. This includes marking the path of a git_index_entry as const so we can make a "fake" git_index_entry with a "const char *" path and not get warnings. I was a little surprised at how unobtrusive this change was, but I think it's probably a good thing.
* Skip diff oid calc when size definitely changedRussell Belfer2014-04-282-5/+12
| | | | | | | | | | | | | When we think the stat cache in the index seems valid and the size or mode of a file has definitely changed, then don't bother trying to recalculate the OID of the workdir bits to confirm that it is modified - just accept that it is modified. This can result in files that show as modified with no actual diff, but the behavior actually appears to match Git on the command line. This also includes a minor optimization to not perform a submodule lookup on the ".git" directory itself.
* Add build option for diff internal statisticsRussell Belfer2014-04-288-48/+79
|
* pack-objects: always write out the status in write_one()cmn/pack-objects-memoryCarlos Martín Nieto2014-04-261-0/+1
| | | | Make sure we set the output parameter to a value.
* zstream: grow based on used memory rather than allocatedCarlos Martín Nieto2014-04-261-1/+1
| | | | | | | | | | | | | | | When deflating data, we might need to grow the buffer. Currently we add a guess on top of the currently-allocated buffer size. When we re-use the buffer, it already has some memory allocated; adding to that means that we always grow the buffer regardless of how much we need to use. Instead, increase on top of the currently-used size. This still leaves us with the allocated size of the largest object we compress, but it's a minor pain compared to unbounded growth. This fixes #2285.
* refdb: fix typo and wordingCarlos Martín Nieto2014-04-261-1/+1
|
* Filter: Make sure to release local on errorJiri Pospisil2014-04-251-2/+3
|
* Merge pull request #2284 from jacquesg/push-progress-callbackVicent Marti2014-04-2511-76/+89
|\ | | | | Fire progress and update tips callbacks also for pushes.
| * Fire update_tips callback also for pushes.Jacques Germishuys2014-04-211-17/+29
| |
| * Correct argument order of git__calloc()Jacques Germishuys2014-04-211-1/+1
| |
| * It is safe to free() a NULL pointerJacques Germishuys2014-04-211-3/+1
| |
| * Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-218-11/+11
| |
| * Rename progress callback to sideband_progressJacques Germishuys2014-04-212-4/+4
| |
| * Check the return codes of remote callbacks.Jacques Germishuys2014-04-211-5/+9
| | | | | | | | The user may have requested that the operation be cancelled.
| * Fire progress callbacks also for pushes.Jacques Germishuys2014-04-201-36/+35
| | | | | | | | | | It's not very useful to only know that a pre-receive hook has declined a push, you probably want to know why.
* | Merge pull request #2241 from libgit2/rb/stash-skip-submodulesVicent Marti2014-04-255-97/+171
|\ \ | | | | | | Improve stash and checkout for ignored + untracked items
| * | Handle explicitly ignored dir slightly differentlyrb/stash-skip-submodulesRussell Belfer2014-04-241-8/+9
| | | | | | | | | | | | | | | | | | | | | When considering status of untracked directories, if we find an explicitly ignored item, even if it is a directory, treat the parent as an IGNORED item. It was accidentally being treated as an EMPTY item because we were not looking into the ignored subdir.
| * | Treat ignored, empty, and untracked dirs differentRussell Belfer2014-04-234-22/+39
| | | | | | | | | | | | | | | | | | In the iterator, distinguish between ignores and empty directories so that diff and status can ignore empty directories, but checkout and stash can treat them as untracked items.
| * | Make checkout match diff for untracked/ignored dirRussell Belfer2014-04-224-98/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When diff finds an untracked directory, it emulates Git behavior by looking inside the directory to see if there are any untracked items inside it. If there are only ignored items inside the dir, then diff considers it ignored, even if there is no direct ignore rule for it. Checkout was not copying this behavior - when it found an untracked directory, it just treated it as untracked. Unfortunately, when combined with GIT_CHECKOUT_REMOVE_UNTRACKED, this made is seem that checkout (and stash, which uses checkout) was removing ignored items when you had only asked it to remove untracked ones. This commit moves the logic for advancing past an untracked dir while scanning for non-ignored items into an iterator helper fn, and uses that for both diff and checkout.
| * | Make stash and checkout ignore contained reposRussell Belfer2014-04-222-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To emulate git, stash should not remove untracked git repositories inside the parent repo, and checkout's REMOVE_UNTRACKED should also skip over these items. `git stash` actually prints a warning message for these items. That should be possible with a checkout notify callback if you wanted to, although it would require a bit of extra logic as things are at the moment.
* | | Merge pull request #2294 from ethomson/merge_checkout_strategyRussell Belfer2014-04-241-5/+3
|\ \ \ | | | | | | | | Merge checkout strategy
| * | | merge: checkout default shouldn't clobber givenEdward Thomson2014-04-231-5/+3
| | | |
| * | | merge: default checkout strategy for should be SAFEEdward Thomson2014-04-231-1/+1
| | | |
* | | | fetchhead: deal with quotes in branch namesCarlos Martín Nieto2014-04-241-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | The current FETCH_HEAD parsing code assumes that a quote must end the branch name. Git however allows for quotes as part of a branch name, which causes us to consider the FETCH_HEAD file as invalid. Instead of searching for a single quote char, search for a quote char followed by SP, which is not a valid part of a ref name.
* | | Merge pull request #2291 from ethomson/patch_binaryVicent Marti2014-04-233-6/+164
|\ \ \ | | | | | | | | patch: emit deflated binary patches (optionally)
| * | | patch: emit binary patches (optionally)Edward Thomson2014-04-223-6/+164
| | | |
* | | | Merge pull request #2283 from phkelley/win32_fsVicent Marti2014-04-2318-460/+912
|\ \ \ \ | | | | | | | | | | Win32: UTF-8 <-> WCHAR conversion overhaul
| * | | | React to feedback for UTF-8 <-> WCHAR and reparse workPhilip Kelley2014-04-238-38/+34
| | | | |
| * | | | Handle win32 reparse points properlyEdward Thomson2014-04-225-132/+353
| | | | |
| * | | | Win32: UTF-8 <-> WCHAR conversion overhaulPhilip Kelley2014-04-1916-400/+635
| | |_|/ | |/| |
* | | | Replace math fns with simpler integer mathrb/note-git-diff-index-behaviorRussell Belfer2014-04-221-11/+23
| | | |
* | | | Use git_diff_get_stats in example/diff + refactorRussell Belfer2014-04-222-161/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This takes the `--stat` and related example options in the example diff.c program and converts them to use the `git_diff_get_stats` API which nicely formats stats for you. I went to add bar-graph scaling to the stats formatter and noticed that the `git_diff_stats` structure was holding on to all of the `git_patch` objects. Unfortunately, each of these objects keeps the full text of the diff in memory, so this is very expensive. I ended up modifying `git_diff_stats` to keep just the data that it needs to keep and allowed it to release the patches. Then, I added width scaling to the output on top of that. In making the diff example program match 'git diff' output, I ended up removing an newline from the sumamry output which I then had to compensate for in the email formatting to match the expectations. Lastly, I went through and refactored the tests to use a couple of helper functions and reduce the overall amount of code there.
* | | | Some doc and examples/diff.c changesRussell Belfer2014-04-221-1/+2
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was playing with "git diff-index" and wanted to be able to emulate that behavior a little more closely with the diff example. Also, I wanted to play with running `git_diff_tree_to_workdir` directly even though core Git doesn't exactly have the equivalent, so I added a command line option for that and tweaked some other things in the example code. This changes a minor output thing in that the "raw" print helper function will no longer add ellipses (...) if the OID is not actually abbreviated.
* | | transports: allow the creds callback to say it doesn't existCarlos Martín Nieto2014-04-222-32/+55
| | | | | | | | | | | | | | | | | | | | | | | | Allow the credentials callback to return GIT_PASSTHROUGH to make the transports code behave as though none was set. This should make it easier for bindings to behave closer to the C code when there is no credentials callback set at their level.
* | | remote: provide read access to the callback structureCarlos Martín Nieto2014-04-221-0/+7
| | | | | | | | | | | | | | | This should make it easier for bindings to dynamically override their own callbacks.
* | | Merge pull request #2287 from libgit2/rb/moar-coverity-fixesVicent Marti2014-04-224-18/+16
|\ \ \ | | | | | | | | Fix some issues from the last Coverity scan
| * | | Fix some coverity-found issuesRussell Belfer2014-04-214-18/+16
| | |/ | |/|
* | | Fix reset for staged deletesRussell Belfer2014-04-211-3/+8
|/ /
* | attrcache: fix use-after-freeCarlos Martín Nieto2014-04-211-1/+1
| | | | | | | | Reported by coverity.
* | sysdir: free the path if we cannot find the fileCarlos Martín Nieto2014-04-211-1/+1
|/ | | | | Returning an error cleared the buf, but this operation does not free the memory associated with it. Use git_buf_free() instead.
* Merge pull request #2273 from jacquesg/ssh-interactiveVicent Marti2014-04-192-9/+81
|\ | | | | Add support for SSH keyboard-interactive authentication
| * Only zero sensitive information on destruction (and memory actually ↵Jacques Germishuys2014-04-181-7/+21
| | | | | | | | allocated by us)
| * Make git_cred_ssh_custom_new() naming more consistentJacques Germishuys2014-04-182-3/+3
| |