Skip to content
This repository

Apr 01, 2014

  1. Greg Hurrell

    Update docs for 1.8 release

    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 31, 2014

Mar 29, 2014

  1. Greg Hurrell

    Merge branch 'rpuntaie/master' into next

    * branch 'rpuntaie/master':
      Add Roland Puntaier to AUTHORS section of docs
      Drop c99 mode to enable compilation on mingw
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 29, 2014
  2. Greg Hurrell

    Add Roland Puntaier to AUTHORS section of docs

    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 29, 2014
  3. Roland Puntaier

    Drop c99 mode to enable compilation on mingw

    This avoids the 'unknown type name off_t' error that will otherwise
    occur:
    
      http://sourceforge.net/p/mingw/bugs/2046/
    
    Originally submitted at:
    
      #63
    
    Minor tweaks applied:
    
    - squashed two commits into one
    - reordered some lines to keep comments close to the lines they actually
      apply to
    - de-c99-ize additional sites missed by original commit (eg. watchman.c
      file)
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored January 18, 2014 wincent committed March 29, 2014
  4. Greg Hurrell

    Doc updates

    - added a FAQ section
    - fixed a typo
    - turned a "see" reference into a navigable link
    - improved trouble-shooting documentation
    - augmented and polished TIPS section
    - started prepping for 1.8 release
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 29, 2014

Mar 28, 2014

  1. Greg Hurrell

    Update specs for Ruby 1.8 compatibility

    The implementation does work under 1.8, but the specs needed some
    convincing of that fact.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 27, 2014
  2. Greg Hurrell

    Fix compilation errors on 1.8

    1.8 has an st.h header which defines ST_CONTINUE (et al), which is
    apparently not included by default.
    
    1.9 has a ruby/st.h header, included by default, and also a st.h header
    for backwards compatibility. The latter works but issues a warning to
    the console.
    
    Let's check for the presence of the headers and use the appropriate one.
    Note that ruby/st.h has the standard include guards in place, so we need
    not worry about inadvertently including things twice.
    
    Reported here:
    
      #67 (comment)
    
    Leads to:
    
      watchman.c:188:12: error: use of undeclared identifier 'ST_CONTINUE'
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 27, 2014
  3. Greg Hurrell

    Silence a compiler warning

    The compiler doesn't know that `rb_raise` longjmps us out of the
    function, so make it feel better by pretending that we'll return a VALUE
    no matter what.
    
    Fixes the Clang warning:
    
      watchman.c:470:1: warning: control may reach end of non-void function [-Wreturn-type]
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 27, 2014

Mar 23, 2014

  1. Greg Hurrell

    Reorganize benchmark files

    Give "benchmark.rb" a more descriptive name, and move it down into the
    "benchmarks" subdirectory.
    
    Updated some relative paths.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 22, 2014
  2. Greg Hurrell

    Talk to Watchman using its binary protocol

    A couple of people have reported problems building and using Command-T
    as a result of issues with the JSON library, which we started requiring
    in commit d24139e. For example, see:
    
      #68
    
    This commit removes that dependency, replacing it with an implementation
    of the Watchman binary protocol. As a bonus (and in fact, this was my
    initial motivation for starting to look at this, before I'd heard of
    JSON-related problems), this reduces the cost of communicating with
    Watchman by about half:
    
                              user     system      total        real
        watchman JSON     1.310000   0.250000   1.620000 (  5.784897)
        watchman binary   0.620000   0.220000   0.890000 (  3.839422)
    
    Those are the timings produced by running the script in
    bin/benchmarks/watchman.rb in a Watchman-monitored directory containing
    well over 300k files. The speed-up is due to the fact that the binary
    protocol format is much more compact, resulting in less data being
    transmitted over the socket, and also because parsing JSON is typically
    pretty slow.
    
    The protocol adapter added here has been written in a relatively
    straightforward way, without any hoop-jumping in the name of
    optimization. It would likely be possible to make it go even faster with
    some corner-cutting, but I don't really see the need for that at this
    point.
    
    I don't really test on Windows any more, so I've tried to make this safe
    on Windows by adding some checks for header files which I don't expect
    to be available there. On such a platform, compilation should still
    succeed, but the compiled code just has some stub modules in it which
    raise exceptions. Watchman doesn't work on Windows anyway, so Windows
    uses shouldn't really notice any difference.
    
    This is the first cut; I expect to do some more clean-up in follow-up
    commits.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 22, 2014

Mar 17, 2014

  1. Greg Hurrell

    Fix WatchmanFileScanner for Ruby < 1.9.2 compatibility

    `File.realpath` appeared in 1.9.2 (I believe), so swap it out for
    Pathname instead, which should work everywhere.
    
    Note that the call as it existed was not optimal anyway, as the call to
    `File.expand_path` was redundant.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 16, 2014

Mar 10, 2014

  1. Greg Hurrell

    Doc: correct time scale in TIPS section

    This was originally about 10 seconds, and then I switched to the JSON
    protocol and it got an order of magnitude better. (There is a binary
    protocol that will make it likely faster still, but I haven't gotten
    around to implementing that yet.)
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 09, 2014
  2. Greg Hurrell

    Update docs for 1.7 release

    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 09, 2014

Mar 06, 2014

  1. Greg Hurrell

    Improve pthread detection

    My initial attempts at this weren't ideal, as some people are having
    trouble building Command-T, especially those with older versions of
    Ruby:
    
      https://wincent.com/issues/2135
      https://wincent.com/issues/2153
      #65
    
    I'd forgotten about the `have_library` method in the `MakeMakefile`
    module, which not only checks for the presence of the library, but also
    modifies the list of libraries to be linked:
    
      http://ruby-doc.org/stdlib-2.1.0/libdoc/mkmf/rdoc/MakeMakefile.html#method-i-have_library
    
    Note that I guard all of this inside a `THREAD_MODEL` check. I believe
    this should prevent us from linking to pthread when the local Ruby has
    explicitly opted out of using pthread (common in older Ruby versions due
    to performance overhead).
    
    I tested this against a few versions of Ruby on my OS X box:
    
      1.8.7-p249
      1.9.1-p430
      1.9.2-p326
      1.9.3-p545
      2.0.0-p451
      2.1.0
      2.1.1
    
    With the command:
    
      ruby -r rbconfig -e 'puts RbConfig::CONFIG["THREAD_MODEL"]'
    
    This prints "pthread" on 1.9.1 and up, and on 1.8.7 it prints "nil". On
    2.0.0 and up `RbConfig` is always visible, so this works even without
    the `require`.
    
    Hopefully this will work pretty much everywhere. Fingers crossed.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    
    diff --git a/ruby/command-t/extconf.rb b/ruby/command-t/extconf.rb
    index eedeae0..44cfacc 100644
    --- a/ruby/command-t/extconf.rb
    +++ b/ruby/command-t/extconf.rb
    @@ -1,4 +1,4 @@
    -# Copyright 2010-2013 Wincent Colaiuta. All rights reserved.
    +# Copyright 2010-2014 Wincent Colaiuta. All rights reserved.
     #
     # Redistribution and use in source and binary forms, with or without
     # modification, are permitted provided that the following conditions are met:
    @@ -36,8 +36,10 @@ def header(item)
     header('stdlib.h')
     header('string.h')
    
    -# optional headers
    -have_header('pthread.h') # sets HAVE_PTHREAD_H if found
    +# optional
    +if RbConfig::CONFIG['THREAD_MODEL'] == 'pthread'
    +  have_library('pthread', 'pthread_create') # sets HAVE_PTHREAD_H if found
    +end
    
     RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
    authored March 06, 2014

