git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/8] pathspec: rename PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP

From
BWBrandon Williams <bmwill@google.com>
Date
May 9, 2017, 19:18 UTC
Message-ID
<20170509191805.176266-5-bmwill@google.com>
In-Reply-To
<20170509191805.176266-1-bmwill@google.com>

Now that there is only a single flag which strips a submodule slash, rename PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP to PATHSPEC_STRIP_SUBMODULE_SLASH.

Signed-off-by: Brandon Williams <bmwill@google.com>
---
 builtin/add.c               | 2 +-
 builtin/check-ignore.c      | 2 +-
 builtin/ls-files.c          | 2 +-
 builtin/reset.c             | 2 +-
 builtin/rm.c                | 2 +-
 builtin/submodule--helper.c | 2 +-
 pathspec.c                  | 6 +++---
 pathspec.h                  | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/builtin/add.c b/builtin/add.c
index 2aa9aeab9..51d7a5506 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -389,7 +389,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 	parse_pathspec(&pathspec, 0,
 		       PATHSPEC_PREFER_FULL |
 		       PATHSPEC_SYMLINK_LEADING_PATH |
-		       PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP |
+		       PATHSPEC_STRIP_SUBMODULE_SLASH |
 		       PATHSPEC_SUBMODULE_LEADING_PATH,
 		       prefix, argv);
 
diff --git a/builtin/check-ignore.c b/builtin/check-ignore.c
index 73237b2b1..694e4c61b 100644
--- a/builtin/check-ignore.c
+++ b/builtin/check-ignore.c
@@ -88,7 +88,7 @@ static int check_ignore(struct dir_struct *dir,
 		       PATHSPEC_ALL_MAGIC & ~PATHSPEC_FROMTOP,
 		       PATHSPEC_SYMLINK_LEADING_PATH |
 		       PATHSPEC_SUBMODULE_LEADING_PATH |
-		       PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP |
+		       PATHSPEC_STRIP_SUBMODULE_SLASH |
 		       PATHSPEC_KEEP_ORDER,
 		       prefix, argv);
 
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index d449e46db..e9dee2e41 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -618,7 +618,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
 
 	parse_pathspec(&pathspec, 0,
 		       PATHSPEC_PREFER_CWD |
-		       PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP,
+		       PATHSPEC_STRIP_SUBMODULE_SLASH,
 		       prefix, argv);
 
 	/*
diff --git a/builtin/reset.c b/builtin/reset.c
index fc3b906c4..529f2f9be 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -236,7 +236,7 @@ static void parse_args(struct pathspec *pathspec,
 
 	parse_pathspec(pathspec, 0,
 		       PATHSPEC_PREFER_FULL |
-		       PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP |
+		       PATHSPEC_STRIP_SUBMODULE_SLASH |
 		       (patch_mode ? PATHSPEC_PREFIX_ORIGIN : 0),
 		       prefix, argv);
 }
diff --git a/builtin/rm.c b/builtin/rm.c
index fb79dcab1..8fe12d0a7 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -272,7 +272,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 
 	parse_pathspec(&pathspec, 0,
 		       PATHSPEC_PREFER_CWD |
-		       PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP,
+		       PATHSPEC_STRIP_SUBMODULE_SLASH,
 		       prefix, argv);
 	refresh_index(&the_index, REFRESH_QUIET, &pathspec, NULL, NULL);
 
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 85aafe46a..69149b557 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -234,7 +234,7 @@ static int module_list_compute(int argc, const char **argv,
 	char *ps_matched = NULL;
 	parse_pathspec(pathspec, 0,
 		       PATHSPEC_PREFER_FULL |
-		       PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP,
+		       PATHSPEC_STRIP_SUBMODULE_SLASH,
 		       prefix, argv);
 
 	if (pathspec->nr)
diff --git a/pathspec.c b/pathspec.c
index f37d5769d..a1297ca02 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -386,7 +386,7 @@ static const char *parse_element_magic(unsigned *magic, int *prefix_len,
 		return parse_short_magic(magic, elem);
 }
 
-static void strip_submodule_slash_cheap(struct pathspec_item *item)
+static void strip_submodule_slash(struct pathspec_item *item)
 {
 	if (item->len >= 1 && item->match[item->len - 1] == '/') {
 		int i = cache_name_pos(item->match, item->len - 1);
@@ -496,8 +496,8 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
 		item->original = xstrdup(elt);
 	}
 
-	if (flags & PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP)
-		strip_submodule_slash_cheap(item);
+	if (flags & PATHSPEC_STRIP_SUBMODULE_SLASH)
+		strip_submodule_slash(item);
 
 	if (magic & PATHSPEC_LITERAL) {
 		item->nowildcard_len = item->len;
diff --git a/pathspec.h b/pathspec.h
index 93a819cbf..dd6456d5d 100644
--- a/pathspec.h
+++ b/pathspec.h
@@ -59,7 +59,7 @@ struct pathspec {
 #define PATHSPEC_PREFER_FULL (1<<1) /* No args means match everything */
 #define PATHSPEC_MAXDEPTH_VALID (1<<2) /* max_depth field is valid */
 /* strip the trailing slash if the given path is a gitlink */
