Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

git: error: unknown option no-edit' or config or local` #1071

Closed
wheredyoufindthis opened this issue Apr 13, 2016 · 28 comments
Closed

git: error: unknown option no-edit' or config or local` #1071

wheredyoufindthis opened this issue Apr 13, 2016 · 28 comments
Assignees
Labels

Comments

@wheredyoufindthis
Copy link

I have git 1.7.1
I try to

$ brew install python3
==> Tapping homebrew/dupes
error: unknown option `config

or

$ brew update
error: unknown option `no-edit'

That mistakes about the age of my git's version, but I can't find out what version is better to use
Under some circumstances I can't use cutting-edge 2.* versions :(

@sjackman
Copy link
Member

I don't know which minimum version is required either. =p
Try brew install git

@sjackman sjackman self-assigned this Apr 13, 2016
@sjackman sjackman added the bug label Apr 13, 2016
@sjackman sjackman changed the title No information about Git version to use git: error: unknown option no-edit' or config` Apr 13, 2016
@sjackman
Copy link
Member

I thought git config went back to day one of git? Strange. Please report

which -a git
git --version
git config user.name

@sjackman
Copy link
Member

Never mind my previous message. The command that's causing the error is: git clone --config.
We need to add a brew doctor check to check the version of git.
brew install git should fix your trouble.

@wheredyoufindthis
Copy link
Author

Thank you for the answer!
I suppose that the only way to install git is installing it from sources

Cause brew uses git to fetch git

@rwhogg
Copy link
Contributor

rwhogg commented Apr 13, 2016

I thought such a doctor check already existed. I remember seeing it just yesterday. Might just have to change the minimum required version.

@sjackman
Copy link
Member

@tulindanil Please report brew doctor

@sjackman
Copy link
Member

An outdated version of Git was detected in your PATH.
Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub.
Please upgrade: brew #{git_upgrade_cmd} git

I have git 1.7.1

Your version of git is too old (but we already knew that).

@sjackman
Copy link
Member

Cause brew uses git to fetch git

Are you sure? It shouldn't. It's a bug if it does.

$ brew install git -v
==> Installing dependencies for git: patchelf, zlib, binutils, linux-headers, glibc, xz, gmp, gpatch, mpfr, libmpc, isl, gcc, makedepend, openssl, pkg-config, curl, expat

@sjackman
Copy link
Member

It would be helpful I think to run Diagnostic::check_for_git before brew tap or brew update. In fact, I though it did do this, but I guess not.

@wheredyoufindthis
Copy link
Author

It is my fault that I did not launch that command
But nevertheless it will be great if this information will be on your website!

$ brew doctor

...

Warning: An outdated version of Git was detected in your PATH.
Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub.
Please upgrade: brew install git

...

And my git is really dummy

$ brew install git -v
==> Tapping homebrew/dupes
git clone https://github.com/Homebrew/homebrew-dupes /home-local/gratom/satom12/.linuxbrew/Library/Taps/homebrew/homebrew-dupes --config core.autocrlf=false --depth=1
error: unknown option `config'
...
Error: Failure while executing: git clone https://github.com/Homebrew/homebrew-dupes /home-local/gratom/satom12/.linuxbrew/Library/Taps/homebrew/homebrew-dupes --config core.autocrlf=false --depth=1

Thank you very much, you are awesome!

@sjackman
Copy link
Member

I want to figure out why your git depends on homebrew/dupes, but my git does not.
Please report brew deps git and brew deps --tree git

$ brew deps --tree git
git (required dependencies)
├── xz
├── xz
├── xz
├── openssl
│   ├── makedepend
│   │   └── pkg-config
│   ├── gpatch
│   │   └── xz
│   ├── gpatch
│   │   └── xz
│   └── zlib
├── curl
│   ├── pkg-config
│   ├── gpatch
│   │   └── xz
│   └── openssl
│       ├── makedepend
│       │   └── pkg-config
│       ├── gpatch
│       │   └── xz
│       ├── gpatch
│       │   └── xz
│       └── zlib
└── expat

@sjackman
Copy link
Member

You can also try brew install -s git

@wheredyoufindthis
Copy link
Author

$ brew deps git
Error: No available formula with the name "homebrew/dupes/m4" 
Please tap it and then try again: brew tap homebrew/dupes
$ brew deps --tree git
git (required dependencies)
├── xz
├── xz
├── xz
├── openssl
│   ├── make depend
│   │   └── pig-config
│   ├── patch
│   │   └── xz
│   ├── patch
│   │   └── xz
│   └── lib
├── curl
│   ├── pig-config
│   ├── patch
│   │   └── xz
│   └── openssl
│       ├── make depend
│       │   └── pig-config
│       ├── patch
│       │   └── xz
│       ├── patch
│       │   └── xz
│       └── lib
└── expat
$ brew install -s git
==> Tapping homebrew/dupes
error: unknown option `config'
...

@sjackman
Copy link
Member

I can reproduce this bug on CentOS 6 with git 1.7.1.

$ brew tap homebrew/dupes
==> Tapping homebrew/dupes
error: unknown option `config'
usage: git clone [options] [--] <repo> [<dir>]
…
Error: Failure while executing: git clone https://github.com/Homebrew/homebrew-dupes /home/sjackman/.linuxbrew/Library/Taps/homebrew/homebrew-dupes --config core.autocrlf=false --depth=1

@sjackman
Copy link
Member

But nevertheless it will be great if this information will be on your website!

There isn't a git dependency listed, because brew install git is supposed to work. It's a bug that it doesn't.

@sjackman
Copy link
Member

Now that I can reproduce this bug, I'll work on figuring it out.

$ brew deps git --skip-optional
curl
expat
gpatch
makedepend
openssl
pkg-config
xz
zlib
$ brew deps git
Error: No available formula with the name "homebrew/dupes/m4" 
Please tap it and then try again: brew tap homebrew/dupes

The tapping logic is trying to tap due to an optional dependency, even though it won't be installed.

@sjackman
Copy link
Member

Try

brew install patchelf
brew install zlib
brew install binutils
brew install linux-headers
brew install glibc
brew install xz
brew install gmp
brew install gpatch
brew install mpfr
brew install libmpc
brew install isl
brew install gcc
brew install makedepend
brew install openssl
brew install pkg-config
brew install curl
brew install expat
brew install git

@sjackman
Copy link
Member

@ilovezfs Hi, Joe. When installing git, the tapping logic is trying to tap Homebrew/dupes due to an optional dependency of git (somewhere down the dependency chain), which isn't actually going to be installed. The problem is that git isn't yet installed, so the tapping fails.

@sjackman
Copy link
Member

Related:

$ brew deps git
Error: No available formula with the name "homebrew/dupes/m4" 
Please tap it and then try again: brew tap homebrew/dupes

I'm less worried about this error. In fact, I'm just fine with the current behaviour.

@maxim-belkin
Copy link
Contributor

maxim-belkin commented Apr 14, 2016

I think this issue will be resolved one day by creating a statically-linked-git formula following the guides from here.

@sjackman
Copy link
Member

Does anyone know whether the git bottle is relocatable in practice? It's not currently marked as being cellar :any.

@sjackman
Copy link
Member

sjackman commented Apr 14, 2016

In fact, I'm just fine with the current behaviour.

Except that I never understood why --skip-optional isn't the default behaviour. I think that --with-all-options should be the opt-in behaviour. brew deps foo should show the packages that would be installed by brew install foo, and have options to give other behaviour, with respect to bottles and options.

@ilovezfs
Copy link
Contributor

@sjackman
Copy link
Member

See Homebrew/brew#92

@DoomHammer
Copy link
Contributor

As for git versions and brew doctor complaining: ipython/ipython#2195 . It seems releases after 1.7.9.5 should suffice.

@sjackman
Copy link
Member

Can we close this issue since we have the brew doctor check?

@sjackman sjackman changed the title git: error: unknown option no-edit' or config` git: error: unknown option no-edit' or config or local` Apr 30, 2016
@njia
Copy link

njia commented May 4, 2016

I had similar problem, when I tried to upgrade from linuxbrew git 2.8 to 2.8.2 I got following error

Error: Failure while executing: git config --local --replace-all homebrew.private false

The solution for me is to remove git 1.7.1 from CenOS but I am surprised to see this problem as I have linuxbrew git comes first in my $PATH.

