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

[PATCH] Makefile: mark git-maintenance as a builtin

From
Jeff King <peff@peff.net>
Date
Dec 2, 2020, 02:34 UTC
Message-ID
<X8b9IyU6E92efYaO@coredump.intra.peff.net>

We normally get the list of builtin commands by expanding BUILTIN_OBJS. But for commands which are embedded inside another's source file (e.g., cmd_show() in builtin/log.c), the Makefile needs to be told explicitly about them.

Since cmd_maintenance() is inside buitin/gc.c, it should be listed explicitly in the BUILT_INS list in the Makefile. Not doing so isn't _too_ tragic, as it simply means we will not make a git-maintenance symlink in libexec/git-core. Since we encourage people to use the "git foo" form, even in scripts which have put libexec into their PATH, nobody seems to have noticed.

Signed-off-by: Jeff King <peff@peff.net>
---
I don't really care that much. I just happened to notice there is a
git-maintenance pattern in .gitignore which will not ever trigger.

I could actually see an argument that this is not worth doing for new commands. The dashed forms of the other commands have worked for a long time, so losing them would be a regression. But since git-maintenance would never have worked, presumably everybody who cares is using the recommended "git maintenance" form already.

So I'm happy with that direction, too, but in that case we should probably remove the .gitignore entry. :)

 Makefile | 1 +
 1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index d3a531d3c6..1e507b9de0 100644
--- a/Makefile
+++ b/Makefile
@@ -769,6 +769,7 @@ BUILT_INS += git-cherry-pick$X
 BUILT_INS += git-format-patch$X
 BUILT_INS += git-fsck-objects$X
 BUILT_INS += git-init$X
+BUILT_INS += git-maintenance$X
 BUILT_INS += git-merge-subtree$X
 BUILT_INS += git-restore$X
 BUILT_INS += git-show$X
-- 
2.29.2.894.g2dadb8c6b8
Next: Junio C Hamano
Message 1 of 3 in “Makefile: mark git-maintenance as a builtin”
  1. Makefile: mark git-maintenance as a builtinJeff King, Dec 2, 2020
  2. Junio C HamanoDec 2, 2020
  3. Derrick StoleeDec 3, 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.