Skip to content

Commit

Permalink
git: remove some options
Browse files Browse the repository at this point in the history
  • Loading branch information
fxcoudert committed Sep 5, 2018
1 parent b631ec9 commit f710a13
Showing 1 changed file with 8 additions and 46 deletions.
54 changes: 8 additions & 46 deletions Formula/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,9 @@ class Git < Formula
sha256 "cb0c4eac4a49fbd1936bae4070ecac3c3543aecfb2ba09869f6f6fd2aeb11015" => :el_capitan
end

option "with-blk-sha1", "Compile with the block-optimized SHA1 implementation"

This comment has been minimized.

Copy link
@Stargator

Stargator Sep 11, 2018

@fxcoudert Why were these removed?

This comment has been minimized.

Copy link
@fxcoudert

fxcoudert Sep 11, 2018

Author Member

Because they were very seldom used, and not tested.

This comment has been minimized.

Copy link
@Stargator

Stargator Sep 13, 2018

Okay cool, I didn't realize that Homebrew tracked which options were used and how often.

This comment has been minimized.

Copy link
@fxcoudert

fxcoudert Sep 13, 2018

Author Member

See our policy on analytics: https://docs.brew.sh/Analytics
And #31510 explains the rationale behind the removal of some options

option "without-completions", "Disable bash/zsh completions from 'contrib' directory"

This comment has been minimized.

Copy link
@gmcinalli

gmcinalli Sep 21, 2018

This comment has been minimized.

Copy link
@CallumHoward

CallumHoward Sep 29, 2018

I was relying on this option as in the link above, anyone know a work around? Is there a tap?

This comment has been minimized.

Copy link
@raphaelbrugier

raphaelbrugier Sep 29, 2018

hi - I'm the author of the link above. Is there any other workaround we can use? I'd be happy to the update the post with another solution.

This comment has been minimized.

Copy link
@CallumHoward

CallumHoward Oct 1, 2018

My temporary workaround is to pin the last version before this commit:

brew tap homebrew/boneyard
brew uninstall --force git
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/db579a4f633c3dfde12c5236b9ea0695dce6cc5e/Formula/git.rb --without-completions
brew pin git

This comment has been minimized.

Copy link
@CusthomeDev

CusthomeDev Oct 5, 2018

The option --without-completions is necessary to use git flow auto completion with zsh.
Since it has been removed, auto completion doesn't work anymore.

Please consider to add this option again.
Thank you.

@raphaelbrugier as a workaround you can go in /usr/local/Cellar/git/x.xx.x/share/ and delete the zsh folder

This comment has been minimized.

Copy link
@gmcinalli

gmcinalli Oct 11, 2018

The @magelanOpenSource's workaround works for me. Thanks!

This comment has been minimized.

Copy link
@SMillerDev

SMillerDev Oct 11, 2018

Member

Wouldn't it be better/easier to report upstream about the ZSH completion being broken? This way you'll have to keep using workarounds.

This comment has been minimized.

Copy link
@gmcinalli

gmcinalli via email Oct 11, 2018

This comment has been minimized.

Copy link
@SMillerDev

SMillerDev Oct 11, 2018

Member

Google tells me to look here: https://git-scm.com/community

This comment has been minimized.

Copy link
@agross

agross Oct 22, 2018

Ran into this today. I created an issue: #33275

This comment has been minimized.

Copy link
@sometimesfood

sometimesfood Nov 15, 2018

Contributor

@SMillerDev The problem is not as simple as fixing a single bug upstream. The ZSH completion script in Git contrib doesn't seem to be actively maintained, while the one bundled with ZSH is.

This comment has been minimized.

Copy link
@SMillerDev

SMillerDev Nov 15, 2018

Member

Why isn't an unmaintained version a bug that needs fixing? I'd say it might very well be a easier bug then anything technological.

This comment has been minimized.

Copy link
@sometimesfood

sometimesfood Nov 15, 2018

Contributor

@SMillerDev So what's your preferred bug fix? Removing the Git ZSH completion? I highly doubt that the Git upstream developers would be in favour of that.

This comment has been minimized.

Copy link
@zx1986

zx1986 Jan 9, 2019

@magelanOpenSource you save my day!

This comment has been minimized.

Copy link
@winkelsdorf

winkelsdorf Feb 2, 2019

Why isn't an unmaintained version a bug that needs fixing? I'd say it might very well be a easier bug then anything technological.

In my opinion Homebrew is wrong here. Git's contrib directory is explicitly marked as somewhat unstable and/or experimental. There is no need to fix a bug upstream as the decision to force an installation of the zsh completion from git's contrib has been taken in homebrew's formula.

This breaks nearly every Oh-My-Zsh git completion, as it takes precedence over zsh users' folders and prevents git-plugin based autocompletion as well (in my case e.g. git-flow).

