gitFull does not contain `git send-email`

I have gitFull in my systemPackages, but when trying to git send-email it tells me that it does not know that command.

When I do nix-shell -p gitFull I can git send-email, though.

What is happening?

1 Like

@musicmatze what version of NixOS are you using? I have gitFull in 18.09 and not experiencing this issue.

2 Likes

18.09, had this issue before on 18.03.

1 Like

That sounds like you have some other version of git installed and use that instead (because it comes first in PATH). You can check which version you’re using with which git. It may be helpful to resolve symlinks with

readlink -f $( which git )

1 Like

which git gives /run/current-system/sw/bin/git which should be appropriate, right?

readlink -f $(which git) gives /nix/store/2mibc8qxhbh1k7r0p8a9r8c66h5xwspz-git-2.18.1/bin/git

nix-shell -p gitFull --run 'readlink -f $(which git)' gives /nix/store/l3r8r58j7n43mkkn9c66ryb7phmzjbv9-git-2.18.1/bin/git.

1 Like

Try nix-env -q | grep git.

This will let you know if you have a nix-env-managed installation of git (which you likely have). If so, try nix-env -e git to get rid of it.

1 Like

Nope, I do not have one of those:

$ nix-env -q | grep git
git-annex-6.20180626
1 Like

Have you run nix-channel --update as root and as your user? The channel versions might be different between those two as nix-shell uses the channels of your user.

I link my channel folder on my users on my personal systems to the system channel to have consistent versions whether I run stuff as root or not.

1 Like

I suppose having git-annex in nix-env-managed packages can have the same effect as well (although I couldn’t reproduce locally). Try to remove it (or move to systemPackages).

1 Like

I also do not have user channels.

I try to remove git-annex (as @pvgoran suggested) and we’ll see.

Update: Nope, removing git-annex does not help.

1 Like

Now the fun starts:

I’ve put the following snippet into my configuration.nix / system packages:

  (pkgs.git.override {
    svnSupport       = false;
    guiSupport       = false;
    sendEmailSupport = true;
    withLibsecret    = true;
  })

and after nixos-rebuild build I can ./result/sw/bin/git send-email and get

git: 'send-email' is not a git command. See 'git --help'.
1 Like

Even more fun: After sudo nixos-rebuild testing the configuration, git send<tab> autocompletes to git send-email, but firing that command results in the same error message as posted above.

$ which git
/run/current-system/sw/bin/git
$ readlink $(which git)
/nix/store/l3r8r58j7n43mkkn9c66ryb7phmzjbv9-git-2.18.1/bin/git
$ ls /nix/store/l3r8r58j7n43mkkn9c66ryb7phmzjbv9-git-2.18.1/libexec/git-core/git-send*
/nix/store/l3r8r58j7n43mkkn9c66ryb7phmzjbv9-git-2.18.1/libexec/git-core/git-send-email
/nix/store/l3r8r58j7n43mkkn9c66ryb7phmzjbv9-git-2.18.1/libexec/git-core/git-send-pack
# ok so my version has git-send-email
# this is the same version that nix-shell gives you

# now testing the other version
$ nix-store --realize /nix/store/2mibc8qxhbh1k7r0p8a9r8c66h5xwspz-git-2.18.1
$ ls /nix/store/2mibc8qxhbh1k7r0p8a9r8c66h5xwspz-git-2.18.1/libexec/git-core/git-send*
/nix/store/2mibc8qxhbh1k7r0p8a9r8c66h5xwspz-git-2.18.1/libexec/git-core/git-send-pack

So indeed your system git doesn’t contain git-send-email. Somehow two versions must be included and that one is taking priority. When building the system derivation there is probably some output that complains about the conflict.