Mar 05, 2014

  1. Greg Hurrell

    Convert a couple more settings manipulations in the MatchWindow class

    I originally didn't include these in the recent refactorings of the
    Settings class as they have a somewhat different lifecycle than the
    other settings changes made by the MatchWindow class (ie. most of the
    changes are made as a batch on initial display and restored at the end,
    but the `#lock` and `#unlock` calls can be made at distinct moments as
    the result of other methods being called).
    
    Nevertheless, they are `:setlocal` calls, so routing them through the
    Settings class is not going to disturb its internal state anyway. In the
    interests of reducing noise in the MatchWindow class and getting maximum
    re-use out of the Settings abstraction, this commit swaps them over to
    use the "DSL".
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 05, 2014
  2. Greg Hurrell

    Add a tiny "DSL" to reduce settings verbosity in MatchWindow class

    This reduces some of the noise in this file, at the minor cost of adding
    a non-obfuscating level of indirection.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 05, 2014
  3. Greg Hurrell

    Further abstract local vs global distinction inside Settings class

    Commit 514194c made the Settings class a little smarter. We can make the
    MatchWindow class (the sole client of the Settings class) simpler by
    burying the details about the distinction between local and global
    settings inside of the Settings class.
    
    Specifically, the Settings class knows which settings are global and
    which are local, so the calling MatchWindow class just tells it to apply
    settings and lets the Settings class worry about exactly how that should
    happen.
    
    This is a net increase in the number of lines, but worth it because the
    Settings class will be infrequently touched, and the more
    actively-modified MatchWindow class is simpler for it.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 05, 2014
  4. Greg Hurrell

    Fix controller spec failures

    With "judicious" stubbing. The amount of stubbing in this spec is an
    immense smell, but pursuing the quick fix in the name of getting the
    suite green again rather than engaging in a deeper reworking for now.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 04, 2014
  5. Greg Hurrell

    Move RubyFileScanner specs into subdirectory

    We had 4 remaining spec failures in this file; this commit tries to
    stick as close to being a straight move as possible to make it clear
    what's happening, but just moving the code makes the specs pass.
    
    The issue is that we recently factored some of the functionality of the
    FileScanner class into a RubyFileScanner subclass, so the specs for the
    FileScanner were seeking to verify behavior which was no longer present
    in the class.
    
    In this commit we split the specs out just as we split the FileScanner
    and RubyFileScanner functionality out. It moves the code into another
    file and changes the references to the FileScanner class to
    RubyFileScanner.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 04, 2014
  6. Greg Hurrell

    Apply ghastly hack to fix failing spec

    This is evidently breaking all the rules about encapsulation and not
    testing implementation details, but it's the quickest way to get this
    failing test passing again.
    
    (And note, it is not strictly worse than what was there before either,
    because the reason the test was broken was precisely because it was
    wedded to implementation details; it turns out that this spec is an
    assertion about implementation details...)
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 04, 2014

Mar 04, 2014

  1. Greg Hurrell

    Make Settings class more flexible, less brittle

    I hadn't touched this class for about 4 years, and this morning had to
    add another setting to it in order to fix a bug (see commit
    2861dc1). With a more flexible design, I could have left it
    untouched.
    
    This commit implements that design, teaching the settings class to
    fully mediate between the caller who wants to save/restore some
    settings, and Vim. It records the settings that are to be changed, makes
    the changes, and can restore the settings by "replaying" the recorded
    settings.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 04, 2014
  2. Greg Hurrell

    Don't clobber global 'updatetime' setting

    Commit ff72bd9 added input debouncing, and along with it a bug in which
    we were setting the global 'updatetime' setting and not restoring it.
    
    The default value of 50 could make some mappings such as <C-X>_<C-P>
    unlikely to work after opening Command-T.
    
    This commit saves and restores the setting on opening/closing the match
    window. I applied some local clean-up as well, making the controller's
    `#get_number` method accept a default argument.
    
    Thanks to Michael Jansen for the bug report.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored March 04, 2014