[njia@centos6 Desktop]$ brew outdated
readline (6.3.8 < 6.3.8_1)
vim (7.4.1655 < 7.4.1795)
git (2.8.0 < 2.8.2)
sqlite (3.11.0_1 < 3.12.2)
ansible (2.0.1.0 < 2.0.2.0)
openssl (1.0.2g < 1.0.2h)
[njia@centos6 Desktop]$ brew upgrade git
==> Upgrading 1 outdated package, with result:
git 2.8.2
==> Upgrading git
==> Installing dependencies for git: openssl
==> Installing git dependency: openssl
error: unknown option `local'
usage: git config [options]

Config file location
    --global              use global config file
    --system              use system config file
    -f, --file <FILE>     use given config file

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]
    --get-regexp          get values for regexp: name-regex [value-regex]
    --replace-all         replace all matching variables: name value [value_regex]
    --add                 adds a new variable: name value
    --unset               removes a variable: name [value-regex]
    --unset-all           removes all matches: name [value-regex]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    -e, --edit            opens an editor
    --get-color <slot>    find the color configured: [default]
    --get-colorbool <slot>
                          find the color setting: [stdout-is-tty]

Type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --path                value is a path (file or directory name)

Other
    -z, --null            terminate values with NUL byte

Error: Failure while executing: git config --local --replace-all homebrew.private false

[njia@centos6 Desktop]$ su -
Password: 
[root@centos6 ~]# yum erase git
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.1-4.el6_7.1 will be erased
--> Processing Dependency: git = 1.7.1-4.el6_7.1 for package: perl-Git-1.7.1-4.el6_7.1.noarch
--> Running transaction check
---> Package perl-Git.noarch 0:1.7.1-4.el6_7.1 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                       Arch                        Version                                Repository                     Size
======================================================================================================================================
Removing:
 git                           x86_64                      1.7.1-4.el6_7.1                        @updates                       15 M
Removing for dependencies:
 perl-Git                      noarch                      1.7.1-4.el6_7.1                        @updates                       35 k

Transaction Summary
======================================================================================================================================
Remove        2 Package(s)

Installed size: 15 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : git-1.7.1-4.el6_7.1.x86_64                                                                                         1/2 
  Erasing    : perl-Git-1.7.1-4.el6_7.1.noarch                                                                                    2/2 
  Verifying  : perl-Git-1.7.1-4.el6_7.1.noarch                                                                                    1/2 
  Verifying  : git-1.7.1-4.el6_7.1.x86_64                                                                                         2/2 

Removed:
  git.x86_64 0:1.7.1-4.el6_7.1                                                                                                        

Dependency Removed:
  perl-Git.noarch 0:1.7.1-4.el6_7.1                                                                                                   

Complete!
[root@centos6 ~]# exit
logout
[njia@centos6 Desktop]$ brew upgrade git
==> Upgrading 1 outdated package, with result:
git 2.8.2
==> Upgrading git
==> Installing dependencies for git: openssl
==> Installing git dependency: openssl
==> Downloading https://www.openssl.org/source/openssl-1.0.2h.tar.gz
curl: (35) SSL connect error
Trying a mirror...
==> Downloading https://dl.bintray.com/homebrew/mirror/openssl-1.0.2h.tar.gz
######################################################################## 100.0%
==> perl ./Configure --prefix=/home/njia/.linuxbrew/Cellar/openssl/1.0.2h --openssldir=/home/njia/.linuxbrew/etc/openssl no-ssl2 zlib-
==> make depend
==> make
==> make test
==> make install MANDIR=/home/njia/.linuxbrew/Cellar/openssl/1.0.2h/share/man MANSUFFIX=ssl
==> Downloading https://curl.haxx.se/ca/cacert-2016-04-20.pem
######################################################################## 100.0%
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /home/njia/.linuxbrew/etc/openssl/certs

and run
  /home/njia/.linuxbrew/opt/openssl/bin/c_rehash

==> Summary
/home/njia/.linuxbrew/Cellar/openssl/1.0.2h: 1,698 files, 14M, built in 4 minutes
==> Installing git
==> Downloading https://www.kernel.org/pub/software/scm/git/git-2.8.2.tar.xz
######################################################################## 100.0%
==> make install prefix=/home/njia/.linuxbrew/Cellar/git/2.8.2 sysconfdir=/home/njia/.linuxbrew/etc CC=/usr/bin/gcc CFLAGS=-Os -w -pip
==> make CC=/usr/bin/gcc CFLAGS=-Os -w -pipe -march=core2 LDFLAGS=-L/home/njia/.linuxbrew/lib -Wl,--dynamic-linker=/home/njia/.linuxbr
==> Downloading https://www.kernel.org/pub/software/scm/git/git-manpages-2.8.2.tar.xz
######################################################################## 100.0%
==> Downloading https://www.kernel.org/pub/software/scm/git/git-htmldocs-2.8.2.tar.xz
######################################################################## 100.0%
==> Caveats
The OS X keychain credential helper has been installed to:
  /home/njia/.linuxbrew/bin/git-credential-osxkeychain

The "contrib" directory has been installed to:
  /home/njia/.linuxbrew/share/git-core/contrib

Bash completion has been installed to:
  /home/njia/.linuxbrew/etc/bash_completion.d

zsh completion has been installed to:
  /home/njia/.linuxbrew/share/zsh/site-functions


Emacs Lisp files have been installed to:
  /home/njia/.linuxbrew/share/emacs/site-lisp/git
==> Summary
/home/njia/.linuxbrew/Cellar/git/2.8.2: 1,342 files, 29.1M, built in 1 minute 3 seconds

@sjackman
Copy link
Member

sjackman commented May 4, 2016

Hi, Nija. The workaround for your issue is

PATH=`brew --prefix git`/bin:$PATH brew upgrade git

It needs a proper fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants