brew: Update Failure When git's abbreviateCommands is TRUE

  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew config and brew doctor and included their output with your issue?

What you were trying to do (and why)

I was attempting to fetch the newest version of Homebrew and all formulae from GitHub while the git config option rebase.abbreviateCommands is true.

I perform git rebases routinely via CLI and prefer to have the rebase.abbreviateCommands option enabled. However, I found that this breaks Homebrew. The issue is immediately resolved by setting the option to false (git config --global rebase.abbreviateCommands false).

What happened (include command output)

Executing brew update -v while rebase.abbreviateCommands is true provides the following output (note the “error: nothing to do”):

Command output
# brew update -v
Checking if we need to fetch /usr/local/Homebrew...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-fonts...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 8 (delta 6), reused 8 (delta 6), pack-reused 0
Unpacking objects: 100% (8/8), 1.06 KiB | 216.00 KiB/s, done.
From https://github.com/Homebrew/homebrew-core
   d874b06712..9c6d32178a  master     -> origin/master
Updating /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
 Formula/futhark.rb | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
error: nothing to do

Already up-to-date.

When checking the status of the above homebrew-core repo, you can see it has been fetched, but not merged forward:

Command output
# git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core status
On branch master
Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.

nothing to commit, working tree clean

The upstream changes to GitHub/homebrew-core continue to pile up and, thus,brew upgrade never upgrades any packages.

What you expected to happen

I expected Homebrew to fetch package updates successfully regardless of my personal ~/.gitconfig.

Step-by-step reproduction instructions (by running brew commands)

  • git config --global rebase.abbreviateCommands true (only once to set config)
  • brew update; brew upgrade

Output of brew config and brew doctor commands

# brew config
HOMEBREW_VERSION: 2.2.13-48-gd6ffbf5
ORIGIN: https://github.com/Homebrew/brew
HEAD: d6ffbf5bb66e60d51e063926175e588c462aa6b3
Last commit: 7 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: d874b06712ec20efd86f2fbf20e97aa2f24e9f5b
Core tap last commit: 38 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_EDITOR: vim -e
HOMEBREW_MAKE_JOBS: 4
HOMEBREW_NO_INSTALL_CLEANUP: set
CPU: quad-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1103
Git: 2.26.1 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 10.15.4-x86_64
CLT: 11.4.0.0.1.1583798712
Xcode: N/A

# brew doctor
Your system is ready to brew.

I’m not sure if this is a proper solution, but maybe the following two lines can be changed to git -c rebase.abbreviateCommands=false rebase to override the option (if set)? I can submit a PR if desired.

https://github.com/Homebrew/brew/blob/d6ffbf5bb66e60d51e063926175e588c462aa6b3/Library/Homebrew/cmd/update.sh#L256 https://github.com/Homebrew/brew/blob/d6ffbf5bb66e60d51e063926175e588c462aa6b3/Library/Homebrew/cmd/update.sh#L258

Thanks, Steve

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Homebrew/homebrew-core#53266