{"thread":{"id":"49963","subject":"[PATCH] terminology tweak: prune -> path limiting","startedAt":"2018-12-06T21:34:17Z","lastAt":"2018-12-11T05:16:07Z","messageCount":6,"participants":["Matthew DeVore","Junio C Hamano","MATTHEW DEVORE"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"364709","messageId":"20181206213315.64423-1-matvore@google.com","threadId":"49963","inReplyTo":null,"subject":"[PATCH] terminology tweak: prune -> path limiting","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-12-06T21:33:15Z","receivedAt":"2018-12-06T21:34:17Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"In the codebase, \"prune\" is a highly overloaded term, and it caused me a\nlot of trouble to figure out what it meant when it was used in the\ncontext of path limiting. Stop using the word \"prune\" when we really\nmean \"path limiting.\"\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n Documentation/technical/api-history-graph.txt |  5 +-\n builtin/add.c                                 |  4 +-\n builtin/diff.c                                |  8 +-\n builtin/fast-export.c                         |  2 +-\n builtin/log.c                                 |  2 +-\n builtin/rev-list.c                            |  2 +-\n diff-lib.c                                    |  6 +-\n revision.c                                    | 90 ++++++++++---------\n revision.h                                    |  4 +-\n t/t7811-grep-open.sh                          |  2 +-\n tree-walk.c                                   | 10 +--\n wt-status.c                                   |  4 +-\n 12 files changed, 72 insertions(+), 67 deletions(-)\n\ndiff --git a/Documentation/technical/api-history-graph.txt b/Documentation/technical/api-history-graph.txt\nindex d0d1707c8c..f9a100f88c 100644\n--- a/Documentation/technical/api-history-graph.txt\n+++ b/Documentation/technical/api-history-graph.txt\n@@ -100,8 +100,9 @@ Limitations\n   on all parents of that commit.  Parents must not be skipped, or the graph\n   output will appear incorrect.\n +\n-`graph_update()` may be used on a pruned set of commits only if the parent list\n-has been rewritten so as to include only ancestors from the pruned set.\n+`graph_update()` may be used on a pruned (e.g. path-limited) set of commits only\n+if the parent list has been rewritten so as to include only ancestors from the\n+pruned set.\n \n * The graph API does not currently support reverse commit ordering.  In\n   order to implement reverse ordering, the graphing API needs an\ndiff --git a/builtin/add.c b/builtin/add.c\nindex f65c172299..4abd8ebba8 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -113,14 +113,14 @@ int add_files_to_cache(const char *prefix,\n \trepo_init_revisions(the_repository, &rev, prefix);\n \tsetup_revisions(0, NULL, &rev, NULL);\n \tif (pathspec)\n-\t\tcopy_pathspec(&rev.prune_data, pathspec);\n+\t\tcopy_pathspec(&rev.path_limits, pathspec);\n \trev.diffopt.output_format = DIFF_FORMAT_CALLBACK;\n \trev.diffopt.format_callback = update_callback;\n \trev.diffopt.format_callback_data = &data;\n \trev.diffopt.flags.override_submodule_config = 1;\n \trev.max_count = 0; /* do not compare unmerged paths with stage #2 */\n \trun_diff_files(&rev, DIFF_RACY_IS_MODIFIED);\n-\tclear_pathspec(&rev.prune_data);\n+\tclear_pathspec(&rev.path_limits);\n \treturn !!data.add_errors;\n }\n \ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex f0393bba23..9010b3228a 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -74,8 +74,8 @@ static int builtin_diff_b_f(struct rev_info *revs,\n \tif (argc > 1)\n \t\tusage(builtin_diff_usage);\n \n-\tGUARD_PATHSPEC(&revs->prune_data, PATHSPEC_FROMTOP | PATHSPEC_LITERAL);\n-\tpath = revs->prune_data.items[0].match;\n+\tGUARD_PATHSPEC(&revs->path_limits, PATHSPEC_FROMTOP | PATHSPEC_LITERAL);\n+\tpath = revs->path_limits.items[0].match;\n \n \tif (lstat(path, &st))\n \t\tdie_errno(_(\"failed to stat '%s'\"), path);\n@@ -421,8 +421,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \t\t\tdie(_(\"unhandled object '%s' given.\"), name);\n \t\t}\n \t}\n-\tif (rev.prune_data.nr)\n-\t\tpaths += rev.prune_data.nr;\n+\tif (rev.path_limits.nr)\n+\t\tpaths += rev.path_limits.nr;\n \n \t/*\n \t * Now, do the arguments look reasonable?\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 9e283482ef..6a675b5737 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -1143,7 +1143,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)\n \t\timport_marks(import_filename);\n \tlastimportid = last_idnum;\n \n-\tif (import_filename && revs.prune_data.nr)\n+\tif (import_filename && revs.path_limits.nr)\n \t\tfull_tree = 1;\n \n \tget_tags_and_duplicates(&revs.cmdline);\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 45aa376a59..f8554d7fa1 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -690,7 +690,7 @@ static void log_setup_revisions_tweak(struct rev_info *rev,\n \t\t\t\t      struct setup_revision_opt *opt)\n {\n \tif (rev->diffopt.flags.default_follow_renames &&\n-\t    rev->prune_data.nr == 1)\n+\t    rev->path_limits.nr == 1)\n \t\trev->diffopt.flags.follow_renames = 1;\n \n \t/* Turn --cc/-c into -p --cc/-c when -p was not given */\ndiff --git a/builtin/rev-list.c b/builtin/rev-list.c\nindex 3a2c0c23b6..edb0799533 100644\n--- a/builtin/rev-list.c\n+++ b/builtin/rev-list.c\n@@ -517,7 +517,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)\n \tif (show_progress)\n \t\tprogress = start_delayed_progress(show_progress, 0);\n \n-\tif (use_bitmap_index && !revs.prune) {\n+\tif (use_bitmap_index && !revs.path_limiting) {\n \t\tif (revs.count && !revs.left_right && !revs.cherry_mark) {\n \t\t\tuint32_t commit_count;\n \t\t\tint max_count = revs.max_count;\ndiff --git a/diff-lib.c b/diff-lib.c\nindex 23c8d351b3..431bed0e5a 100644\n--- a/diff-lib.c\n+++ b/diff-lib.c\n@@ -110,7 +110,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)\n \t\tif (diff_can_quit_early(&revs->diffopt))\n \t\t\tbreak;\n \n-\t\tif (!ce_path_match(istate, ce, &revs->prune_data, NULL))\n+\t\tif (!ce_path_match(istate, ce, &revs->path_limits, NULL))\n \t\t\tcontinue;\n \n \t\tif (ce_stage(ce)) {\n@@ -477,7 +477,7 @@ static int oneway_diff(const struct cache_entry * const *src,\n \n \tif (ce_path_match(revs->diffopt.repo->index,\n \t\t\t  idx ? idx : tree,\n-\t\t\t  &revs->prune_data, NULL)) {\n+\t\t\t  &revs->path_limits, NULL)) {\n \t\tdo_oneway_diff(o, idx, tree);\n \t\tif (diff_can_quit_early(&revs->diffopt)) {\n \t\t\to->exiting_early = 1;\n@@ -543,7 +543,7 @@ int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)\n \tstruct rev_info revs;\n \n \trepo_init_revisions(opt->repo, &revs, NULL);\n-\tcopy_pathspec(&revs.prune_data, &opt->pathspec);\n+\tcopy_pathspec(&revs.path_limits, &opt->pathspec);\n \trevs.diffopt = *opt;\n \n \tif (diff_cache(&revs, tree_oid, NULL, 1))\ndiff --git a/revision.c b/revision.c\nindex 13e0519c02..156a89b7f0 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -488,7 +488,7 @@ static int rev_compare_tree(struct rev_info *revs,\n \t\t * tagged commit by specifying both --simplify-by-decoration\n \t\t * and pathspec.\n \t\t */\n-\t\tif (!revs->prune_data.nr)\n+\t\tif (!revs->path_limits.nr)\n \t\t\treturn REV_TREE_SAME;\n \t}\n \n@@ -616,14 +616,14 @@ static unsigned update_treesame(struct rev_info *revs, struct commit *commit)\n static inline int limiting_can_increase_treesame(const struct rev_info *revs)\n {\n \t/*\n-\t * TREESAME is irrelevant unless prune && dense;\n+\t * TREESAME is irrelevant unless path_limiting && dense;\n \t * if simplify_history is set, we can't have a mixture of TREESAME and\n \t *    !TREESAME INTERESTING parents (and we don't have treesame[]\n \t *    decoration anyway);\n \t * if first_parent_only is set, then the TREESAME flag is locked\n \t *    against the first parent (and again we lack treesame[] decoration).\n \t */\n-\treturn revs->prune && revs->dense &&\n+\treturn revs->path_limiting && revs->dense &&\n \t       !revs->simplify_history &&\n \t       !revs->first_parent_only;\n }\n@@ -638,7 +638,7 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit)\n \t/*\n \t * If we don't do pruning, everything is interesting\n \t */\n-\tif (!revs->prune)\n+\tif (!revs->path_limiting)\n \t\treturn;\n \n \tif (!get_commit_tree(commit))\n@@ -786,7 +786,7 @@ static int process_parents(struct rev_info *revs, struct commit *commit,\n \n \t/*\n \t * If the commit is uninteresting, don't try to\n-\t * prune parents - we want the maximal uninteresting\n+\t * path limit parents - we want the maximal uninteresting\n \t * set.\n \t *\n \t * Normally we haven't parsed the parent\n@@ -1511,8 +1511,8 @@ static void prepare_show_merge(struct rev_info *revs)\n \tstruct commit_list *bases;\n \tstruct commit *head, *other;\n \tstruct object_id oid;\n-\tconst char **prune = NULL;\n-\tint i, prune_num = 1; /* counting terminating NULL */\n+\tconst char **limiting_paths = NULL;\n+\tint i, limiting_paths_num = 1; /* counting terminating NULL */\n \tstruct index_state *istate = revs->repo->index;\n \n \tif (get_oid(\"HEAD\", &oid))\n@@ -1535,19 +1535,20 @@ static void prepare_show_merge(struct rev_info *revs)\n \t\tconst struct cache_entry *ce = istate->cache[i];\n \t\tif (!ce_stage(ce))\n \t\t\tcontinue;\n-\t\tif (ce_path_match(istate, ce, &revs->prune_data, NULL)) {\n-\t\t\tprune_num++;\n-\t\t\tREALLOC_ARRAY(prune, prune_num);\n-\t\t\tprune[prune_num-2] = ce->name;\n-\t\t\tprune[prune_num-1] = NULL;\n+\t\tif (ce_path_match(istate, ce, &revs->path_limits, NULL)) {\n+\t\t\tlimiting_paths_num++;\n+\t\t\tREALLOC_ARRAY(limiting_paths, limiting_paths_num);\n+\t\t\tlimiting_paths[limiting_paths_num-2] = ce->name;\n+\t\t\tlimiting_paths[limiting_paths_num-1] = NULL;\n \t\t}\n \t\twhile ((i+1 < istate->cache_nr) &&\n \t\t       ce_same_name(ce, istate->cache[i+1]))\n \t\t\ti++;\n \t}\n-\tclear_pathspec(&revs->prune_data);\n-\tparse_pathspec(&revs->prune_data, PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,\n-\t\t       PATHSPEC_PREFER_FULL | PATHSPEC_LITERAL_PATH, \"\", prune);\n+\tclear_pathspec(&revs->path_limits);\n+\tparse_pathspec(&revs->path_limits, PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,\n+\t\t       PATHSPEC_PREFER_FULL | PATHSPEC_LITERAL_PATH, \"\",\n+\t\t       limiting_paths);\n \trevs->limited = 1;\n }\n \n@@ -1736,14 +1737,14 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs, int flags, unsi\n }\n \n static void read_pathspec_from_stdin(struct rev_info *revs, struct strbuf *sb,\n-\t\t\t\t     struct argv_array *prune)\n+\t\t\t\t     struct argv_array *limiting_paths)\n {\n \twhile (strbuf_getline(sb, stdin) != EOF)\n-\t\targv_array_push(prune, sb->buf);\n+\t\targv_array_push(limiting_paths, sb->buf);\n }\n \n static void read_revisions_from_stdin(struct rev_info *revs,\n-\t\t\t\t      struct argv_array *prune)\n+\t\t\t\t      struct argv_array *limiting_paths)\n {\n \tstruct strbuf sb;\n \tint seen_dashdash = 0;\n@@ -1769,7 +1770,7 @@ static void read_revisions_from_stdin(struct rev_info *revs,\n \t\t\tdie(\"bad revision '%s'\", sb.buf);\n \t}\n \tif (seen_dashdash)\n-\t\tread_pathspec_from_stdin(revs, &sb, prune);\n+\t\tread_pathspec_from_stdin(revs, &sb, limiting_paths);\n \n \tstrbuf_release(&sb);\n \twarn_on_object_refname_ambiguity = save_warning;\n@@ -1884,7 +1885,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n \t\trevs->simplify_history = 0;\n \t\trevs->simplify_by_decoration = 1;\n \t\trevs->limited = 1;\n-\t\trevs->prune = 1;\n+\t\trevs->path_limiting = 1;\n \t\tload_ref_decorations(NULL, DECORATE_SHORT_REFS);\n \t} else if (!strcmp(arg, \"--date-order\")) {\n \t\trevs->sort_order = REV_SORT_BY_COMMIT_DATE;\n@@ -2338,7 +2339,7 @@ static void NORETURN diagnose_missing_default(const char *def)\n int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct setup_revision_opt *opt)\n {\n \tint i, flags, left, seen_dashdash, got_rev_arg = 0, revarg_opt;\n-\tstruct argv_array prune_data = ARGV_ARRAY_INIT;\n+\tstruct argv_array path_limits = ARGV_ARRAY_INIT;\n \tconst char *submodule = NULL;\n \n \tif (opt)\n@@ -2356,7 +2357,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t\targv[i] = NULL;\n \t\t\targc = i;\n \t\t\tif (argv[i + 1])\n-\t\t\t\targv_array_pushv(&prune_data, argv + i + 1);\n+\t\t\t\targv_array_pushv(&path_limits, argv + i + 1);\n \t\t\tseen_dashdash = 1;\n \t\t\tbreak;\n \t\t}\n@@ -2387,7 +2388,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t\t\t}\n \t\t\t\tif (revs->read_from_stdin++)\n \t\t\t\t\tdie(\"--stdin given twice?\");\n-\t\t\t\tread_revisions_from_stdin(revs, &prune_data);\n+\t\t\t\tread_revisions_from_stdin(revs, &path_limits);\n \t\t\t\tcontinue;\n \t\t\t}\n \n@@ -2416,32 +2417,32 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t\tfor (j = i; j < argc; j++)\n \t\t\t\tverify_filename(revs->prefix, argv[j], j == i);\n \n-\t\t\targv_array_pushv(&prune_data, argv + i);\n+\t\t\targv_array_pushv(&path_limits, argv + i);\n \t\t\tbreak;\n \t\t}\n \t\telse\n \t\t\tgot_rev_arg = 1;\n \t}\n \n-\tif (prune_data.argc) {\n+\tif (path_limits.argc) {\n \t\t/*\n \t\t * If we need to introduce the magic \"a lone ':' means no\n \t\t * pathspec whatsoever\", here is the place to do so.\n \t\t *\n-\t\t * if (prune_data.nr == 1 && !strcmp(prune_data[0], \":\")) {\n-\t\t *\tprune_data.nr = 0;\n-\t\t *\tprune_data.alloc = 0;\n-\t\t *\tfree(prune_data.path);\n-\t\t *\tprune_data.path = NULL;\n+\t\t * if (path_limits.nr == 1 && !strcmp(path_limits[0], \":\")) {\n+\t\t *\tpath_limits.nr = 0;\n+\t\t *\tpath_limits.alloc = 0;\n+\t\t *\tfree(path_limits.path);\n+\t\t *\tpath_limits.path = NULL;\n \t\t * } else {\n-\t\t *\tterminate prune_data.alloc with NULL and\n-\t\t *\tcall init_pathspec() to set revs->prune_data here.\n+\t\t *\tterminate path_limits.alloc with NULL and\n+\t\t *\tcall init_pathspec() to set revs->path_limits here.\n \t\t * }\n \t\t */\n-\t\tparse_pathspec(&revs->prune_data, 0, 0,\n-\t\t\t       revs->prefix, prune_data.argv);\n+\t\tparse_pathspec(&revs->path_limits, 0, 0,\n+\t\t\t       revs->prefix, path_limits.argv);\n \t}\n-\targv_array_clear(&prune_data);\n+\targv_array_clear(&path_limits);\n \n \tif (revs->def == NULL)\n \t\trevs->def = opt ? opt->def : NULL;\n@@ -2475,14 +2476,17 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \tif (revs->topo_order && !generation_numbers_enabled(the_repository))\n \t\trevs->limited = 1;\n \n-\tif (revs->prune_data.nr) {\n-\t\tcopy_pathspec(&revs->pruning.pathspec, &revs->prune_data);\n-\t\t/* Can't prune commits with rename following: the paths change.. */\n+\tif (revs->path_limits.nr) {\n+\t\tcopy_pathspec(&revs->pruning.pathspec, &revs->path_limits);\n+\t\t/*\n+\t\t * Can't path-limit commits with rename following; the paths\n+\t\t * change.\n+\t\t */\n \t\tif (!revs->diffopt.flags.follow_renames)\n-\t\t\trevs->prune = 1;\n+\t\t\trevs->path_limiting = 1;\n \t\tif (!revs->full_diff)\n \t\t\tcopy_pathspec(&revs->diffopt.pathspec,\n-\t\t\t\t      &revs->prune_data);\n+\t\t\t\t      &revs->path_limits);\n \t}\n \tif (revs->combine_merges)\n \t\trevs->ignore_merges = 0;\n@@ -2845,7 +2849,7 @@ static void simplify_merges(struct rev_info *revs)\n \tstruct commit_list *yet_to_do, **tail;\n \tstruct commit *commit;\n \n-\tif (!revs->prune)\n+\tif (!revs->path_limiting)\n \t\treturn;\n \n \t/* feed the list reversed */\n@@ -3361,7 +3365,7 @@ enum commit_action get_commit_action(struct rev_info *revs, struct commit *commi\n \t}\n \tif (!commit_match(commit, revs))\n \t\treturn commit_ignore;\n-\tif (revs->prune && revs->dense) {\n+\tif (revs->path_limiting && revs->dense) {\n \t\t/* Commit without changes? */\n \t\tif (commit->object.flags & TREESAME) {\n \t\t\tint n;\n@@ -3446,7 +3450,7 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit)\n \tenum commit_action action = get_commit_action(revs, commit);\n \n \tif (action == commit_show &&\n-\t    revs->prune && revs->dense && want_ancestry(revs)) {\n+\t    revs->path_limiting && revs->dense && want_ancestry(revs)) {\n \t\t/*\n \t\t * --full-diff on simplified parents is no good: it\n \t\t * will show spurious changes from the commits that\ndiff --git a/revision.h b/revision.h\nindex 7987bfcd2e..88b7451362 100644\n--- a/revision.h\n+++ b/revision.h\n@@ -87,7 +87,7 @@ struct rev_info {\n \t/* Basic information */\n \tconst char *prefix;\n \tconst char *def;\n-\tstruct pathspec prune_data;\n+\tstruct pathspec path_limits;\n \n \t/*\n \t * Whether the arguments parsed by setup_revisions() included any\n@@ -111,7 +111,7 @@ struct rev_info {\n \n \t/* Traversal flags */\n \tunsigned int\tdense:1,\n-\t\t\tprune:1,\n+\t\t\tpath_limiting:1,\n \t\t\tno_walk:2,\n \t\t\tremove_empty_trees:1,\n \t\t\tsimplify_history:1,\ndiff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh\nindex d1ebfd88c7..79af1b7187 100755\n--- a/t/t7811-grep-open.sh\n+++ b/t/t7811-grep-open.sh\n@@ -23,7 +23,7 @@ enum grep_pat_token {\n \ttest_commit add-user revision.c \"\n \t}\n \tif (seen_dashdash)\n-\t\tread_pathspec_from_stdin(revs, &sb, prune);\n+\t\tread_pathspec_from_stdin(revs, &sb, limiting_paths);\n \tstrbuf_release(&sb);\n }\n \ndiff --git a/tree-walk.c b/tree-walk.c\nindex 79bafbd1a2..b60170b6b4 100644\n--- a/tree-walk.c\n+++ b/tree-walk.c\n@@ -365,10 +365,10 @@ static void free_extended_entry(struct tree_desc_x *t)\n \t}\n }\n \n-static inline int prune_traversal(struct name_entry *e,\n-\t\t\t\t  struct traverse_info *info,\n-\t\t\t\t  struct strbuf *base,\n-\t\t\t\t  int still_interesting)\n+static inline int path_limit_traversal(struct name_entry *e,\n+\t\t\t\t       struct traverse_info *info,\n+\t\t\t\t       struct strbuf *base,\n+\t\t\t\t       int still_interesting)\n {\n \tif (!info->pathspec || still_interesting == 2)\n \t\treturn 2;\n@@ -461,7 +461,7 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)\n \t\t}\n \t\tif (!mask)\n \t\t\tbreak;\n-\t\tinteresting = prune_traversal(e, info, &base, interesting);\n+\t\tinteresting = path_limit_traversal(e, info, &base, interesting);\n \t\tif (interesting < 0)\n \t\t\tbreak;\n \t\tif (interesting) {\ndiff --git a/wt-status.c b/wt-status.c\nindex 0fe3bcd4cd..b0a3efea4b 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -603,7 +603,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)\n \trev.diffopt.detect_rename = s->detect_rename >= 0 ? s->detect_rename : rev.diffopt.detect_rename;\n \trev.diffopt.rename_limit = s->rename_limit >= 0 ? s->rename_limit : rev.diffopt.rename_limit;\n \trev.diffopt.rename_score = s->rename_score >= 0 ? s->rename_score : rev.diffopt.rename_score;\n-\tcopy_pathspec(&rev.prune_data, &s->pathspec);\n+\tcopy_pathspec(&rev.path_limits, &s->pathspec);\n \trun_diff_files(&rev, 0);\n }\n \n@@ -639,7 +639,7 @@ static void wt_status_collect_changes_index(struct wt_status *s)\n \trev.diffopt.detect_rename = s->detect_rename >= 0 ? s->detect_rename : rev.diffopt.detect_rename;\n \trev.diffopt.rename_limit = s->rename_limit >= 0 ? s->rename_limit : rev.diffopt.rename_limit;\n \trev.diffopt.rename_score = s->rename_score >= 0 ? s->rename_score : rev.diffopt.rename_score;\n-\tcopy_pathspec(&rev.prune_data, &s->pathspec);\n+\tcopy_pathspec(&rev.path_limits, &s->pathspec);\n \trun_diff_index(&rev, 1);\n }\n \n-- \n2.17.1\n\n"},{"id":"364828","messageId":"xmqqo99v5vnc.fsf@gitster-ct.c.googlers.com","threadId":"49963","inReplyTo":"20181206213315.64423-1-matvore@google.com","subject":"Re: [PATCH] terminology tweak: prune -> path limiting","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-12-09T01:36:07Z","receivedAt":"2018-12-09T01:36:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew DeVore <matvore@google.com> writes:\n\n> In the codebase, \"prune\" is a highly overloaded term, and it caused me a\n> lot of trouble to figure out what it meant when it was used in the\n> context of path limiting. Stop using the word \"prune\" when we really\n> mean \"path limiting.\"\n\npath limiting is also used for two purposes.  \"pruning\", which is to\ncull the side branches that do not contribute the changes made to\nthe paths we are interested in, and showing only the changes to the\npaths that match pathspec.\n\nAFAIK, \"prune\" is also used to describe unreachable loose objects,\nbut that use is fairly isolated and have little risk of being\nconfusing too much.  Are there other uses to make you consider it\n\"highly overloaded\"?\n\nMy gut feeling is that the result is not reducing \"overloading\" in a\nmeaningful way, and this change is not worth the churn, but it\ndepends on the answer to the above question.\n\nThanks.\n"},{"id":"364832","messageId":"xmqq5zw35uwr.fsf@gitster-ct.c.googlers.com","threadId":"49963","inReplyTo":"xmqqo99v5vnc.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] terminology tweak: prune -> path limiting","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-12-09T01:52:04Z","receivedAt":"2018-12-09T01:52:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> AFAIK, \"prune\" is also used to describe unreachable loose objects,\n\ns/describe/& the act of culling/\n\n> but that use is fairly isolated and have little risk of being\n> confusing too much.  Are there other uses to make you consider it\n> \"highly overloaded\"?\n"},{"id":"364967","messageId":"CAMfpvhKh3xewUY-g9oVJq1o=G3w9EspoQUHc1edHUx3AD4OWfg@mail.gmail.com","threadId":"49963","inReplyTo":"xmqqo99v5vnc.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] terminology tweak: prune -> path limiting","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-12-10T18:57:28Z","receivedAt":"2018-12-10T18:57:42Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Sat, Dec 8, 2018 at 5:36 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Matthew DeVore <matvore@google.com> writes:\n>\n> > In the codebase, \"prune\" is a highly overloaded term, and it caused me a\n> > lot of trouble to figure out what it meant when it was used in the\n> > context of path limiting. Stop using the word \"prune\" when we really\n> > mean \"path limiting.\"\n>\n> path limiting is also used for two purposes.  \"pruning\", which is to\n> cull the side branches that do not contribute the changes made to\n> the paths we are interested in, and showing only the changes to the\n> paths that match pathspec.\nThank you for the clarification re: side branches.\n\n>\n> AFAIK, \"prune\" is also used to describe unreachable loose objects,\n> but that use is fairly isolated and have little risk of being\n> confusing too much.  Are there other uses to make you consider it\n> \"highly overloaded\"?\n\nThis is what I found:\n\ngit prune - cull unreachable loose objects\ngit fetch --prune - remove remote-tracking refs that no longer exist\nat source. Also note \"--prune-tags\" option\ngit notes prune - remove notes for non-existing/unreachable objects\ngit worktree prune - prunes \"administrative\" files\ngit prune-packed - removes loose objects that are also in pack files\ngit filter-branch --prune-empty - removes commits that become empty as\na result of rewriting.\n\nIt seems there are three general categories of the use of the term -\n - to remove things from a view (e.g. in path limiting)\n - to remove loose objects for efficiency (git prune, git prune-packed)\n - to remove other things for either efficiency or to reduce cognitive\noverhead (git worktree prune, git fetch --prune)\n\n... and each of these categories has 2+ subcategories.\n\nWhen I tried to figure out what \"prune\" and \"prune_data\" (\"data\" is\nquite vague, so these two fields read like \"prune_1\" and \"prune_2\")\nreferred to in \"revision.h\", I basically did \"grep -rn prune\" and\nlooked through the results, but there were too many uses of the term\n\"prune\" to pinpoint its meaning. If I used an IDE I might have been\nable to \"find usages\" of struct revs's prune field, and I probably\n*should have* done that, but I didn't have an IDE prepared and I\nfigured it wasn't important. Then an hour or so later I realized I was\nstill being confused by this term, and set out to figuring out what it\nactually meant.\n\n\n>\n> My gut feeling is that the result is not reducing \"overloading\" in a\n> meaningful way, and this change is not worth the churn, but it\n> depends on the answer to the above question.\n>\n> Thanks.\n"},{"id":"365004","messageId":"xmqq1s6oon7a.fsf@gitster-ct.c.googlers.com","threadId":"49963","inReplyTo":"CAMfpvhKh3xewUY-g9oVJq1o=G3w9EspoQUHc1edHUx3AD4OWfg@mail.gmail.com","subject":"Re: [PATCH] terminology tweak: prune -> path limiting","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-12-11T01:40:25Z","receivedAt":"2018-12-11T01:40:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew DeVore <matvore@google.com> writes:\n\n> When I tried to figure out what \"prune\" and \"prune_data\" (\"data\" is\n> quite vague, so these two fields read like \"prune_1\" and \"prune_2\")\n> referred to in \"revision.h\",...\n\nIt was unfortunate that 8efdc326 (\"rev-lib: Make it easy to do\nrename tracking (take 2)\", 2006-03-10) had to rename \"paths\" to\n\"prune_data\" when attempting to generalize the history\nsimplification mechanism by introducing \"prune_fn\", which can be\nused instead of a fixed function, and as one half of the pair, \"data\nused by the prune function\" made some sense.\n\nWhen we partially reverted that over-generalization with 53b2c823\n(\"revision walker: mini clean-up\", 2007-11-05), we probably should\nhave changed the prune_data back to paths, but we didn't.  Worse\nyet, when we made prune_data from a void pointer to struct pathspec\nat afe069d1 (\"struct rev_info: convert prune_data to struct\npathspec\", 2010-12-17), we really should have renamed it back to\npaths, but we didn't.\n\nSo I think it is a good idea to get rid of prune_data and make it\nclear it is no longer a generic thing but cannot be anything but a\npathspec.  I am not sure what the bit should be called, though.  It\nis a bit to enable any history simplification and not limited to\npathspec limiting (e.g. simplify-by-decoration enables it, too).\n\n\n\n\n"},{"id":"365027","messageId":"247509408.3503.1544505362525@connect.xfinity.com","threadId":"49963","inReplyTo":"xmqq1s6oon7a.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] terminology tweak: prune -> path limiting","fromName":"MATTHEW DEVORE","fromEmail":"matvore@comcast.net","sentAt":"2018-12-11T05:16:02Z","receivedAt":"2018-12-11T05:16:07Z","isPatch":true,"sender":{"key":"matvore@comcast.net","avatar":"https://gravatar.com/avatar/550c64ce544f82818ad931e244dfb08bbb1febfa6d1ce3cfd65e76215ca0ac8a?d=mp&s=160"},"body":"> On December 10, 2018 at 5:40 PM Junio C Hamano <gitster@pobox.com> wrote:\n> So I think it is a good idea to get rid of prune_data and make it\n> clear it is no longer a generic thing but cannot be anything but a\n> pathspec.  I am not sure what the bit should be called, though.  It\n> is a bit to enable any history simplification and not limited to\n> pathspec limiting (e.g. simplify-by-decoration enables it, too).\n> \n\nHow about the below patch? I used \"can_ignore_commits\" as the bit name, which - as the commit msg states - reflects the terminology used in get_commit_action and related functions.\n\nSubject: [PATCH] terminology tweak: prune -> path limiting\n\nIn the codebase, \"prune\" is a highly overloaded term, and it caused me a\nlot of trouble to figure out what it meant when it was used in the\ncontext of path limiting and stripping commits from history.\n\nRename two identifiers: prune_data (which used to be a void* argument to\na function called prune_fn) to path_limits, which correctly describes\nits current use; and prune to can_ignore_commits, which describes well\nwhat it means and parallels the terminology used in the\nget_commit_action function.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n Documentation/technical/api-history-graph.txt |  5 +-\n builtin/add.c                                 |  4 +-\n builtin/diff.c                                |  8 +-\n builtin/fast-export.c                         |  2 +-\n builtin/log.c                                 |  2 +-\n builtin/rev-list.c                            |  2 +-\n diff-lib.c                                    |  6 +-\n revision.c                                    | 92 ++++++++++---------\n revision.h                                    |  4 +-\n t/t7811-grep-open.sh                          |  2 +-\n tree-walk.c                                   | 10 +-\n wt-status.c                                   |  4 +-\n 12 files changed, 73 insertions(+), 68 deletions(-)\n\ndiff --git a/Documentation/technical/api-history-graph.txt b/Documentation/technical/api-history-graph.txt\nindex d0d1707c8c..f9a100f88c 100644\n--- a/Documentation/technical/api-history-graph.txt\n+++ b/Documentation/technical/api-history-graph.txt\n@@ -100,8 +100,9 @@ Limitations\n   on all parents of that commit.  Parents must not be skipped, or the graph\n   output will appear incorrect.\n +\n-`graph_update()` may be used on a pruned set of commits only if the parent list\n-has been rewritten so as to include only ancestors from the pruned set.\n+`graph_update()` may be used on a pruned (e.g. path-limited) set of commits only\n+if the parent list has been rewritten so as to include only ancestors from the\n+pruned set.\n \n * The graph API does not currently support reverse commit ordering.  In\n   order to implement reverse ordering, the graphing API needs an\ndiff --git a/builtin/add.c b/builtin/add.c\nindex f65c172299..4abd8ebba8 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -113,14 +113,14 @@ int add_files_to_cache(const char *prefix,\n \trepo_init_revisions(the_repository, &rev, prefix);\n \tsetup_revisions(0, NULL, &rev, NULL);\n \tif (pathspec)\n-\t\tcopy_pathspec(&rev.prune_data, pathspec);\n+\t\tcopy_pathspec(&rev.path_limits, pathspec);\n \trev.diffopt.output_format = DIFF_FORMAT_CALLBACK;\n \trev.diffopt.format_callback = update_callback;\n \trev.diffopt.format_callback_data = &data;\n \trev.diffopt.flags.override_submodule_config = 1;\n \trev.max_count = 0; /* do not compare unmerged paths with stage #2 */\n \trun_diff_files(&rev, DIFF_RACY_IS_MODIFIED);\n-\tclear_pathspec(&rev.prune_data);\n+\tclear_pathspec(&rev.path_limits);\n \treturn !!data.add_errors;\n }\n \ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex f0393bba23..9010b3228a 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -74,8 +74,8 @@ static int builtin_diff_b_f(struct rev_info *revs,\n \tif (argc > 1)\n \t\tusage(builtin_diff_usage);\n \n-\tGUARD_PATHSPEC(&revs->prune_data, PATHSPEC_FROMTOP | PATHSPEC_LITERAL);\n-\tpath = revs->prune_data.items[0].match;\n+\tGUARD_PATHSPEC(&revs->path_limits, PATHSPEC_FROMTOP | PATHSPEC_LITERAL);\n+\tpath = revs->path_limits.items[0].match;\n \n \tif (lstat(path, &st))\n \t\tdie_errno(_(\"failed to stat '%s'\"), path);\n@@ -421,8 +421,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \t\t\tdie(_(\"unhandled object '%s' given.\"), name);\n \t\t}\n \t}\n-\tif (rev.prune_data.nr)\n-\t\tpaths += rev.prune_data.nr;\n+\tif (rev.path_limits.nr)\n+\t\tpaths += rev.path_limits.nr;\n \n \t/*\n \t * Now, do the arguments look reasonable?\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 9e283482ef..6a675b5737 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -1143,7 +1143,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)\n \t\timport_marks(import_filename);\n \tlastimportid = last_idnum;\n \n-\tif (import_filename && revs.prune_data.nr)\n+\tif (import_filename && revs.path_limits.nr)\n \t\tfull_tree = 1;\n \n \tget_tags_and_duplicates(&revs.cmdline);\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 45aa376a59..f8554d7fa1 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -690,7 +690,7 @@ static void log_setup_revisions_tweak(struct rev_info *rev,\n \t\t\t\t      struct setup_revision_opt *opt)\n {\n \tif (rev->diffopt.flags.default_follow_renames &&\n-\t    rev->prune_data.nr == 1)\n+\t    rev->path_limits.nr == 1)\n \t\trev->diffopt.flags.follow_renames = 1;\n \n \t/* Turn --cc/-c into -p --cc/-c when -p was not given */\ndiff --git a/builtin/rev-list.c b/builtin/rev-list.c\nindex 3a2c0c23b6..f6ce622dd1 100644\n--- a/builtin/rev-list.c\n+++ b/builtin/rev-list.c\n@@ -517,7 +517,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)\n \tif (show_progress)\n \t\tprogress = start_delayed_progress(show_progress, 0);\n \n-\tif (use_bitmap_index && !revs.prune) {\n+\tif (use_bitmap_index && !revs.can_ignore_commits) {\n \t\tif (revs.count && !revs.left_right && !revs.cherry_mark) {\n \t\t\tuint32_t commit_count;\n \t\t\tint max_count = revs.max_count;\ndiff --git a/diff-lib.c b/diff-lib.c\nindex 23c8d351b3..431bed0e5a 100644\n--- a/diff-lib.c\n+++ b/diff-lib.c\n@@ -110,7 +110,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)\n \t\tif (diff_can_quit_early(&revs->diffopt))\n \t\t\tbreak;\n \n-\t\tif (!ce_path_match(istate, ce, &revs->prune_data, NULL))\n+\t\tif (!ce_path_match(istate, ce, &revs->path_limits, NULL))\n \t\t\tcontinue;\n \n \t\tif (ce_stage(ce)) {\n@@ -477,7 +477,7 @@ static int oneway_diff(const struct cache_entry * const *src,\n \n \tif (ce_path_match(revs->diffopt.repo->index,\n \t\t\t  idx ? idx : tree,\n-\t\t\t  &revs->prune_data, NULL)) {\n+\t\t\t  &revs->path_limits, NULL)) {\n \t\tdo_oneway_diff(o, idx, tree);\n \t\tif (diff_can_quit_early(&revs->diffopt)) {\n \t\t\to->exiting_early = 1;\n@@ -543,7 +543,7 @@ int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)\n \tstruct rev_info revs;\n \n \trepo_init_revisions(opt->repo, &revs, NULL);\n-\tcopy_pathspec(&revs.prune_data, &opt->pathspec);\n+\tcopy_pathspec(&revs.path_limits, &opt->pathspec);\n \trevs.diffopt = *opt;\n \n \tif (diff_cache(&revs, tree_oid, NULL, 1))\ndiff --git a/revision.c b/revision.c\nindex 13e0519c02..9525c9f161 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -488,7 +488,7 @@ static int rev_compare_tree(struct rev_info *revs,\n \t\t * tagged commit by specifying both --simplify-by-decoration\n \t\t * and pathspec.\n \t\t */\n-\t\tif (!revs->prune_data.nr)\n+\t\tif (!revs->path_limits.nr)\n \t\t\treturn REV_TREE_SAME;\n \t}\n \n@@ -616,14 +616,14 @@ static unsigned update_treesame(struct rev_info *revs, struct commit *commit)\n static inline int limiting_can_increase_treesame(const struct rev_info *revs)\n {\n \t/*\n-\t * TREESAME is irrelevant unless prune && dense;\n+\t * TREESAME is irrelevant unless can_ignore_commits && dense;\n \t * if simplify_history is set, we can't have a mixture of TREESAME and\n \t *    !TREESAME INTERESTING parents (and we don't have treesame[]\n \t *    decoration anyway);\n \t * if first_parent_only is set, then the TREESAME flag is locked\n \t *    against the first parent (and again we lack treesame[] decoration).\n \t */\n-\treturn revs->prune && revs->dense &&\n+\treturn revs->can_ignore_commits && revs->dense &&\n \t       !revs->simplify_history &&\n \t       !revs->first_parent_only;\n }\n@@ -636,9 +636,9 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit)\n \tint relevant_parents, nth_parent;\n \n \t/*\n-\t * If we don't do pruning, everything is interesting\n+\t * If we don't do commit pruning, everything is interesting\n \t */\n-\tif (!revs->prune)\n+\tif (!revs->can_ignore_commits)\n \t\treturn;\n \n \tif (!get_commit_tree(commit))\n@@ -786,7 +786,7 @@ static int process_parents(struct rev_info *revs, struct commit *commit,\n \n \t/*\n \t * If the commit is uninteresting, don't try to\n-\t * prune parents - we want the maximal uninteresting\n+\t * path limit parents - we want the maximal uninteresting\n \t * set.\n \t *\n \t * Normally we haven't parsed the parent\n@@ -1511,8 +1511,8 @@ static void prepare_show_merge(struct rev_info *revs)\n \tstruct commit_list *bases;\n \tstruct commit *head, *other;\n \tstruct object_id oid;\n-\tconst char **prune = NULL;\n-\tint i, prune_num = 1; /* counting terminating NULL */\n+\tconst char **limiting_paths = NULL;\n+\tint i, limiting_paths_num = 1; /* counting terminating NULL */\n \tstruct index_state *istate = revs->repo->index;\n \n \tif (get_oid(\"HEAD\", &oid))\n@@ -1535,19 +1535,20 @@ static void prepare_show_merge(struct rev_info *revs)\n \t\tconst struct cache_entry *ce = istate->cache[i];\n \t\tif (!ce_stage(ce))\n \t\t\tcontinue;\n-\t\tif (ce_path_match(istate, ce, &revs->prune_data, NULL)) {\n-\t\t\tprune_num++;\n-\t\t\tREALLOC_ARRAY(prune, prune_num);\n-\t\t\tprune[prune_num-2] = ce->name;\n-\t\t\tprune[prune_num-1] = NULL;\n+\t\tif (ce_path_match(istate, ce, &revs->path_limits, NULL)) {\n+\t\t\tlimiting_paths_num++;\n+\t\t\tREALLOC_ARRAY(limiting_paths, limiting_paths_num);\n+\t\t\tlimiting_paths[limiting_paths_num-2] = ce->name;\n+\t\t\tlimiting_paths[limiting_paths_num-1] = NULL;\n \t\t}\n \t\twhile ((i+1 < istate->cache_nr) &&\n \t\t       ce_same_name(ce, istate->cache[i+1]))\n \t\t\ti++;\n \t}\n-\tclear_pathspec(&revs->prune_data);\n-\tparse_pathspec(&revs->prune_data, PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,\n-\t\t       PATHSPEC_PREFER_FULL | PATHSPEC_LITERAL_PATH, \"\", prune);\n+\tclear_pathspec(&revs->path_limits);\n+\tparse_pathspec(&revs->path_limits, PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,\n+\t\t       PATHSPEC_PREFER_FULL | PATHSPEC_LITERAL_PATH, \"\",\n+\t\t       limiting_paths);\n \trevs->limited = 1;\n }\n \n@@ -1736,14 +1737,14 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs, int flags, unsi\n }\n \n static void read_pathspec_from_stdin(struct rev_info *revs, struct strbuf *sb,\n-\t\t\t\t     struct argv_array *prune)\n+\t\t\t\t     struct argv_array *limiting_paths)\n {\n \twhile (strbuf_getline(sb, stdin) != EOF)\n-\t\targv_array_push(prune, sb->buf);\n+\t\targv_array_push(limiting_paths, sb->buf);\n }\n \n static void read_revisions_from_stdin(struct rev_info *revs,\n-\t\t\t\t      struct argv_array *prune)\n+\t\t\t\t      struct argv_array *limiting_paths)\n {\n \tstruct strbuf sb;\n \tint seen_dashdash = 0;\n@@ -1769,7 +1770,7 @@ static void read_revisions_from_stdin(struct rev_info *revs,\n \t\t\tdie(\"bad revision '%s'\", sb.buf);\n \t}\n \tif (seen_dashdash)\n-\t\tread_pathspec_from_stdin(revs, &sb, prune);\n+\t\tread_pathspec_from_stdin(revs, &sb, limiting_paths);\n \n \tstrbuf_release(&sb);\n \twarn_on_object_refname_ambiguity = save_warning;\n@@ -1884,7 +1885,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n \t\trevs->simplify_history = 0;\n \t\trevs->simplify_by_decoration = 1;\n \t\trevs->limited = 1;\n-\t\trevs->prune = 1;\n+\t\trevs->can_ignore_commits = 1;\n \t\tload_ref_decorations(NULL, DECORATE_SHORT_REFS);\n \t} else if (!strcmp(arg, \"--date-order\")) {\n \t\trevs->sort_order = REV_SORT_BY_COMMIT_DATE;\n@@ -2338,7 +2339,7 @@ static void NORETURN diagnose_missing_default(const char *def)\n int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct setup_revision_opt *opt)\n {\n \tint i, flags, left, seen_dashdash, got_rev_arg = 0, revarg_opt;\n-\tstruct argv_array prune_data = ARGV_ARRAY_INIT;\n+\tstruct argv_array path_limits = ARGV_ARRAY_INIT;\n \tconst char *submodule = NULL;\n \n \tif (opt)\n@@ -2356,7 +2357,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t\targv[i] = NULL;\n \t\t\targc = i;\n \t\t\tif (argv[i + 1])\n-\t\t\t\targv_array_pushv(&prune_data, argv + i + 1);\n+\t\t\t\targv_array_pushv(&path_limits, argv + i + 1);\n \t\t\tseen_dashdash = 1;\n \t\t\tbreak;\n \t\t}\n@@ -2387,7 +2388,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t\t\t}\n \t\t\t\tif (revs->read_from_stdin++)\n \t\t\t\t\tdie(\"--stdin given twice?\");\n-\t\t\t\tread_revisions_from_stdin(revs, &prune_data);\n+\t\t\t\tread_revisions_from_stdin(revs, &path_limits);\n \t\t\t\tcontinue;\n \t\t\t}\n \n@@ -2416,32 +2417,32 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t\tfor (j = i; j < argc; j++)\n \t\t\t\tverify_filename(revs->prefix, argv[j], j == i);\n \n-\t\t\targv_array_pushv(&prune_data, argv + i);\n+\t\t\targv_array_pushv(&path_limits, argv + i);\n \t\t\tbreak;\n \t\t}\n \t\telse\n \t\t\tgot_rev_arg = 1;\n \t}\n \n-\tif (prune_data.argc) {\n+\tif (path_limits.argc) {\n \t\t/*\n \t\t * If we need to introduce the magic \"a lone ':' means no\n \t\t * pathspec whatsoever\", here is the place to do so.\n \t\t *\n-\t\t * if (prune_data.nr == 1 && !strcmp(prune_data[0], \":\")) {\n-\t\t *\tprune_data.nr = 0;\n-\t\t *\tprune_data.alloc = 0;\n-\t\t *\tfree(prune_data.path);\n-\t\t *\tprune_data.path = NULL;\n+\t\t * if (path_limits.nr == 1 && !strcmp(path_limits[0], \":\")) {\n+\t\t *\tpath_limits.nr = 0;\n+\t\t *\tpath_limits.alloc = 0;\n+\t\t *\tfree(path_limits.path);\n+\t\t *\tpath_limits.path = NULL;\n \t\t * } else {\n-\t\t *\tterminate prune_data.alloc with NULL and\n-\t\t *\tcall init_pathspec() to set revs->prune_data here.\n+\t\t *\tterminate path_limits.alloc with NULL and\n+\t\t *\tcall init_pathspec() to set revs->path_limits here.\n \t\t * }\n \t\t */\n-\t\tparse_pathspec(&revs->prune_data, 0, 0,\n-\t\t\t       revs->prefix, prune_data.argv);\n+\t\tparse_pathspec(&revs->path_limits, 0, 0,\n+\t\t\t       revs->prefix, path_limits.argv);\n \t}\n-\targv_array_clear(&prune_data);\n+\targv_array_clear(&path_limits);\n \n \tif (revs->def == NULL)\n \t\trevs->def = opt ? opt->def : NULL;\n@@ -2475,14 +2476,17 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \tif (revs->topo_order && !generation_numbers_enabled(the_repository))\n \t\trevs->limited = 1;\n \n-\tif (revs->prune_data.nr) {\n-\t\tcopy_pathspec(&revs->pruning.pathspec, &revs->prune_data);\n-\t\t/* Can't prune commits with rename following: the paths change.. */\n+\tif (revs->path_limits.nr) {\n+\t\tcopy_pathspec(&revs->pruning.pathspec, &revs->path_limits);\n+\t\t/*\n+\t\t * Can't path-limit commits with rename following; the paths\n+\t\t * change.\n+\t\t */\n \t\tif (!revs->diffopt.flags.follow_renames)\n-\t\t\trevs->prune = 1;\n+\t\t\trevs->can_ignore_commits = 1;\n \t\tif (!revs->full_diff)\n \t\t\tcopy_pathspec(&revs->diffopt.pathspec,\n-\t\t\t\t      &revs->prune_data);\n+\t\t\t\t      &revs->path_limits);\n \t}\n \tif (revs->combine_merges)\n \t\trevs->ignore_merges = 0;\n@@ -2845,7 +2849,7 @@ static void simplify_merges(struct rev_info *revs)\n \tstruct commit_list *yet_to_do, **tail;\n \tstruct commit *commit;\n \n-\tif (!revs->prune)\n+\tif (!revs->can_ignore_commits)\n \t\treturn;\n \n \t/* feed the list reversed */\n@@ -3361,7 +3365,7 @@ enum commit_action get_commit_action(struct rev_info *revs, struct commit *commi\n \t}\n \tif (!commit_match(commit, revs))\n \t\treturn commit_ignore;\n-\tif (revs->prune && revs->dense) {\n+\tif (revs->can_ignore_commits && revs->dense) {\n \t\t/* Commit without changes? */\n \t\tif (commit->object.flags & TREESAME) {\n \t\t\tint n;\n@@ -3446,7 +3450,7 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit)\n \tenum commit_action action = get_commit_action(revs, commit);\n \n \tif (action == commit_show &&\n-\t    revs->prune && revs->dense && want_ancestry(revs)) {\n+\t    revs->can_ignore_commits && revs->dense && want_ancestry(revs)) {\n \t\t/*\n \t\t * --full-diff on simplified parents is no good: it\n \t\t * will show spurious changes from the commits that\ndiff --git a/revision.h b/revision.h\nindex 7987bfcd2e..b19d5536f1 100644\n--- a/revision.h\n+++ b/revision.h\n@@ -87,7 +87,7 @@ struct rev_info {\n \t/* Basic information */\n \tconst char *prefix;\n \tconst char *def;\n-\tstruct pathspec prune_data;\n+\tstruct pathspec path_limits;\n \n \t/*\n \t * Whether the arguments parsed by setup_revisions() included any\n@@ -111,7 +111,7 @@ struct rev_info {\n \n \t/* Traversal flags */\n \tunsigned int\tdense:1,\n-\t\t\tprune:1,\n+\t\t\tcan_ignore_commits:1,\n \t\t\tno_walk:2,\n \t\t\tremove_empty_trees:1,\n \t\t\tsimplify_history:1,\ndiff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh\nindex d1ebfd88c7..79af1b7187 100755\n--- a/t/t7811-grep-open.sh\n+++ b/t/t7811-grep-open.sh\n@@ -23,7 +23,7 @@ enum grep_pat_token {\n \ttest_commit add-user revision.c \"\n \t}\n \tif (seen_dashdash)\n-\t\tread_pathspec_from_stdin(revs, &sb, prune);\n+\t\tread_pathspec_from_stdin(revs, &sb, limiting_paths);\n \tstrbuf_release(&sb);\n }\n \ndiff --git a/tree-walk.c b/tree-walk.c\nindex 79bafbd1a2..b60170b6b4 100644\n--- a/tree-walk.c\n+++ b/tree-walk.c\n@@ -365,10 +365,10 @@ static void free_extended_entry(struct tree_desc_x *t)\n \t}\n }\n \n-static inline int prune_traversal(struct name_entry *e,\n-\t\t\t\t  struct traverse_info *info,\n-\t\t\t\t  struct strbuf *base,\n-\t\t\t\t  int still_interesting)\n+static inline int path_limit_traversal(struct name_entry *e,\n+\t\t\t\t       struct traverse_info *info,\n+\t\t\t\t       struct strbuf *base,\n+\t\t\t\t       int still_interesting)\n {\n \tif (!info->pathspec || still_interesting == 2)\n \t\treturn 2;\n@@ -461,7 +461,7 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)\n \t\t}\n \t\tif (!mask)\n \t\t\tbreak;\n-\t\tinteresting = prune_traversal(e, info, &base, interesting);\n+\t\tinteresting = path_limit_traversal(e, info, &base, interesting);\n \t\tif (interesting < 0)\n \t\t\tbreak;\n \t\tif (interesting) {\ndiff --git a/wt-status.c b/wt-status.c\nindex 0fe3bcd4cd..b0a3efea4b 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -603,7 +603,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)\n \trev.diffopt.detect_rename = s->detect_rename >= 0 ? s->detect_rename : rev.diffopt.detect_rename;\n \trev.diffopt.rename_limit = s->rename_limit >= 0 ? s->rename_limit : rev.diffopt.rename_limit;\n \trev.diffopt.rename_score = s->rename_score >= 0 ? s->rename_score : rev.diffopt.rename_score;\n-\tcopy_pathspec(&rev.prune_data, &s->pathspec);\n+\tcopy_pathspec(&rev.path_limits, &s->pathspec);\n \trun_diff_files(&rev, 0);\n }\n \n@@ -639,7 +639,7 @@ static void wt_status_collect_changes_index(struct wt_status *s)\n \trev.diffopt.detect_rename = s->detect_rename >= 0 ? s->detect_rename : rev.diffopt.detect_rename;\n \trev.diffopt.rename_limit = s->rename_limit >= 0 ? s->rename_limit : rev.diffopt.rename_limit;\n \trev.diffopt.rename_score = s->rename_score >= 0 ? s->rename_score : rev.diffopt.rename_score;\n-\tcopy_pathspec(&rev.prune_data, &s->pathspec);\n+\tcopy_pathspec(&rev.path_limits, &s->pathspec);\n \trun_diff_index(&rev, 1);\n }\n \n-- \n2.17.1\n"}]}