Commit graph

2058 commits

Author SHA1 Message Date
66e255d355 Better CPU affinity, if ag is invoked with a nontrivial CPU mask
On a Ryzen 5700U CPU, Linux 5.10.0, Debian bullseye, and `nosmt` on the
kernel commandline, every task is effectively pinned to the CPU mask
0x5555:
```
On-line CPU(s) list:             0,2,4,6,8,10,12,14
Off-line CPU(s) list:            1,3,5,7,9,11,13,15
```

In order to avoid failures of `pthread_setaffinity_np`, check the CPUs
that the main thread has available (and use it to set num_cores!) and
then each time a thread is created, find the next set bit.

This also fixes the behavior when ag is deliberately pinned to some
smaller number of CPUs than those on-line:
```
$ taskset 0x5555 ./ag -D booboo | ag "Using \d+ workers"
DEBUG: Using 7 workers
$ taskset 0x55 ag -D booboo | ag "Using \d+ workers"
DEBUG: Using 3 workers
```
2021-09-01 09:26:56 -05:00
Geoff Greer
a61f1780b6
Merge pull request #1424 from sanjaymsh/ppc64le
Travis-ci: added support for ppc64le
2020-12-16 17:09:07 -08:00
sanjay-cpu
0da08b76af Travis-ci: added support for ppc64le 2020-12-11 07:18:23 +00:00
Geoff Greer
5a1c8d83ba Fix test. 2020-07-04 12:27:44 -07:00
Geoff Greer
cb9941b4bb
Merge pull request #1393 from JFLarvoire/winget
Document how to install ag.exe for Windows using winget
2020-07-04 12:22:31 -07:00
JFLarvoire
ed0fe56e79 Document how to install ag.exe for Windows using winget 2020-06-29 18:17:37 +02:00
Geoff Greer
5600c1b6b1
Merge pull request #1389 from aswild/getenv-segfault
options: fix segfault when TERM or HOME isn't set
2020-06-26 11:49:34 -07:00
Geoff Greer
6169c2d608
Merge pull request #1392 from corelight-chris/master
Change bro filetype support to zeek.
2020-06-26 11:48:57 -07:00
Geoff Greer
9b23390076
Merge pull request #1390 from matthewhughes934/fix-list_file_types-test
Add missing whitespace to test
2020-06-26 11:48:44 -07:00
Christopher M. Hobbs
01f2a97ab6 Change bro filetype support to zeek. 2020-06-25 17:19:16 -05:00
Allen Wild
0da483f0a5 tests: add empty_environment test, fix whitespace in list_file_types
Verify that ag works with no environment variables set.
2020-06-22 11:17:40 -04:00
Matthew Hughes
d949e71d9d Add missing whitespace to test
This fixes the failing test.

* Add missing indentation (missed in c95d72f)
* Add missing newline at end of file (removed with 328afb2)
2020-06-22 15:55:24 +01:00
Allen Wild
1dae7a25a3 options: fix segfault when TERM or HOME isn't set
Regression from 3289ab8fba, if TERM isn't
set in the environment, getenv returns NULL which we shouldn't strcmp.
Similarly guard against using home_dir if it's null when looking for
global gitignore files.

This can be reproduced and tested with `env -i ./ag foo`.
2020-06-22 00:14:30 -04:00
Geoff Greer
a9917e4490
Merge pull request #1326 from Redfoxymoon/master
midipix support
2020-06-20 17:09:43 -07:00
Geoff Greer
cd0705f12a
Merge pull request #1350 from sergeyklay/feature/zephir-support
Add Zephir support
2020-06-20 17:09:22 -07:00
Geoff Greer
8a7032e89b
Merge pull request #1387 from yymm/master
Add support for Vue SFC
2020-06-20 17:08:02 -07:00
Geoff Greer
f7b15a0b03
Merge pull request #1384 from felipefiali/master
Add support for Bazel files
2020-06-20 17:07:50 -07:00
Geoff Greer
3f6ecb6c02
Merge pull request #1377 from shlomif/fix-multi-defs-of-globals
Fix multiple global symbols definitions.
2020-06-20 17:07:07 -07:00
Geoff Greer
092d73b190
Merge pull request #1330 from MicahElliott/clojure-add-edn-file-type
Add .edn file type for clojure files
2020-06-19 18:40:58 -07:00
Geoff Greer
56e73c9f0a
Merge pull request #1332 from wgrr/nodefault-color
Default to no color when $TERM is dumb
2020-06-19 18:40:29 -07:00
Geoff Greer
0aa76d6bfe
Merge pull request #1383 from Alexis-D/ad/add-gradle
Add --gradle
2020-06-19 18:40:07 -07:00
Geoff Greer
6342a8ed28
Merge pull request #1374 from equwal/master
Update link to ack3
2020-06-19 17:31:59 -07:00
Geoff Greer
e55cc9baa6
Merge pull request #1372 from dzmitry-lahoda/patch-1
added fzf
2020-06-19 17:31:45 -07:00
Geoff Greer
4fc15ecd70
Merge pull request #1359 from nbarrios1337/fix_bash_completion
Update bash completion script to reflect v2.0 changes
2020-06-19 17:28:13 -07:00
Geoff Greer
594c447d28
Merge pull request #1362 from veprbl/patch-1
README: add NixOS/Nix/Nixpkgs instructions
2020-06-19 17:27:55 -07:00
yuya yano
cbebe3b77e Add support for Vue SFC 2020-06-09 14:57:14 +09:00
Felipe Fiali
c95d72f3e7 Add support for Bazel files 2020-05-26 10:55:25 +02:00
Alexis Daboville
31376c9c5c Add --gradle 2020-05-22 16:24:54 +01:00
Shlomi Fish
21eaa1c416 Fix multiple global symbols definitions.
See the use of extern here:

