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>
Junio C Hamano committed
May 11, 2011 at 15:23 UTC
93e7d672fcac8bdc16ae7276bc5942889aa3f179
1 file changed
+14
revision.c
+14
@@ -1589,6 +1589,20 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
1589
}
1590
1591
if (prune_data.nr) {
1592
+ /*
1593
+ * If we need to introduce the magic "a lone ':' means no
1594
+ * pathspec whatsoever", here is the place to do so.
1595
+ *
1596
+ * if (prune_data.nr == 1 && !strcmp(prune_data[0], ":")) {
1597
+ * prune_data.nr = 0;
1598
+ * prune_data.alloc = 0;
1599
+ * free(prune_data.path);
1600
+ * prune_data.path = NULL;
1601
+ * } else {
1602
+ * terminate prune_data.alloc with NULL and
1603
+ * call init_pathspec() to set revs->prune_data here.
1604
+ * }
1605
+ */
1606
ALLOC_GROW(prune_data.path, prune_data.nr+1, prune_data.alloc);
1607
prune_data.path[prune_data.nr++] = NULL;
1608
init_pathspec(&revs->prune_data,