packer.nvim icon indicating copy to clipboard operation
packer.nvim copied to clipboard

git submodule --progress option only works with git >= 2.11

Open wgurecky opened this issue 3 years ago • 4 comments

The default git submodule command only works with git >=2.11 (https://stackoverflow.com/questions/32944468/how-to-show-progress-for-submodule-fetching) .

https://github.com/wbthomason/packer.nvim/blob/851c62c5ecd3b5adc91665feda8f977e104162a5/lua/packer.lua#L39

Consider removing the --progress argument to maintain compatibility with git<2.11 .

wgurecky avatar Dec 26 '21 21:12 wgurecky

Ah, this must be why all of my updates are failing with errors like:

  Errors:
    remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
    HEAD is now at 518e275... Update lockfile.json
    remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
    usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
       or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
       or: git submodule [--quiet] init [--] [<path>...]
       or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
       or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--reference <repository>] [--recursiv
       or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
       or: git submodule [--quiet] foreach [--recursive] <command>
       or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
    518e275

With git 2.9.5.

fwip avatar Jul 24 '22 19:07 fwip

Same problem.

rongcuid avatar Aug 15 '22 13:08 rongcuid

Packer exposes git commands that packer will run. For those that cant or do not want to update their git version you can change the submodule command.

require('packer').startup {
  function(use) end,
  config = {
    git = {
      subcommands = {
        submodules = 'submodule update --init --recursive',
      },
    },
  },
}

The current git version is 2.37.2. Version 2.11.0 came out 29-Nov-2016. Most people have a more current version of git then one from 2016.

EdenEast avatar Aug 15 '22 14:08 EdenEast

Fixed this part and have another issue which I think is a bug: #1014

I am stuck with a CentOS 7 station which comes with an even older version of Git 1.8.

rongcuid avatar Aug 15 '22 14:08 rongcuid