Feb 28, 2014

  1. Greg Hurrell

    Remove clearmatches() call

    This was causing problems with the vim-css-color plug-in, blowing away
    the matches that it was setting up. When I added this a long time ago in
    commit d06f51f, I thought it only affected the current window, but I was
    evidently wrong about that. (I'm guessing I probably didn't notice
    because I likely had some autocmd that was restoring the settings any
    time I opened a new file.)
    
    The original use case was to prevent the rules that I had set up to
    highlight long lines from applying in the Command-T match listing. There
    are better ways to do that kind of highlighting anyway (like the
    `'colorcolumn'` setting), so let's just remove the problematic call.
    
    See:
    
        ap/vim-css-color#31
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored February 27, 2014
  2. Greg Hurrell

    Merge branch 'shlomif/doc-typo-fix'

    * shlomif/doc-typo-fix:
      Add Shlomi Fish to the AUTHORS section
      Correct a typo
    authored February 27, 2014
  3. Greg Hurrell

    Add Shlomi Fish to the AUTHORS section

    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored February 27, 2014
  4. Shlomi Fish

    Correct a typo

    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored February 19, 2014 wincent committed February 27, 2014
  5. Greg Hurrell

    Merge branch 'dzhioev/threads_count_fix' into master

    * commit 'dzhioev/threads_count_fix':
      Add Pavel Sergeev to the credits
      Fix Util.processor_count method on some platforms
    authored February 27, 2014
  6. Greg Hurrell

    Add Pavel Sergeev to the credits

    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored February 27, 2014
  7. Pavel Sergeev

    Fix Util.processor_count method on some platforms

    RbConfig was not imported in util.rb. As a result processor_count always
    returned 1 from its rescue-branch on some platforms:
    
        $ ruby --version
        ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
        $ ruby -e "p RbConfig"
        -e:1: uninitialized constant RbConfig (NameError)
    
    Compare with:
    
        $ ruby --version
        ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
        $ ruby -e "p RbConfig"
        RbConfig
    
    Originally submitted as:
    
        #64
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored February 27, 2014 wincent committed February 27, 2014

Feb 12, 2014

  1. Greg Hurrell

    Update bundle

    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored February 11, 2014
  2. Greg Hurrell

    Fix edge case in "Find" scanner with relative path

    When Command-T was invoked with a path argument (eg. `:CommandT foo`),
    the paths in the listing would show up as "foo/thing" etc, and when
    selected would open as "foo/foo/thing" etc.
    
    This commit fixes that oversight, and brings the "Find" scanner back
    into line with the behavior of the default Ruby scanner. The Watchman
    scanner was unaffected by this bug, except in cases where it fell back
    to using the "Find" scanner as a backup.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored February 11, 2014

Feb 06, 2014

  1. Greg Hurrell

    Speed up WatchmanFileScanner by an order of magnitude

    It was already pretty fast (about 10 seconds on a large hierarchy that
    I've been testing it with), but this commit drops that to about 1
    second.
    
    I haven't profiled this to know exactly where the time was/is being
    spent, but this change massively reduces the payload that Watchman has
    to send over the socket (ie. just the name and none of the metadata, and
    only info for files rather than all tracked paths), which means quicker
    delivery of the payload, quicker parsing, and less memory pressure from
    intermediate objects.
    
    The way it was working before actually had one unintended behavior,
    which was to expose directories in the listing as well. This was kind of
    interesting, as Vim could "open" those directories for you. But it was
    also inconsistent with all the other scanners, and on a very large
    project, those directories could often get in the way of finding files,
    which is what this plug-in is all about.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored February 05, 2014

Feb 03, 2014

  1. Greg Hurrell

    Merge branch 'pluggable-file-scanners' into next

    * pluggable-file-scanners:
      Add "watchman" file scanner and accompanying documentation
      Remove contrib directory
      Finally commit of fswatcher files
      Simplify requiring of db and argv modules
      Exit on showing help
      Move options parsing into separate file
      Move DB wrapper into a separate file
      Disperse row operations during benchmarking
      Add args passing to fswatcher
      Add some more DB operations to complete benchmarks
      Add #bind method for use with prepared statements
      Add partial work-in-progress of fswatcher process
      Fix typo in Controller#delete method
      Silence potentially noisy stderr from `find` command
      Silence a warning from Linux `find`
      Add `find`-based scanner
      Move FileScanner into a FileScanner::RubyFileScanner subclass
    authored February 02, 2014
  2. Greg Hurrell

    Add "watchman" file scanner and accompanying documentation

    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored February 02, 2014
  3. Greg Hurrell

    Remove contrib directory

    It was an experiment, and I've since found what looks to be a much
    better and cheaper way.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
    authored February 02, 2014
Something went wrong with that request. Please try again.