[PATCH/alternative/raw and rough] setup.c: denote repo wide pathspecs by ':'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]