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

[PATCH v4 09/23] convert.c: remove an implicit dependency on the_index

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Jun 6, 2018, 17:02 UTC
Message-ID
<20180606170243.4169-4-pclouds@gmail.com>
In-Reply-To
<20180606170243.4169-1-pclouds@gmail.com>

Make the convert API take an index_state instead of assuming the_index in convert.c. All external call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 apply.c            |  2 +-
 archive.c          |  2 +-
 builtin/cat-file.c |  2 +-
 builtin/ls-files.c |  2 +-
 convert.c          | 41 ++++++++++++++++++++++++-----------------
 convert.h          | 15 ++++++++++-----
 diff.c             |  2 +-
 entry.c            |  6 +++---
 merge-recursive.c  |  2 +-
 sha1-file.c        |  4 ++--
 10 files changed, 45 insertions(+), 33 deletions(-)
diff --git a/apply.c b/apply.c
index d79e61591b..9720855590 100644
--- a/apply.c
+++ b/apply.c
@@ -4333,7 +4333,7 @@ static int try_create_file(const char *path, unsigned int mode, const char *buf,
 	if (fd < 0)
 		return 1;
 
-	if (convert_to_working_tree(path, buf, size, &nbuf)) {
+	if (convert_to_working_tree(&the_index, path, buf, size, &nbuf)) {
 		size = nbuf.len;
 		buf  = nbuf.buf;
 	}
diff --git a/archive.c b/archive.c
index 3b4db8956a..f3631a4fb5 100644
--- a/archive.c
+++ b/archive.c
@@ -78,7 +78,7 @@ void *object_file_to_archive(const struct archiver_args *args,
 		size_t size = 0;
 
 		strbuf_attach(&buf, buffer, *sizep, *sizep + 1);
-		convert_to_working_tree(path, buf.buf, buf.len, &buf);
+		convert_to_working_tree(&the_index, path, buf.buf, buf.len, &buf);
 		if (commit)
 			format_subst(commit, buf.buf, buf.len, &buf);
 		buffer = strbuf_detach(&buf, &size);
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 665b581949..a615a0048b 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -38,7 +38,7 @@ static int filter_object(const char *path, unsigned mode,
 			     oid_to_hex(oid), path);
 	if ((type == OBJ_BLOB) && S_ISREG(mode)) {
 		struct strbuf strbuf = STRBUF_INIT;
-		if (convert_to_working_tree(path, *buf, *size, &strbuf)) {
+		if (convert_to_working_tree(&the_index, path, *buf, *size, &strbuf)) {
 			free(*buf);
 			*size = strbuf.len;
 			*buf = strbuf_detach(&strbuf, NULL);
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index 88bb2019ad..d996734b45 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -63,7 +63,7 @@ static void write_eolinfo(const struct index_state *istate,
 		struct stat st;
 		const char *i_txt = "";
 		const char *w_txt = "";
-		const char *a_txt = get_convert_attr_ascii(path);
+		const char *a_txt = get_convert_attr_ascii(&the_index, path);
 		if (ce && S_ISREG(ce->ce_mode))
 			i_txt = get_cached_convert_stats_ascii(istate,
 							       ce->name);
diff --git a/convert.c b/convert.c
index 9d5dc32564..2b1a87a104 100644
--- a/convert.c
+++ b/convert.c
@@ -1290,7 +1290,8 @@ struct conv_attrs {
 	const char *working_tree_encoding; /* Supported encoding or default encoding if NULL */
 };
 
-static void convert_attrs(struct conv_attrs *ca, const char *path)
+static void convert_attrs(const struct index_state *istate,
+			  struct conv_attrs *ca, const char *path)
 {
 	static struct attr_check *check;
 
@@ -1302,7 +1303,7 @@ static void convert_attrs(struct conv_attrs *ca, const char *path)
 		git_config(read_convert_config, NULL);
 	}
 
-	if (!git_check_attr(&the_index, path, check)) {
+	if (!git_check_attr(istate, path, check)) {
 		struct attr_check_item *ccheck = check->items;
 		ca->crlf_action = git_path_check_crlf(ccheck + 4);
 		if (ca->crlf_action == CRLF_UNDEFINED)
@@ -1339,11 +1340,11 @@ static void convert_attrs(struct conv_attrs *ca, const char *path)
 		ca->crlf_action = CRLF_AUTO_INPUT;
 }
 
-int would_convert_to_git_filter_fd(const char *path)
+int would_convert_to_git_filter_fd(const struct index_state *istate, const char *path)
 {
 	struct conv_attrs ca;
 
-	convert_attrs(&ca, path);
+	convert_attrs(istate, &ca, path);
 	if (!ca.drv)
 		return 0;
 
@@ -1358,11 +1359,11 @@ int would_convert_to_git_filter_fd(const char *path)
 	return apply_filter(path, NULL, 0, -1, NULL, ca.drv, CAP_CLEAN, NULL);
 }
 
-const char *get_convert_attr_ascii(const char *path)
+const char *get_convert_attr_ascii(const struct index_state *istate, const char *path)
 {
 	struct conv_attrs ca;
 
-	convert_attrs(&ca, path);
+	convert_attrs(istate, &ca, path);
 	switch (ca.attr_action) {
 	case CRLF_UNDEFINED:
 		return "";
@@ -1391,7 +1392,7 @@ int convert_to_git(const struct index_state *istate,
 	int ret = 0;
 	struct conv_attrs ca;
 
-	convert_attrs(&ca, path);
+	convert_attrs(istate, &ca, path);
 
 	ret |= apply_filter(path, src, len, -1, dst, ca.drv, CAP_CLEAN, NULL);
 	if (!ret && ca.drv && ca.drv->required)
@@ -1423,7 +1424,7 @@ void convert_to_git_filter_fd(const struct index_state *istate,
 			      int conv_flags)
 {
 	struct conv_attrs ca;
-	convert_attrs(&ca, path);
+	convert_attrs(istate, &ca, path);
 
 	assert(ca.drv);
 	assert(ca.drv->clean || ca.drv->process);
@@ -1436,14 +1437,15 @@ void convert_to_git_filter_fd(const struct index_state *istate,
 	ident_to_git(path, dst->buf, dst->len, dst, ca.ident);
 }
 
-static int convert_to_working_tree_internal(const char *path, const char *src,
+static int convert_to_working_tree_internal(const struct index_state *istate,
+					    const char *path, const char *src,
 					    size_t len, struct strbuf *dst,
 					    int normalizing, struct delayed_checkout *dco)
 {
 	int ret = 0, ret_filter = 0;
 	struct conv_attrs ca;
 
-	convert_attrs(&ca, path);
+	convert_attrs(istate, &ca, path);
 
 	ret |= ident_to_worktree(path, src, len, dst, ca.ident);
 	if (ret) {
@@ -1477,22 +1479,25 @@ static int convert_to_working_tree_internal(const char *path, const char *src,
 	return ret | ret_filter;
 }
 
-int async_convert_to_working_tree(const char *path, const char *src,
+int async_convert_to_working_tree(const struct index_state *istate,
+				  const char *path, const char *src,
 				  size_t len, struct strbuf *dst,
 				  void *dco)
 {
-	return convert_to_working_tree_internal(path, src, len, dst, 0, dco);
+	return convert_to_working_tree_internal(istate, path, src, len, dst, 0, dco);
 }
 
-int convert_to_working_tree(const char *path, const char *src, size_t len, struct strbuf *dst)
+int convert_to_working_tree(const struct index_state *istate,
+			    const char *path, const char *src,
+			    size_t len, struct strbuf *dst)
 {
-	return convert_to_working_tree_internal(path, src, len, dst, 0, NULL);
+	return convert_to_working_tree_internal(istate, path, src, len, dst, 0, NULL);
 }
 
 int renormalize_buffer(const struct index_state *istate, const char *path,
 		       const char *src, size_t len, struct strbuf *dst)
 {
-	int ret = convert_to_working_tree_internal(path, src, len, dst, 1, NULL);
+	int ret = convert_to_working_tree_internal(istate, path, src, len, dst, 1, NULL);
 	if (ret) {
 		src = dst->buf;
 		len = dst->len;
@@ -1926,12 +1931,14 @@ static struct stream_filter *ident_filter(const struct object_id *oid)
  * Note that you would be crazy to set CRLF, smuge/clean or ident to a
  * large binary blob you would want us not to slurp into the memory!
  */
-struct stream_filter *get_stream_filter(const char *path, const struct object_id *oid)
+struct stream_filter *get_stream_filter(const struct index_state *istate,
+					const char *path,
+					const struct object_id *oid)
 {
 	struct conv_attrs ca;
 	struct stream_filter *filter = NULL;
 
-	convert_attrs(&ca, path);
+	convert_attrs(istate, &ca, path);
 	if (ca.drv && (ca.drv->process || ca.drv->smudge || ca.drv->clean))
 		return NULL;
 
diff --git a/convert.h b/convert.h
index 0a0fa15b58..6d0ee887ed 100644
--- a/convert.h
+++ b/convert.h
@@ -60,15 +60,18 @@ extern char *check_roundtrip_encoding;
 const char *get_cached_convert_stats_ascii(const struct index_state *istate,
 					   const char *path);
 const char *get_wt_convert_stats_ascii(const char *path);
-const char *get_convert_attr_ascii(const char *path);
+const char *get_convert_attr_ascii(const struct index_state *istate,
+				   const char *path);
 
 /* returns 1 if *dst was used */
 int convert_to_git(const struct index_state *istate,
 		   const char *path, const char *src, size_t len,
 		   struct strbuf *dst, int conv_flags);
-int convert_to_working_tree(const char *path, const char *src,
+int convert_to_working_tree(const struct index_state *istate,
+			    const char *path, const char *src,
 			    size_t len, struct strbuf *dst);
-int async_convert_to_working_tree(const char *path, const char *src,
+int async_convert_to_working_tree(const struct index_state *istate,
+				  const char *path, const char *src,
 				  size_t len, struct strbuf *dst,
 				  void *dco);
 int async_query_available_blobs(const char *cmd,
@@ -86,7 +89,8 @@ void convert_to_git_filter_fd(const struct index_state *istate,
 			      const char *path, int fd,
 			      struct strbuf *dst,
 			      int conv_flags);
-int would_convert_to_git_filter_fd(const char *path);
+int would_convert_to_git_filter_fd(const struct index_state *istate,
+				   const char *path);
 
 /*****************************************************************
  *
@@ -96,7 +100,8 @@ int would_convert_to_git_filter_fd(const char *path);
 
 struct stream_filter; /* opaque */
 
-struct stream_filter *get_stream_filter(const char *path,
+struct stream_filter *get_stream_filter(const struct index_state *istate,
+					const char *path,
 					const struct object_id *);
 void free_stream_filter(struct stream_filter *);
 int is_null_stream_filter(struct stream_filter *);
diff --git a/diff.c b/diff.c
index 136d44b455..526ee2e911 100644
--- a/diff.c
+++ b/diff.c
@@ -3695,7 +3695,7 @@ static void prep_temp_blob(const char *path, struct diff_tempfile *temp,
 	temp->tempfile = mks_tempfile_ts(tempfile.buf, strlen(base) + 1);
 	if (!temp->tempfile)
 		die_errno("unable to create temp-file");
-	if (convert_to_working_tree(path,
+	if (convert_to_working_tree(&the_index, path,
 			(const char *)blob, (size_t)size, &buf)) {
 		blob = buf.buf;
 		size = buf.len;
diff --git a/entry.c b/entry.c
index 2101201a11..12d9191051 100644
--- a/entry.c
+++ b/entry.c
@@ -265,7 +265,7 @@ static int write_entry(struct cache_entry *ce,
 	const struct submodule *sub;
 
 	if (ce_mode_s_ifmt == S_IFREG) {
-		struct stream_filter *filter = get_stream_filter(ce->name,
+		struct stream_filter *filter = get_stream_filter(&the_index, ce->name,
 								 &ce->oid);
 		if (filter &&
 		    !streaming_write_entry(ce, path, filter,
@@ -313,14 +313,14 @@ static int write_entry(struct cache_entry *ce,
 		 * Convert from git internal format to working tree format
 		 */
 		if (dco && dco->state != CE_NO_DELAY) {
-			ret = async_convert_to_working_tree(ce->name, new_blob,
+			ret = async_convert_to_working_tree(&the_index, ce->name, new_blob,
 							    size, &buf, dco);
 			if (ret && string_list_has_string(&dco->paths, ce->name)) {
 				free(new_blob);
 				goto delayed;
 			}
 		} else
-			ret = convert_to_working_tree(ce->name, new_blob, size, &buf);
+			ret = convert_to_working_tree(&the_index, ce->name, new_blob, size, &buf);
 
 		if (ret) {
 			free(new_blob);
diff --git a/merge-recursive.c b/merge-recursive.c
index ac27abbd4c..b404ebac7c 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -961,7 +961,7 @@ static int update_file_flags(struct merge_options *o,
 		}
 		if (S_ISREG(mode)) {
 			struct strbuf strbuf = STRBUF_INIT;
-			if (convert_to_working_tree(path, buf, size, &strbuf)) {
+			if (convert_to_working_tree(&the_index, path, buf, size, &strbuf)) {
 				free(buf);
 				size = strbuf.len;
 				buf = strbuf_detach(&strbuf, NULL);
diff --git a/sha1-file.c b/sha1-file.c
index 555e780f4b..0b0834452d 100644
--- a/sha1-file.c
+++ b/sha1-file.c
@@ -1860,7 +1860,7 @@ static int index_stream_convert_blob(struct object_id *oid, int fd,
 	struct strbuf sbuf = STRBUF_INIT;
 
 	assert(path);
-	assert(would_convert_to_git_filter_fd(path));
+	assert(would_convert_to_git_filter_fd(&the_index, path));
 
 	convert_to_git_filter_fd(&the_index, path, fd, &sbuf,
 				 get_conv_flags(flags));
@@ -1950,7 +1950,7 @@ int index_fd(struct object_id *oid, int fd, struct stat *st,
 	 * Call xsize_t() only when needed to avoid potentially unnecessary
 	 * die() for large files.
 	 */
-	if (type == OBJ_BLOB && path && would_convert_to_git_filter_fd(path))
+	if (type == OBJ_BLOB && path && would_convert_to_git_filter_fd(&the_index, path))
 		ret = index_stream_convert_blob(oid, fd, path, flags);
 	else if (!S_ISREG(st->st_mode))
 		ret = index_pipe(oid, fd, type, path, flags);
-- 
2.18.0.rc0.333.g22e6ee6cdf
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 63 of 92 in “unpack-trees.c: do not use "the_index"”
  1. unpack-trees.c: do not use "the_index"Nguyễn Thái Ngọc Duy, Jun 1, 2018
  2. Elijah NewrenJun 1, 2018
  3. Stefan BellerJun 1, 2018
  4. Duy NguyenJun 2, 2018
  5. Duy NguyenJun 2, 2018
  6. Elijah NewrenJun 3, 2018
  7. Brandon WilliamsJun 4, 2018
  8. 0/6 Fix "the_index" usage in unpack-trees.cNguyễn Thái Ngọc Duy, Jun 5, 2018
  9. 1/6 unpack-trees: remove 'extern' on function declarationNguyễn Thái Ngọc Duy, Jun 5, 2018
  10. 3/6 unpack-trees: don't shadow global var the_indexNguyễn Thái Ngọc Duy, Jun 5, 2018
  11. Ramsay JonesJun 5, 2018
  12. 4/6 unpack-tress: convert clear_ce_flags* to avoid the_indexNguyễn Thái Ngọc Duy, Jun 5, 2018
  13. Ramsay JonesJun 5, 2018
  14. 5/6 unpack-trees: avoid the_index in verify_absent()Nguyễn Thái Ngọc Duy, Jun 5, 2018
  15. 6/6 Forbid "the_index" in dir.c and unpack-trees.cNguyễn Thái Ngọc Duy, Jun 5, 2018
  16. Brandon WilliamsJun 5, 2018
  17. Duy NguyenJun 6, 2018
  18. 2/6 unpack-trees: add a note about path invalidationNguyễn Thái Ngọc Duy, Jun 5, 2018
  19. 0/5 Fix "the_index" usage in unpack-trees.cNguyễn Thái Ngọc Duy, Jun 6, 2018
  20. 1/5 unpack-trees: remove 'extern' on function declarationNguyễn Thái Ngọc Duy, Jun 6, 2018
  21. 4/5 unpack-tress: convert clear_ce_flags* to avoid the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  22. 3/5 unpack-trees: don't shadow global var the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  23. 2/5 unpack-trees: add a note about path invalidationNguyễn Thái Ngọc Duy, Jun 6, 2018
  24. 5/5 unpack-trees: avoid the_index in verify_absent()Nguyễn Thái Ngọc Duy, Jun 6, 2018
  25. 00/20 Fix incorrect use of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  26. 02/20 unpack-trees: add a note about path invalidationNguyễn Thái Ngọc Duy, Jun 6, 2018
  27. 01/20 unpack-trees: remove 'extern' on function declarationNguyễn Thái Ngọc Duy, Jun 6, 2018
  28. 04/20 unpack-tress: convert clear_ce_flags* to avoid the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  29. 05/20 unpack-trees: avoid the_index in verify_absent()Nguyễn Thái Ngọc Duy, Jun 6, 2018
  30. 03/20 unpack-trees: don't shadow global var the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  31. 11/20 ls-files: correct index argument to get_convert_attr_ascii()Nguyễn Thái Ngọc Duy, Jun 6, 2018
  32. 10/20 dir.c: remove an implicit dependency on the_index in pathspec codeNguyễn Thái Ngọc Duy, Jun 6, 2018
  33. 14/20 entry.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  34. 09/20 convert.c: remove an implicit dependency on the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  35. 19/20 grep: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  36. 17/20 cache.c: remove an implicit dependency on the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  37. Brandon WilliamsJun 6, 2018
  38. 18/20 resolve-undo.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  39. 20/20 cache.h: make the_index part of "compatibility macros"Nguyễn Thái Ngọc Duy, Jun 6, 2018
  40. 16/20 preload-index.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  41. 12/20 pathspec.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  42. 15/20 attr: remove index from git_attr_set_direction()Nguyễn Thái Ngọc Duy, Jun 6, 2018
  43. Brandon WilliamsJun 6, 2018
  44. 08/20 convert.h: drop 'extern' from function declarationNguyễn Thái Ngọc Duy, Jun 6, 2018
  45. 13/20 submodule.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  46. 06/20 attr.h: drop extern from function declarationNguyễn Thái Ngọc Duy, Jun 6, 2018
  47. 07/20 attr: remove an implicit dependency on the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  48. Ramsay JonesJun 6, 2018
  49. Brandon WilliamsJun 6, 2018
  50. Duy NguyenJun 6, 2018
  51. Brandon WilliamsJun 6, 2018
  52. 00/23 Fix incorrect use of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  53. 01/23 unpack-trees: remove 'extern' on function declarationNguyễn Thái Ngọc Duy, Jun 6, 2018
  54. 02/23 unpack-trees: add a note about path invalidationNguyễn Thái Ngọc Duy, Jun 6, 2018
  55. 04/23 unpack-tress: convert clear_ce_flags* to avoid the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  56. Elijah NewrenJun 7, 2018
  57. Duy NguyenJun 7, 2018
  58. Duy NguyenJun 8, 2018
  59. 03/23 unpack-trees: don't shadow global var the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  60. 05/23 unpack-trees: avoid the_index in verify_absent()Nguyễn Thái Ngọc Duy, Jun 6, 2018
  61. 06/23 attr.h: drop extern from function declarationNguyễn Thái Ngọc Duy, Jun 6, 2018
  62. 08/23 convert.h: drop 'extern' from function declarationNguyễn Thái Ngọc Duy, Jun 6, 2018
  63. 09/23 convert.c: remove an implicit dependency on the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  64. 11/23 ls-files: correct index argument to get_convert_attr_ascii()Nguyễn Thái Ngọc Duy, Jun 6, 2018
  65. 10/23 dir.c: remove an implicit dependency on the_index in pathspec codeNguyễn Thái Ngọc Duy, Jun 6, 2018
  66. 14/23 entry.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  67. 13/23 submodule.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  68. 16/23 preload-index.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  69. 20/23 checkout: avoid the_index when possibleNguyễn Thái Ngọc Duy, Jun 6, 2018
  70. 23/23 cache.h: make the_index part of "compatibility macros"Nguyễn Thái Ngọc Duy, Jun 6, 2018
  71. 22/23 grep: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  72. 19/23 difftool: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  73. 21/23 resolve-undo.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  74. 18/23 apply.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  75. 15/23 attr: remove index from git_attr_set_direction()Nguyễn Thái Ngọc Duy, Jun 6, 2018
  76. Elijah NewrenJun 9, 2018
  77. 17/23 read-cache.c: remove an implicit dependency on the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  78. Elijah NewrenJun 9, 2018
  79. Duy NguyenJun 9, 2018
  80. Elijah NewrenJun 9, 2018
  81. 12/23 pathspec.c: use the right index instead of the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  82. 07/23 attr: remove an implicit dependency on the_indexNguyễn Thái Ngọc Duy, Jun 6, 2018
  83. Elijah NewrenJun 7, 2018
  84. Elijah NewrenJun 9, 2018
  85. Duy NguyenJun 11, 2018
  86. Elijah NewrenJun 11, 2018
  87. Duy NguyenJun 11, 2018
  88. Elijah NewrenJun 11, 2018
  89. Duy NguyenJun 11, 2018
  90. Duy NguyenJun 14, 2018
  91. Elijah NewrenJun 14, 2018
  92. Duy NguyenJun 11, 2018

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.