Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Introduce install_or_cli_help and use it default bundle command - #9136

Merged
hsbt merged 4 commits into
masterfrom
default-cli-install-revise2
Nov 28, 2025
Merged

hsbt merged 4 commits into
masterfrom
default-cli-install-revise2

Conversation

@hsbt

@hsbt hsbt commented Nov 28, 2025 •

Copy link
Copy Markdown
Member

The current install is not helpful outside of Gemfile location. This change show the cli_help if it raised GemfileNotFound. This change created by @byroot

And I update the current warn message to info level. and it will not display if default_cli_command value is present.

Closes #9125
Closes #9126

byroot and others added 4 commits November 29, 2025 07:47
Fix: #9124

This behavior is a deeply entrenched convention and changing it
will annoy lots of developers with unclear gains.
As mentioned in #9124,
the intent for changing the default command was to be more welcoming.

I think we can acheive that by attempting to install, but to print
that same help message if there is no Gemfile.

That should address both concerns.
config[:current_command] = command
send(name)
ensure
config[:current_command] = original_command
@hsbt
hsbt enabled auto-merge November 28, 2025 23:44
@hsbt
hsbt merged commit 4e0cc9c into master Nov 28, 2025
@hsbt
hsbt deleted the default-cli-install-revise2 branch November 28, 2025 23:49
MSG
unless Bundler.settings[:default_cli_command]
Bundler.ui.info <<-MSG
In the feature version of Bundler, running `bundle` without argument will no longer run `bundle install`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
In the feature version of Bundler, running `bundle` without argument will no longer run `bundle install`.
In a future version of Bundler, running `bundle` without argument will no longer run `bundle install`.

Bundler.ui.info <<-MSG
In the feature version of Bundler, running `bundle` without argument will no longer run `bundle install`.
Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD.
If you wish to use feature behavior now with `bundle config set default_cli_command cli_help --global`

@eregon eregon Nov 29, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
If you wish to use feature behavior now with `bundle config set default_cli_command cli_help --global`
You can use the future behavior now with `bundle config set default_cli_command cli_help --global`,

In the feature version of Bundler, running `bundle` without argument will no longer run `bundle install`.
Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD.
If you wish to use feature behavior now with `bundle config set default_cli_command cli_help --global`
or you can continue to use the old behavior with `bundle config set default_cli_command install_or_cli_help --global`.

@eregon eregon Dec 5, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This suggestion of bundle config set default_cli_command install_or_cli_help --global is bad because it breaks on Bundler 2:

$ ruby --version
ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
$ bundle --version     
Bundler version 2.4.19
$ bundle
Could not find command "".
zsh: exit 15    bundle

So the suggestion should be install and not install_or_cli_help.
Maybe the install command should have that help behavior on missing gemfile always anyway, it would likely be a lot cleaner in code, as I said in the last paragraph of #9124 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants