diff options
-rw-r--r-- | man/grab.1 | 15 | ||||
-rw-r--r-- | src/grab.c | 13 |
2 files changed, 13 insertions, 15 deletions
@@ -1,4 +1,4 @@ -.Dd 23 January, 2024 +.Dd 24 January, 2024 .Dt GRAB 1 .Os Grab 2.1.1 .Sh NAME @@ -46,14 +46,11 @@ utility in all ways except for two exceptions. The first is that if no files .Pq globs in this case to be precise are specified, -input is not read from the standard-input but instead all files returned -by an invocation of -.Xr git\-ls\-files 1 -are processed. +input is not read from the standard-input but instead all non-binary +files found in the current git-repository are processed. If the user provides one or more globs, -only the files returned by -.Xr git\-ls\-files 1 -that match one or more of the given globs will be processed. +only the non-binary files in the current git-repository that match one or +more of the given globs will be processed. Secondly, the .Fl f option is not available; @@ -315,7 +312,7 @@ formatted manual pages: .Pp .Dl $ grab \-n 'x/^\e.Sh SYNOPSIS\en(^.*\en(?!^\e.Sh))+/' foo.1 bar.1 .Sh SEE ALSO -.Xr git\-ls\-files 1 , +.Xr git 1 , .Xr grep 1 , .Xr pcre2syntax 3 , .Xr regex 7 @@ -804,7 +804,7 @@ getfstream(int argc, char *argv[argc]) case -1: die("fork"); case 0:; - size_t len = argc + 5; + size_t len = argc + 6; char **args; close(fds[FD_R]); @@ -815,14 +815,15 @@ getfstream(int argc, char *argv[argc]) if (!(args = malloc(len * sizeof(char *)))) die("malloc"); args[0] = "git"; - args[1] = "ls-files"; - args[2] = "-z"; - args[3] = "--"; - memcpy(args + 4, argv, argc * sizeof(char *)); + args[1] = "grep"; + args[2] = "--cached"; + args[3] = "-Ilz"; + args[4] = ""; + memcpy(args + 5, argv, argc * sizeof(char *)); args[len - 1] = nullptr; execvp("git", args); - die("execvp: git ls-files -z"); + die("execvp: git grep --cached -Ilz ''"); } close(fds[FD_W]); |