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

[PATCH v2 1/3] refs: call branches branches

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 4, 2024, 22:01 UTC
Message-ID
<20240604220145.3260714-2-gitster@pobox.com>
In-Reply-To
<20240604220145.3260714-1-gitster@pobox.com>

These things in refs/heads/ hierarchy are called "branches" in human parlance. Replace REF_HEADS with REF_BRANCHES to make it clearer.

No end-user visible change intended at this step.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/ls-remote.c | 4 ++--
 connect.c           | 4 ++--
 remote.h            | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index e8d65ebbdc..65fb22a8a2 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -68,7 +68,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
 			   N_("path of git-upload-pack on the remote host"),
 			   PARSE_OPT_HIDDEN },
 		OPT_BIT('t', "tags", &flags, N_("limit to tags"), REF_TAGS),
-		OPT_BIT('h', "heads", &flags, N_("limit to heads"), REF_HEADS),
+		OPT_BIT('h', "heads", &flags, N_("limit to heads"), REF_BRANCHES),
 		OPT_BIT(0, "refs", &flags, N_("do not show peeled tags"), REF_NORMAL),
 		OPT_BOOL(0, "get-url", &get_url,
 			 N_("take url.<base>.insteadOf into account")),
@@ -100,7 +100,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
 
 	if (flags & REF_TAGS)
 		strvec_push(&transport_options.ref_prefixes, "refs/tags/");
-	if (flags & REF_HEADS)
+	if (flags & REF_BRANCHES)
 		strvec_push(&transport_options.ref_prefixes, "refs/heads/");
 
 	remote = remote_get(dest);
diff --git a/connect.c b/connect.c
index 0d77737a53..cf84e631e9 100644
--- a/connect.c
+++ b/connect.c
@@ -38,8 +38,8 @@ static int check_ref(const char *name, unsigned int flags)
 							 REFNAME_ALLOW_ONELEVEL))
 		return 0;
 
-	/* REF_HEADS means that we want regular branch heads */
-	if ((flags & REF_HEADS) && starts_with(name, "heads/"))
+	/* REF_BRANCHES means that we want regular branch heads */
+	if ((flags & REF_BRANCHES) && starts_with(name, "heads/"))
 		return 1;
 
 	/* REF_TAGS means that we want tags */
diff --git a/remote.h b/remote.h
index dfd4837e60..02e330f42c 100644
--- a/remote.h
+++ b/remote.h
@@ -200,7 +200,7 @@ struct ref {
 };
 
 #define REF_NORMAL	(1u << 0)
-#define REF_HEADS	(1u << 1)
+#define REF_BRANCHES	(1u << 1)
 #define REF_TAGS	(1u << 2)
 
 struct ref *find_ref_by_name(const struct ref *list, const char *name);
-- 
2.45.2-409-g7b0defb391
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 22 in “Branches are branches and not heads”
  1. 0/3 Branches are branches and not headsJunio C Hamano, Jun 3, 2024
  2. 1/3 refs: call branches branchesJunio C Hamano, Jun 3, 2024
  3. Eric SunshineJun 3, 2024
  4. 2/3 ls-remote: introduce --branches and deprecate --headsJunio C Hamano, Jun 3, 2024
  5. Rubén JustoJun 3, 2024
  6. Eric SunshineJun 3, 2024
  7. Junio C HamanoJun 3, 2024
  8. 3/3 show-ref: introduce --branches and deprecate --headsJunio C Hamano, Jun 3, 2024
  9. Rubén JustoJun 3, 2024
  10. Patrick SteinhardtJun 4, 2024
  11. 0/3 Branches are branches and not headsJunio C Hamano, Jun 4, 2024
  12. 1/3 refs: call branches branchesJunio C Hamano, Jun 4, 2024
  13. 2/3 ls-remote: introduce --branches and deprecate --headsJunio C Hamano, Jun 4, 2024
  14. Patrick SteinhardtJun 6, 2024
  15. Junio C HamanoJun 6, 2024
  16. 3/3 show-ref: introduce --branches and deprecate --headsJunio C Hamano, Jun 4, 2024
  17. Elijah NewrenJun 14, 2024
  18. Junio C HamanoJun 14, 2024
  19. Elijah NewrenJun 14, 2024
  20. Elijah NewrenJun 14, 2024
  21. Junio C HamanoJun 14, 2024
  22. Patrick SteinhardtJun 6, 2024

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.