Log

Author Commit Date CI Message
Jeff King 56ec2256 2014-05-08T01:06:38 examples: add a basic for-each-ref example This is quite close to running "git for-each-ref" except: 1. It does not take any formatting or selection options at all. 2. The output is not sorted. I wrote it to look at debugging some issues with ref iteration, but there's no reason it can't live on as an example command.
Jeff King 6bcb0987 2014-05-08T00:35:56 cmake: s/ICONV/Iconv/ in FIND_PACKAGE The cmake module we provide is in the file FindIconv.cmake, so we must match the case correctly. It happens to work in practice because we only turn on ICONV on Darwin, and people generally have case-insensitive filesystems there. Note that we only need to update the package name here. The package itself still sets the all-uppercase ICONV_FOUND flag, so we continue to use uppercase in the rest of cmake.
Russell Belfer ed476c23 2014-05-06T16:11:03 Merge pull request #2329 from anuraggup/fix_git_shutdown Fix the issues in git_shutdown
Russell Belfer 10511000 2014-05-06T14:03:58 Merge pull request #2324 from libgit2/cmn/file-in-objects-dir odb: ignore files in the objects dir
Anurag Gupta 0bf5430d 2014-05-06T13:33:47 Fix the issues in git_shutdown 1) Call to git_shutdown results in setting git__n_shutdown_callbacks to -1. Next call to git__on_shutdown results in ABW (Array Bound Write) for array git__shutdown_callbacks. In the current Implementation, git_atomic_dec is called git__n_shutdown_callbacks + 1 times. I have modified it to a for loop so that it is more readable. It would not set git__n_shutdown_callbacks to a negative number and reset the elements of git__shutdown_callbacks to NULL. 2) In function git_sysdir_get, shutdown function is registered only if git_sysdir__dirs_shutdown_set is set to 0. However, after this variable is set to 1, it is never reset to 0. If git_sysdir_global_init is called again from synchronized_threads_init it does not register shutdown function for this subsystem.
Carlos Martín Nieto 6e9afb97 2014-05-06T21:14:58 object: fix a brace The brace in the check for peel's return was surrounding the wrong thing, which made 'error' be set to 1 when there was an error instead of the error code.
Anurag Gupta 001befcd 2014-05-06T12:16:24 Fix the issues in git__on_shutdown
Carlos Martín Nieto ee311907 2014-05-05T16:04:14 odb: ignore files in the objects dir We assume that everything under GIT_DIR/objects/ is a directory. This is not necessarily the case if some process left a stray file in there. Check beforehand if we do have a directory and ignore the entry otherwise.
Russell Belfer d2c16e9a 2014-05-02T15:15:43 Doc fixes
Vicent Marti 272b462d 2014-05-02T09:50:15 Merge pull request #2308 from libgit2/rb/diff-update-index-stat-cache Reduce excessive OID calculation for diff and stat
Russell Belfer 9862ef8e 2014-05-02T09:42:07 Merge pull request #2310 from libgit2/cmn/commit-create-safe commit: safer commit creation with reference update
Russell Belfer 9c8ed499 2014-04-29T15:05:58 Remove trace / add git_diff_perfdata struct + api
Russell Belfer 7a2e56a3 2014-04-29T14:30:15 Get rid of redundant git_diff_options_init fn Since git_diff_init_options was introduced, remove this old fn.
Russell Belfer b23b112d 2014-04-29T11:29:49 Add payloads, bitmaps to trace API 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.
Russell Belfer 225aab5d 2014-04-28T16:47:39 Don't use trace if GIT_TRACE not defined
Russell Belfer cd424ad5 2014-04-28T16:39:53 Add GIT_STATUS_OPT_UPDATE_INDEX and use trace API 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.
Russell Belfer 94fb4aad 2014-04-28T14:48:41 Add diff option to update index stat cache 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.
Russell Belfer 0fc8e1f6 2014-04-28T14:34:55 Lay groundwork for updating stat cache in diff 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.
Russell Belfer 99dfa470 2014-05-01T15:12:12 Some further sandboxing cleanups to tests Trying to find other issues where tests may not clean up quite properly when they are through...
Russell Belfer 0f603132 2014-05-01T14:47:33 Improve handling of fake home directory There are a few tests that set up a fake home directory and a fake GLOBAL search path so that we can test things in global ignore or attribute or config files. This cleans up that code to work more robustly even if there is a test failure. This also fixes some valgrind warnings where scanning search paths for separators could end up doing a little bit of sketchy data access when coming to the end of search list.
Russell Belfer bc91347b 2014-04-30T11:16:31 Fix remaining init_options inconsistencies There were a couple of "init_opts()" functions a few more cases of structure initialization that I somehow missed.
Russell Belfer 702efc89 2014-04-30T10:57:42 Make init_options fns use unsigned ints and macro 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).
Russell Belfer 8ef4e11a 2014-04-28T14:16:26 Skip diff oid calc when size definitely changed 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.
Russell Belfer 240f4af3 2014-04-28T14:04:29 Add build option for diff internal statistics
Vicent Marti 6a1ca96e 2014-05-02T17:14:04 Temporary fix for Travis CI builds See https://github.com/libgit2/libgit2/pull/2321#issuecomment-42039673 We may rollback once we found something more reliable
Vicent Marti 89e9c167 2014-05-02T03:37:40 Merge pull request #2318 from linquize/sleep Make examples/status.c compile on Windows
Vicent Marti 644592bc 2014-05-02T03:36:22 Merge pull request #2320 from libgit2/rb/fix-starstar-again Make ** pattern eat trailing slash
Russell Belfer d19b2f9f 2014-05-01T12:46:46 Make ** pattern eat trailing slash This allows "foo/**/*.html" to match "foo/file.html"
Linquize d0420fc6 2014-05-01T22:39:35 Make examples/status.c compile on Windows
Vicent Marti 9d878fc4 2014-05-01T01:23:10 Merge pull request #2304 from jacquesg/solaris Solaris!
Jacques Germishuys 183aa4f8 2014-04-30T17:46:53 Check for NULL before passing it to vsnprintf
Jacques Germishuys 6b05240c 2014-04-27T19:44:20 strcasecmp is in <strings.h>
Jacques Germishuys 98b8fcff 2014-04-29T20:45:02 Build regex.c for Solaris. Added required defines for Solaris
Vicent Marti c522bed0 2014-04-30T05:45:31 Merge pull request #2314 from libgit2/cmn/known-libs Assorted CMake fixups
Vicent Marti 739040e6 2014-04-30T05:34:33 Merge pull request #2315 from jacquesg/qsort-cygwin cygwin also doesn't have qsort_r
Jacques Germishuys 90a4340a 2014-04-30T11:47:58 cygwin also doesn't have qsort_r
Carlos Martín Nieto 039e354b 2014-04-30T11:57:54 ciscript: don't use an empty string as a number An empty string is not a valid number, and some shells complain. Check instead if $COVERITY is non-empty, which is a common convention and what we're doing anyway.
Carlos Martín Nieto 891b0277 2014-04-30T11:20:51 refs: document _next_name() If it's not documented, it doesn't show up in the docs (and we really should document, anyway).
Carlos Martín Nieto f5fc63bc 2014-04-30T10:55:58 Don't exclude libssh2 from MinGW It reportedly works. It does not however work when cross-compiling on Travis, so let's disable it there. This fixes #2311.
Ting-Wei Lan 096ac799 2014-02-13T22:38:23 Workaround missing .pc files on FreeBSD This fixes #2118
Carlos Martín Nieto 04739e9f 2014-04-30T10:15:44 Unquiet CMake output The point of this phase is to know what we have and not. Show the user a clear indication of what we have.
Carlos Martín Nieto 217c029b 2014-04-09T14:08:22 commit: safer commit creation with reference update The current version of the commit creation and amend function are unsafe to use when passing the update_ref parameter, as they do not check that the reference at the moment of update points to what the user expects. Make sure that we're moving history forward when we ask the library to update the reference for us by checking that the first parent of the new commit is the current value of the reference. We also make sure that the ref we're updating hasn't moved between the read and the write. Similarly, when amending a commit, make sure that the current tip of the branch is the commit we're amending.
Vicent Marti 892778ee 2014-04-29T05:02:38 Merge pull request #2309 from jacquesg/midnightbsd MidnightBSD may also not have strnlen
Jacques Germishuys 36a61518 2014-04-29T13:28:16 MidnightBSD may also not have strnlen
Vicent Marti 041336e6 2014-04-28T07:36:27 Merge pull request #2306 from odcinek/development_cmake Make the build CMake 2.6 compatible
Marcin Sawicki 7f0de93a 2014-04-28T15:24:36 Make the build CMake 2.6 compatible
Vicent Marti ec771058 2014-04-27T03:57:53 Merge pull request #2301 from libgit2/cmn/pack-objects-memory Keep the deflate buffer from ballooning up
Carlos Martín Nieto 38d338b2 2014-04-26T18:15:39 pack-objects: always write out the status in write_one() Make sure we set the output parameter to a value.
Carlos Martín Nieto c7f86efb 2014-04-26T18:04:43 zstream: grow based on used memory rather than allocated 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.
Carlos Martín Nieto 4f9d5414 2014-04-26T14:29:18 refdb: fix typo and wording
Vicent Marti e79a2998 2014-04-25T07:08:41 Merge pull request #2299 from mekishizufu/fix_leaks Plug some leaks
Jiri Pospisil 7b8d564d 2014-04-25T15:49:58 Reset tests: Use sandboxed index
Jiri Pospisil 424222f4 2014-04-25T15:49:26 Filter: Make sure to release local on error
Vicent Marti 8443ed6c 2014-04-25T02:10:19 Merge pull request #2284 from jacquesg/push-progress-callback Fire progress and update tips callbacks also for pushes.
Vicent Marti 332e4f20 2014-04-25T02:07:42 Merge pull request #2297 from libgit2/rb/status-with-precomposed-changes Improve test coverage of status with different core.precomposeunicode settings
Vicent Marti 2ad51b81 2014-04-25T02:04:12 Merge pull request #2241 from libgit2/rb/stash-skip-submodules Improve stash and checkout for ignored + untracked items
Russell Belfer af9eeac9 2014-04-24T16:20:08 Merge pull request #2294 from ethomson/merge_checkout_strategy Merge checkout strategy
Russell Belfer 6b833e3a 2014-04-24T15:40:50 Improve docs for status rename detection limits and make tests empty on platforms without iconv support.
Russell Belfer f608f3bb 2014-04-24T15:25:01 Test toggling core.precomposeunicode yields rename There is an interesting difference with core Git here, though. Because libgit2 will do rename detection with the working directory, in the last case where the HEAD and the working directory both have the decomposed data and the index has the composed data, we generate a single status record with two renames whereas Git will generate one rename (head to index) and one untracked file.
Russell Belfer 2334e3d8 2014-04-24T14:46:59 Test decomposed unicode renames work as expected
Russell Belfer a409acef 2014-04-24T11:59:50 Handle explicitly ignored dir slightly differently 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.
Vicent Marti 87c9b741 2014-04-24T05:24:46 Merge pull request #2295 from libgit2/cmn/fetchhead-quote fetchhead: deal with quotes in branch names
Carlos Martín Nieto bdc82e1c 2014-04-24T14:08:29 fetchhead: deal with quotes in branch names 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.
Edward Thomson a4e2c36a 2014-04-23T19:40:21 merge: checkout default shouldn't clobber given
Edward Thomson 26564d80 2014-04-23T19:26:58 merge: default checkout strategy for should be SAFE
Russell Belfer 219c89d1 2014-04-23T16:28:45 Treat ignored, empty, and untracked dirs different 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.
Vicent Marti 212b6205 2014-04-23T09:27:15 Merge pull request #2291 from ethomson/patch_binary patch: emit deflated binary patches (optionally)
Vicent Marti 5ca410b9 2014-04-23T07:13:49 Merge pull request #2283 from phkelley/win32_fs Win32: UTF-8 <-> WCHAR conversion overhaul
Philip Kelley 7110000d 2014-04-22T10:21:19 React to feedback for UTF-8 <-> WCHAR and reparse work
Vicent Marti 5b58d6f7 2014-04-23T03:21:05 Merge pull request #2289 from libgit2/rb/note-git-diff-index-behavior Some doc and examples/diff.c changes
Russell Belfer 37da3685 2014-04-22T21:51:54 Make checkout match diff for untracked/ignored dir 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.
Edward Thomson e349ed50 2014-04-22T14:58:33 patch: emit binary patches (optionally)
Russell Belfer 3c1aa4c1 2014-04-22T15:23:39 Failing test for stashing a buried ignored file
Russell Belfer 24d17de2 2014-04-02T12:07:27 Make stash and checkout ignore contained repos 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.
Russell Belfer e60883c8 2014-04-22T12:59:31 Replace math fns with simpler integer math
Russell Belfer 8d09efa2 2014-04-22T12:33:27 Use git_diff_get_stats in example/diff + refactor 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.
Russell Belfer 12e422a0 2014-04-21T16:08:05 Some doc and examples/diff.c changes 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.
Vicent Marti a32d684f 2014-04-22T15:07:18 Merge pull request #2282 from libgit2/cmn/remote-easier-bind A few niceties for binding authors
Carlos Martín Nieto bc0a6198 2014-04-19T15:52:58 transports: allow the creds callback to say it doesn't exist 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.
Carlos Martín Nieto 2efd7df6 2014-04-19T15:34:12 remote: provide read access to the callback structure This should make it easier for bindings to dynamically override their own callbacks.
Vicent Marti dac95e4a 2014-04-22T11:04:35 Merge pull request #2287 from libgit2/rb/moar-coverity-fixes Fix some issues from the last Coverity scan
Vicent Marti 2e609e29 2014-04-22T11:03:42 Merge pull request #2286 from libgit2/rb/fix-reset-staged-delete Fix reset for staged deletes
Edward Thomson 65477db1 2014-04-21T23:32:31 Handle win32 reparse points properly
Russell Belfer 17ef678c 2014-04-21T11:55:57 Fix some coverity-found issues
Russell Belfer bd101a7e 2014-04-21T11:54:54 Fix reset for staged deletes
Jacques Germishuys f70cfd34 2014-04-21T17:49:38 Verify update_tips callbacks in push test cases
Russell Belfer 28750a7d 2014-04-21T09:50:43 Merge pull request #2275 from jacquesg/apple-warning Check for compiler flag support instead of checking for a platform
Jacques Germishuys 321d377a 2014-04-21T17:02:05 Fire update_tips callback also for pushes.
Carlos Martín Nieto 78399310 2014-04-21T16:38:52 attrcache: fix use-after-free Reported by coverity.
Jacques Germishuys 8b686b31 2014-04-21T15:25:19 Correct argument order of git__calloc()
Jacques Germishuys be6996b7 2014-04-21T15:25:02 It is safe to free() a NULL pointer
Carlos Martín Nieto a15d3537 2014-04-21T15:48:05 sysdir: free the path if we cannot find the file Returning an error cleared the buf, but this operation does not free the memory associated with it. Use git_buf_free() instead.
Jacques Germishuys 48e60ae7 2014-04-21T11:23:29 Don't redefine the same callback types, their signatures may change
Jacques Germishuys 98020d3a 2014-04-21T10:55:37 Rename progress callback to sideband_progress
Jacques Germishuys 4f62163e 2014-04-20T22:06:05 Check the return codes of remote callbacks. The user may have requested that the operation be cancelled.
Jacques Germishuys 9effa2fb 2014-04-20T19:19:13 Fire progress callbacks also for pushes. It's not very useful to only know that a pre-receive hook has declined a push, you probably want to know why.
Philip Kelley c2c81615 2014-04-19T18:05:31 Win32: UTF-8 <-> WCHAR conversion overhaul
Jacques Germishuys 5c8d5eac 2014-04-19T23:07:50 Introduce AddCFlagIfSupported CMake macro
Vicent Marti bfc50f83 2014-04-19T18:59:09 Merge pull request #2273 from jacquesg/ssh-interactive Add support for SSH keyboard-interactive authentication
Vicent Marti 7b0f8ba9 2014-04-19T13:05:32 Merge pull request #2279 from libgit2/rb/moar-eegnöre-fîxés Fix several ignore and attribute file behavior bugs