[PATCH/alternative/raw and rough] setup.c: denote repo wide pathspecs by ':'
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- Mar 1, 2011, 10:21 UTC
- Message-ID
- <bc49592f5e524a0d12aa55eeca1c5ca659b6525f.1298974647.git.git@drmicha.warpmail.net>
- In-Reply-To
- <AANLkTi=xrnxUtkayyW1Merh49N6uHy5p-GMrYe6+p==t@mail.gmail.com>
Introduce a leading ':' as the notation for repo-wide pathspecs.
This is in line with our treeish:path notation which defaults to repowide paths.
Heck: Even ':./path' works for pathspecs, and I have no clue why!
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> --- I have not tested this for adverse side effects, only for the intended ones with "git grep".
It's an alternative to "--full-tree", more far reaching, maybe too far. But we seem to accept that paths do not start with ':', and that notation should make msys happy, but what do I know about msys.
(one could stick this into prefix_path() rather than get_pathspec(), but that would be way too far)
setup.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/setup.c b/setup.c index 021d013..e7b05f0 100644 --- a/setup.c +++ b/setup.c @@ -147,7 +147,11 @@ const char **get_pathspec(const char *prefix, const char **pathspec) dst = pathspec; prefixlen = prefix ? strlen(prefix) : 0; while (*src) { - const char *p = prefix_path(prefix, prefixlen, *src); + const char *p; + if ((*src)[0] == ':') + p = prefix_path(NULL, 0, (*src)+1); + else + p = prefix_path(prefix, prefixlen, *src); *(dst++) = p; src++; }
-- 1.7.4.1.257.gb09fa