@fxcoudert @SMillerDev Please see https://github.com/git/git/blob/master/contrib/README and consider omitting forced installation of zsh completion for git. Allowing manual installation of zsh completion is definitely something that can be mentioned in the caveats.

Edit: Thus said, I do fully understand the need for a cleanup and removing the options. But as of now the formula breaks git completion with Oh-My-Zsh which has about 82,000 stars on GH.

Their related issues:
ohmyzsh/ohmyzsh#7459
ohmyzsh/ohmyzsh#7062

This comment has been minimized.

Copy link
@LeifW

LeifW Apr 5, 2019

This was an unpleasant surprise. My solution is to rm the /usr/local/share/zsh/site-functions/_git symlink, allowing it to continue using the one in zsh/functions.

This comment has been minimized.

Copy link
@winkelsdorf

winkelsdorf Apr 11, 2019

@LeifW Good idea, that works!

option "with-subversion", "Use Homebrew's version of SVN"
option "with-persistent-https", "Build git-remote-persistent-https from 'contrib' directory"

deprecated_option "with-brewed-svn" => "with-subversion"
deprecated_option "with-pcre" => "with-pcre2"

depends_on "pcre2" => :optional
depends_on "gettext" => :optional
depends_on "go" => :build if build.with? "persistent-https"

if MacOS.version < :yosemite
depends_on "openssl"
Expand All @@ -38,14 +30,6 @@ class Git < Formula
depends_on "curl" => :optional
end

if build.with? "subversion"
depends_on "subversion"
depends_on "perl" => :recommended
else
option "with-perl", "Build against Homebrew's Perl rather than system default"
depends_on "perl" => :optional
end

resource "html" do
url "https://www.kernel.org/pub/software/scm/git/git-htmldocs-2.18.0.tar.xz"
sha256 "5b70d9b1f86aad464ae172040eb87da83058c00581388af6f60b050214912efc"
Expand All @@ -60,22 +44,15 @@ def install
# If these things are installed, tell Git build system not to use them
ENV["NO_FINK"] = "1"
ENV["NO_DARWIN_PORTS"] = "1"
ENV["V"] = "1" # build verbosely
ENV["NO_GETTEXT"] = "1"
ENV["NO_R_TO_GCC_LINKER"] = "1" # pass arguments to LD correctly
ENV["PYTHON_PATH"] = which("python")
ENV["PERL_PATH"] = which("perl")
ENV["V"] = "1" # build verbosely

perl_version = Utils.popen_read("perl --version")[/v(\d+\.\d+)(?:\.\d+)?/, 1]
# If building with a non-system Perl search everywhere declared in @INC.
perl_inc = Utils.popen_read("perl -e 'print join\":\",@INC'").sub(":.", "")

if build.with? "subversion"
ENV["PERLLIB_EXTRA"] = %W[
#{Formula["subversion"].opt_lib}/perl5/site_perl
].join(":")
elsif build.with? "perl"
ENV["PERLLIB_EXTRA"] = perl_inc
elsif MacOS.version >= :mavericks
if MacOS.version >= :mavericks
ENV["PERLLIB_EXTRA"] = %W[
#{MacOS.active_developer_dir}
/Library/Developer/CommandLineTools
Expand All @@ -89,9 +66,6 @@ def install
ENV["NO_PERL_MAKEMAKER"] = "1"
end

ENV["BLK_SHA1"] = "1" if build.with? "blk-sha1"
ENV["NO_GETTEXT"] = "1" if build.without? "gettext"

if build.with? "pcre2"
ENV["USE_LIBPCRE2"] = "1"
ENV["LIBPCREDIR"] = Formula["pcre2"].opt_prefix
Expand Down Expand Up @@ -144,23 +118,11 @@ def install
git_core.install "git-subtree"
end

if build.with? "persistent-https"
cd "contrib/persistent-https" do
system "make"
git_core.install "git-remote-persistent-http",
"git-remote-persistent-https",
"git-remote-persistent-https--proxy"
end
end

if build.with? "completions"
# install the completion script first because it is inside "contrib"
bash_completion.install "contrib/completion/git-completion.bash"
bash_completion.install "contrib/completion/git-prompt.sh"

zsh_completion.install "contrib/completion/git-completion.zsh" => "_git"
cp "#{bash_completion}/git-completion.bash", zsh_completion
end
# install the completion script first because it is inside "contrib"
bash_completion.install "contrib/completion/git-completion.bash"
bash_completion.install "contrib/completion/git-prompt.sh"
zsh_completion.install "contrib/completion/git-completion.zsh" => "_git"
cp "#{bash_completion}/git-completion.bash", zsh_completion

elisp.install Dir["contrib/emacs/*.el"]
(share/"git-core").install "contrib"
Expand Down

1 comment on commit f710a13

@ebouaziz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the git svn command is not available after this patch. It is a very useful command in my opinion, one that I often need at least.

Please sign in to comment.