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

[PATCH 1/2] dir: fix outdated comment on add_patterns()

From
Matheus Tavares <matheus.bernardino@usp.br>
Date
Mar 16, 2020, 03:47 UTC
Message-ID
<9de4c8cdee441be7d9bbef2a961a8ed7d423f448.1584329834.git.matheus.bernardino@usp.br>
In-Reply-To
<cover.1584329834.git.matheus.bernardino@usp.br>

In 4b33e60 ("dir: convert struct sha1_stat to use object_id", 2018-01-28), the struct sha1_stat was converted to oid_stat. In this process, add_patterns() also learned to use the new struct definition. However, the comments in this function still refer to "ss" (i.e. the old sha1_stat). Update that.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
---
 dir.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dir.c b/dir.c
index 0ffb1b3302..ab2e5b8717 100644
--- a/dir.c
+++ b/dir.c
@@ -1015,9 +1015,10 @@ static int add_patterns_from_buffer(char *buf, size_t size,
  * an index if 'istate' is non-null), parse it and store the
  * exclude rules in "pl".
  *
- * If "ss" is not NULL, compute SHA-1 of the exclude file and fill
+ * If oid_stat is not NULL, compute OID of the exclude file and fill
  * stat data from disk (only valid if add_patterns returns zero). If
- * ss_valid is non-zero, "ss" must contain good value as input.
+ * oid_stat->valid is non-zero, oid_stat must contain good value as
+ * input.
  */
 static int add_patterns(const char *fname, const char *base, int baselen,
 			struct pattern_list *pl, struct index_state *istate,
@@ -1065,7 +1066,7 @@ static int add_patterns(const char *fname, const char *base, int baselen,
 			int pos;
 			if (oid_stat->valid &&
 			    !match_stat_data_racy(istate, &oid_stat->stat, &st))
-				; /* no content change, ss->sha1 still good */
+				; /* no content change, oid_stat->oid still good */
 			else if (istate &&
 				 (pos = index_name_pos(istate, fname, strlen(fname))) >= 0 &&
 				 !ce_stage(istate->cache[pos]) &&
-- 
2.25.0
Previous: Matheus TavaresNext: Matheus Tavares
Message 2 of 13 in “dir: update outdated fields and comments about oid_stat”
  1. 0/2 dir: update outdated fields and comments about oid_statMatheus Tavares, Mar 16, 2020
  2. 1/2 dir: fix outdated comment on add_patterns()Matheus Tavares, Mar 16, 2020
  3. 2/2 dir: improve naming of oid_stat fields in two structsMatheus Tavares, Mar 16, 2020
  4. Junio C HamanoMar 16, 2020
  5. Patryk ObaraMar 16, 2020
  6. Matheus Tavares BernardinoMar 16, 2020
  7. Junio C HamanoMar 16, 2020
  8. Junio C HamanoMar 16, 2020
  9. Jeff KingMar 16, 2020
  10. 0/3 dir: update outdated field names and comments about oid_statMatheus Tavares, Mar 17, 2020
  11. 1/3 dir: fix outdated comment on add_patterns()Matheus Tavares, Mar 17, 2020
  12. 2/3 dir: improve naming of oid_stat fields in two structsMatheus Tavares, Mar 17, 2020
  13. 3/3 dir: update outdated comments about untracked cacheMatheus Tavares, Mar 17, 2020

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.