Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-undo symlink conflicts with git-extras #34

Open
jonatan-ivanov opened this issue Jun 18, 2022 · 3 comments
Open

git-undo symlink conflicts with git-extras #34

jonatan-ivanov opened this issue Jun 18, 2022 · 3 comments
Labels
beginner bug Something isn't working documentation Improvements or additions to documentation good first issue Good for newcomers up for grabs

Comments

@jonatan-ivanov
Copy link

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:

  1. 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 run git undo (I also like git undo)
  2. As far as I know Homebrew has some mechanism to deal with conflicting formulae but I'm not sure how it works
  3. 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 but git undo comes from git-extras. If the user decides they want git undo to execute ugit, 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

@jonatan-ivanov jonatan-ivanov added the bug Something isn't working label Jun 18, 2022
@Bhupesh-V
Copy link
Owner

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?

@jonatan-ivanov
Copy link
Author

@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 but git undo comes from git-extras

@Bhupesh-V
Copy link
Owner

@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 but git undo comes from git-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 👍🏽

@Bhupesh-V Bhupesh-V added documentation Improvements or additions to documentation beginner labels Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner bug Something isn't working documentation Improvements or additions to documentation good first issue Good for newcomers up for grabs
Projects
None yet
Development

No branches or pull requests

3 participants
@jonatan-ivanov @Bhupesh-V and others