git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matheus Tavares <matheus.bernardino@usp.br>
To: git@vger.kernel.org
Cc: gitster@pobox.com, dreamer.tan@gmail.com, peff@peff.net
Subject: [PATCH v2 3/3] dir: update outdated comments about untracked cache
Date: Tue, 17 Mar 2020 15:57:45 -0300	[thread overview]
Message-ID: <544d625c471fd5d2d0e139dd0d48cf85d87f0cf8.1584471137.git.matheus.bernardino@usp.br> (raw)
In-Reply-To: <cover.1584471137.git.matheus.bernardino@usp.br>

In dir.h we have a comment mentioning "exclude_sha1[],
info_exclude_sha1[] and excludes_file_sha1[]", but none of those names
appears in code anymore. The first appearance of "info_exclude_sha1" and
"excludes_file_sha1" in code happened in 83c094a ("untracked cache: save
to an index extension", 2015-03-08). In this patch, the two names were
added as fields of "struct ondisk_untracked_cache". Both fields were
later removed, in 3899b88 ("dir: make untracked cache extension hash
size independent", 2019-02-19). However, before their removal, we can
see in dir.c:read_untracked_extension() that their data would be copied
to the "struct untracked_cache". More specifically, to the now named
"info_exclude_validity" and "excludes_file_validity" fields of the said
struct. So it should be safe to say that what the comment referred to as
"info_exclude_sha1[] and excludes_file_sha1[]", back then, could be
updated to "info_exclude_validity.oid and excludes_file_validity.oid"
nowadays.

As for "exclude_sha1[]", its update is easier: it used to be a field of
"struct untracked_cache_dir" that was renamed in 70c369c ("dir: convert
struct untracked_cache_dir to object_id", 2018-05-02). This outdated
field name is also mentioned in one more place: a dir.c comment about
"struct write_data". So let's also update it there.

Suggested-by: Patryk Obara <dreamer.tan@gmail.com>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
---
 dir.c | 3 ++-
 dir.h | 7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dir.c b/dir.c
index 92226b1af2..3ad2d61278 100644
--- a/dir.c
+++ b/dir.c
@@ -2961,7 +2961,8 @@ struct write_data {
 	int index;	   /* number of written untracked_cache_dir */
 	struct ewah_bitmap *check_only; /* from untracked_cache_dir */
 	struct ewah_bitmap *valid;	/* from untracked_cache_dir */
-	struct ewah_bitmap *sha1_valid; /* set if exclude_sha1 is not null */
+	/* set if untracked_cache_dir.exclude_oid is not null */
+	struct ewah_bitmap *sha1_valid;
 	struct strbuf out;
 	struct strbuf sb_stat;
 	struct strbuf sb_sha1;
diff --git a/dir.h b/dir.h
index 6c3aaeba71..549e04b068 100644
--- a/dir.h
+++ b/dir.h
@@ -166,9 +166,10 @@ struct oid_stat {
  *  Whenever a file (or a submodule) is added or removed from a
  *  directory, we invalidate that directory.
  *
- *  The remaining inputs are easy, their SHA-1 could be used to verify
- *  their contents (exclude_sha1[], info_exclude_sha1[] and
- *  excludes_file_sha1[])
+ *  The remaining inputs are easy, their OID could be used to verify
+ *  their contents (untracked_cache_dir.exclude_oid,
+ *  untracked_cache.info_exclude_validity.oid and
+ *  untracked_cache.excludes_file_validity.oid)
  */
 struct untracked_cache_dir {
 	struct untracked_cache_dir **dirs;
-- 
2.25.1


      parent reply	other threads:[~2020-03-17 18:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16  3:47 [PATCH 0/2] dir: update outdated fields and comments about oid_stat Matheus Tavares
2020-03-16  3:47 ` [PATCH 1/2] dir: fix outdated comment on add_patterns() Matheus Tavares
2020-03-16  3:47 ` [PATCH 2/2] dir: improve naming of oid_stat fields in two structs Matheus Tavares
2020-03-16  6:17   ` Junio C Hamano
2020-03-16 12:31     ` Patryk Obara
2020-03-16 17:22     ` Matheus Tavares Bernardino
2020-03-16 18:31       ` Junio C Hamano
2020-03-16 18:35         ` Junio C Hamano
2020-03-16 19:20           ` Jeff King
2020-03-17 18:57 ` [PATCH v2 0/3] dir: update outdated field names and comments about oid_stat Matheus Tavares
2020-03-17 18:57   ` [PATCH v2 1/3] dir: fix outdated comment on add_patterns() Matheus Tavares
2020-03-17 18:57   ` [PATCH v2 2/3] dir: improve naming of oid_stat fields in two structs Matheus Tavares
2020-03-17 18:57   ` Matheus Tavares [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=544d625c471fd5d2d0e139dd0d48cf85d87f0cf8.1584471137.git.matheus.bernardino@usp.br \
    --to=matheus.bernardino@usp.br \
    --cc=dreamer.tan@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).