* https://www.geeksforgeeks.org/understanding-extern-keyword-in-c/

* https://en.wikipedia.org/wiki/External_variable

*
https://stackoverflow.com/questions/496448/how-to-correctly-use-the-extern-keyword-in-c
2020-04-15 20:26:10 +03:00
Spenser Truex
293697938c Update link to ack3
New version has a new repo.
2020-03-28 15:41:46 -07:00
Dzmitry Lahoda
cba17bc01f
added fzf 2020-03-25 15:01:24 +03:00
Dmitry Kalinkin
232b85bed5
README: add NixOS/Nix/Nixpkgs instructions 2020-02-27 11:10:26 -05:00
Geoff Greer
b93c271993
Merge pull request #1358 from gliptak/patch-1
Bring Ubuntu to 16.04 in Travis
2020-02-24 15:18:49 -08:00
Nicolas Barrios
860046891c
Updated bash completion script to reflect v2.0 changes 2020-02-21 14:01:01 -05:00
Gábor Lipták
9fc018f0f1
Bring Ubuntu to 16.04 in Travis 2020-02-18 10:26:31 -05:00
Geoff Greer
a509a8172b Fix formatting. 2020-01-10 11:25:39 -08:00
Geoff Greer
de3e3c7cac
Merge pull request #1354 from emoses/master
Fix ignore patterns in subdirectories with leading slashes
2020-01-10 11:23:05 -08:00
Evan Moses
755c6e5c06 Fix ignore patterns in subdirectories with leading slashes
Currenetly if you have an ignore file in a subdirectory "sub" with a pattern
like
    /ignorethis
The directory sub/ignorethis will be ignored if you run ag from
within sub, but it won't be ignored if you run it from sub's parent.
that is

    $ ag needle

will search files in sub/ignorethis, but

    $ cd sub
    $ ag needle

Will not.  This is a bug
2020-01-09 17:34:44 -08:00
Serghei Iakovlev
328afb27d3
Add Zephir support 2019-12-20 12:58:32 +02:00
Wagner Riffel
3289ab8fba default to no color when terminal is dumb
Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
2019-08-18 22:49:50 -03:00
Micah Elliott
c1514aeee0 Add .edn file type for clojure files
It's common that you'd want edn files to show up in your clojure
searching.

https://github.com/edn-format/edn
2019-08-13 10:47:17 -07:00
Ørjan Malde
b34f3e385e
midipix support
midipix uses the musl libc, which provides the same bits as on linux.
2019-06-29 23:13:49 +02:00
Geoff Greer
965f71dcbc
Merge pull request #1245 from kpengboy/fix_-L
Fix -L again and decouple from -v
2019-03-22 09:11:11 -07:00
Geoff Greer
55eaaddab5
Merge pull request #1306 from brianary/feature-windows-extensions
Add various Windows extensions
2019-03-18 19:30:42 -07:00
Geoff Greer
20941e2bfd
Merge pull request #1310 from DeeeeLAN/verilog/work
added .svh for verilog
2019-03-18 19:30:18 -07:00
Dillan Mills
41fd43f48c added .svh for verilog 2019-03-05 22:56:28 -07:00
Brian Lalonde
09a7c68921 Fix trailing whitespace 2019-02-18 20:18:56 -08:00
Brian Lalonde
c951fc2c40 Add various Windows extensions 2019-02-18 20:12:07 -08:00
Geoff Greer
4f7aca7b01
Merge pull request #1270 from zealoussnow/fix-rpmbuild-error
fix rpmbuild error
2019-02-16 11:41:03 -08:00
Geoff Greer
7c70fe3b9b
Merge pull request #1287 from jacwah/pipe-link
Skip symlinks to named pipes
2019-01-17 17:20:17 -08:00