-#define PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP (1<<3)
+#define PATHSPEC_STRIP_SUBMODULE_SLASH (1<<3)
 /* die if a symlink is part of the given path's directory */
 #define PATHSPEC_SYMLINK_LEADING_PATH (1<<4)
 /*
-- 
2.13.0.rc2.291.g57267f2277-goog
Previous: Brandon WilliamsNext: Junio C Hamano
Message 11 of 29 in “convert pathspec.c to take an index parameter”
  1. 0/8 convert pathspec.c to take an index parameterBrandon Williams, May 9, 2017
  2. 2/8 submodule: add die_in_unpopulated_submodule functionBrandon Williams, May 9, 2017
  3. 3/8 pathspec: change PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE flagBrandon Williams, May 9, 2017
  4. Junio C HamanoMay 10, 2017
  5. Brandon WilliamsMay 10, 2017
  6. 1/8 pathspec: provide a more descriptive die messageBrandon Williams, May 9, 2017
  7. 5/8 pathspec: convert strip_submodule_slash to take an indexBrandon Williams, May 9, 2017
  8. Junio C HamanoMay 10, 2017
  9. 7/8 pathspec: convert init_pathspec_item to take an indexBrandon Williams, May 9, 2017
  10. 6/8 pathspec: convert find_pathspecs_matching_against_index to take an indexBrandon Williams, May 9, 2017
  11. 4/8 pathspec: rename PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAPBrandon Williams, May 9, 2017
  12. Junio C HamanoMay 10, 2017
  13. 8/8 pathspec: convert parse_pathspec to take an indexBrandon Williams, May 9, 2017
  14. Junio C HamanoMay 10, 2017
  15. Brandon WilliamsMay 10, 2017
  16. Junio C HamanoMay 11, 2017
  17. Johannes SixtMay 11, 2017
  18. Junio C HamanoMay 11, 2017
  19. Brandon WilliamsMay 11, 2017
  20. Junio C HamanoMay 12, 2017
  21. 0/6 convert pathspec.c to take an index parameterBrandon Williams, May 11, 2017
  22. 2/6 submodule: add die_in_unpopulated_submodule functionBrandon Williams, May 11, 2017
  23. 4/6 ls-files: prevent prune_cache from overeagerly pruning submodulesBrandon Williams, May 11, 2017
  24. 3/6 pathspec: remove PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE flagBrandon Williams, May 11, 2017
  25. 6/6 pathspec: convert find_pathspecs_matching_against_index to take an indexBrandon Williams, May 11, 2017
  26. 5/6 pathspec: remove PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAPBrandon Williams, May 11, 2017
  27. 1/6 pathspec: provide a more descriptive die messageBrandon Williams, May 11, 2017
  28. Junio C HamanoMay 12, 2017
  29. Brandon WilliamsMay 12, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.