path: root/Makefile
diff options
authorJeff King <>2020-08-13 14:58:55 (GMT)
committerJunio C Hamano <>2020-08-13 18:02:08 (GMT)
commitb5dd96b70aca364f163f0b3743418779cfe062e6 (patch)
tree74ce93ebb5a91a27a746a1c4cb91277e1dd09184 /Makefile
parenta04f6531099cabbbb94e3d7be0b3db0b718860ee (diff)
make credential helpers builtins
There's no real reason for credential helpers to be separate binaries. I did them this way originally under the notion that helper don't _need_ to be part of Git, and so can be built totally separately (and indeed, the ones in contrib/credential are). But the ones in our main Makefile build on libgit.a, and the resulting binaries are reasonably large. We can slim down our total disk footprint by just making them builtins. This reduces the size of: make strip install from 29MB to 24MB on my Debian system. Note that credential-cache can't operate without support for Unix sockets. Currently we just don't build it at all when NO_UNIX_SOCKETS is set. We could continue that with conditionals in the Makefile and our list of builtins. But instead, let's build a dummy implementation that dies with an informative message. That has two advantages: - it's simpler, because the conditional bits are all kept inside the credential-cache source - a user who is expecting it to exist will be told _why_ they can't use it, rather than getting the "credential-cache is not a git command" error which makes it look like the Git install is broken. Note that our dummy implementation does still respond to "-h" in order to appease t0012 (and this may be a little friendlier for users, as well). Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Makefile')
1 files changed, 3 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 271b963..5b43c0f 100644
--- a/Makefile
+++ b/Makefile
@@ -672,7 +672,6 @@ EXTRA_PROGRAMS =
PROGRAM_OBJS += bugreport.o
-PROGRAM_OBJS += credential-store.o
PROGRAM_OBJS += daemon.o
PROGRAM_OBJS += fast-import.o
PROGRAM_OBJS += http-backend.o
@@ -1052,6 +1051,9 @@ BUILTIN_OBJS += builtin/checkout-index.o
BUILTIN_OBJS += builtin/checkout.o
BUILTIN_OBJS += builtin/clean.o
BUILTIN_OBJS += builtin/clone.o
+BUILTIN_OBJS += builtin/credential-cache.o
+BUILTIN_OBJS += builtin/credential-cache--daemon.o
+BUILTIN_OBJS += builtin/credential-store.o
BUILTIN_OBJS += builtin/column.o
BUILTIN_OBJS += builtin/commit-graph.o
BUILTIN_OBJS += builtin/commit-tree.o
@@ -1634,11 +1636,8 @@ ifdef NO_INET_PTON
- EXCLUDED_PROGRAMS += git-credential-cache git-credential-cache--daemon
LIB_OBJS += unix-socket.o
- PROGRAM_OBJS += credential-cache.o
- PROGRAM_OBJS += credential-cache--daemon.o
ifdef NO_ICONV
@@ -2901,7 +2900,6 @@ ifdef MSVC
# because it is just a copy/hardlink of git.exe, rather than a unique binary.
$(INSTALL) git.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) git-shell.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
- $(INSTALL) git-credential-store.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) git-daemon.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) git-fast-import.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) git-http-backend.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'