]> git.ipfire.org Git - thirdparty/git.git/commit - git.c
make credential helpers builtins
authorJeff King <peff@peff.net>
Thu, 13 Aug 2020 14:58:55 +0000 (10:58 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Aug 2020 18:02:08 +0000 (11:02 -0700)
commitb5dd96b70aca364f163f0b3743418779cfe062e6
tree74ce93ebb5a91a27a746a1c4cb91277e1dd09184
parenta04f6531099cabbbb94e3d7be0b3db0b718860ee
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
builtin.h
builtin/credential-cache--daemon.c [moved from credential-cache--daemon.c with 91% similarity]
builtin/credential-cache.c [moved from credential-cache.c with 83% similarity]
builtin/credential-store.c [moved from credential-store.c with 96% similarity]
contrib/buildsystems/CMakeLists.txt
git.c