summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-11 15:23:25 -0700
committerJunio C Hamano <gitster@pobox.com>2011-05-11 15:23:25 -0700
commit93e7d672fcac8bdc16ae7276bc5942889aa3f179 (patch)
treebffe1f95d473085fcc28b368ac01e70b75a5ac64 /revision.c
parent25197ebe7f813407b028a2c304ff8ee58da40a16 (diff)
downloadgit-93e7d672fcac8bdc16ae7276bc5942889aa3f179.tar.gz
revision.c: leave a note for "a lone :" enhancement
If we later add a command in the log family that by default limit its operation to the current subdirectory, we would need to resurrect the "a lone ':' on the command line means no pathspec whatsoever". Now the codepath was cleaned up, we can do so in one place. Leave a note to mark where it is for later generations. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index e571a3fd10..17f9fcb966 100644
--- a/revision.c
+++ b/revision.c
@@ -1589,6 +1589,20 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
}
if (prune_data.nr) {
+ /*
+ * If we need to introduce the magic "a lone ':' means no
+ * pathspec whatsoever", here is the place to do so.
+ *
+ * if (prune_data.nr == 1 && !strcmp(prune_data[0], ":")) {
+ * prune_data.nr = 0;
+ * prune_data.alloc = 0;
+ * free(prune_data.path);
+ * prune_data.path = NULL;
+ * } else {
+ * terminate prune_data.alloc with NULL and
+ * call init_pathspec() to set revs->prune_data here.
+ * }
+ */
ALLOC_GROW(prune_data.path, prune_data.nr+1, prune_data.alloc);
prune_data.path[prune_data.nr++] = NULL;
init_pathspec(&revs->prune_data,