git-undo symlink conflicts with git-extras
jonatan-ivanov opened this issue ยท 3 comments
Describe the bug
If you have git-extras
installed that has a git-undo
command, ugit can conflict with it.
E.g.: This is what I get when I try to install ugit when git-extras
is already installed.
==> Pouring ugit--5.1.all.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/git-undo
Target /usr/local/bin/git-undo
is a symlink belonging to git-extras. You can unlink it:
brew unlink git-extras
To force the link and overwrite all conflicting files:
brew link --overwrite ugit
To list all files that would be deleted:
brew link --overwrite --dry-run ugit
Possible conflicting files are:
/usr/local/bin/git-undo -> /usr/local/Cellar/git-extras/6.4.0/bin/git-undo
==> Summary
๐บ /usr/local/Cellar/ugit/5.1: 6 files, 28.7KB
==> Running `brew cleanup ugit`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
To Reproduce
brew install git-extras
brew install ugit
Expected behavior
That's a great question and I'm not sure about it. I think there are a few options:
- Renaming the
git-undo
symlink but I'm not sure I can think of an alternative name and this will break existing users who happily rungit undo
(I also likegit undo
) - As far as I know Homebrew has some mechanism to deal with conflicting formulae but I'm not sure how it works
- Call this out in the readme and in the Homebrew description, the error above is not a fatal one, only the symlink is missing so
ugit
works butgit undo
comes fromgit-extras
. If the user decides they wantgit undo
to executeugit
, they just need ask Homebrew to overwrite the link:brew link --overwrite ugit
Desktop (please complete the following information):
- OS:
macOS 12.4 (build: 21F79)
- Bash Version
zsh 5.8.1 (x86_64-apple-darwin21.0)
- FZF Version:
0.30.0 (brew)
- Git Version:
git version 2.36.1
- git-extras Version:
6.4.0
- Homebrew Version:
Homebrew 3.5.2
Homebrew/homebrew-core (git revision 3033e2a3b66; last commit 2022-06-18)
Homebrew/homebrew-cask (git revision e83c83c0a2; last commit 2022-06-18)
Additional context
The change was introduced with this issue: #15
Hey @jonatan-ivanov thanks a lot for pointing this out. I believe mentioning the name collision problem in the README is the way to go for now.
Since ugit doesn't really have to depend on symlinks, users can still invoke ugit
command, Or does homebrew stops the installation process altogether?
Can you please verify if the ugit
command works, following the steps you mentioned above?
@Bhupesh-V See this section of my comment above:
the error above is not a fatal one, only the symlink is missing so
ugit
works butgit undo
comes fromgit-extras
@Bhupesh-V See this section of my comment above:
the error above is not a fatal one, only the symlink is missing so
ugit
works butgit undo
comes fromgit-extras
Cool, in that case, we will add a warning for brew installation method. For the next release, I will update the formulae to specify conflicts with other formulae
Thanks for your time ๐๐ฝ