Cancel --force deprecation in favor of --redownload

I realized `--redownload` is not a good name, because it does not
necessarily redownloads gems. It only forces reinstallation even if gem
is already installed.

So I believe `--force` is actually a better name and the introduction of
`--force` was a misunderstanding of what the `--force` flag did at the
time.

Let's cancel the deprecation of `--force`.

For now the `--redownload` alias is left around until we decide what to
do with it.
This commit is contained in:
David Rodríguez 2025-07-15 13:35:23 +02:00 committed by Hiroshi SHIBATA
parent 851a3e7724
commit 60fca1defc
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
11 changed files with 54 additions and 92 deletions

View file

@ -220,7 +220,7 @@ module Bundler
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
method_option "path", type: :string, banner: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
@ -232,8 +232,6 @@ module Bundler
method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
def install
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
%w[clean deployment frozen no-prune path shebang without with].each do |option|
remembered_flag_deprecation(option)
end
@ -263,7 +261,7 @@ module Bundler
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
method_option "source", type: :array, banner: "Update a specific source (and all gems associated with it)"
method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
method_option "ruby", type: :boolean, banner: "Update ruby specified in Gemfile.lock"
method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
@ -274,7 +272,6 @@ module Bundler
method_option "conservative", type: :boolean, banner: "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
method_option "all", type: :boolean, banner: "Update everything."
def update(*gems)
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
require_relative "cli/update"
Bundler.settings.temporary(no_install: false) do
Update.new(options, gems).run

View file

@ -179,7 +179,7 @@ module Bundler
normalize_groups if options[:without] || options[:with]
options[:force] = options[:redownload]
options[:force] = options[:redownload] if options[:redownload]
end
def warn_ambiguous_gems

View file

@ -63,7 +63,7 @@ module Bundler
opts = options.dup
opts["update"] = true
opts["local"] = options[:local]
opts["force"] = options[:redownload]
opts["force"] = options[:redownload] if options[:redownload]
Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]

View file

@ -4,7 +4,7 @@
.SH "NAME"
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
.SH "SYNOPSIS"
\fBbundle install\fR [\-\-binstubs[=DIRECTORY]] [\-\-clean] [\-\-deployment] [\-\-frozen] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-local] [\-\-no\-cache] [\-\-no\-prune] [\-\-path PATH] [\-\-prefer\-local] [\-\-quiet] [\-\-redownload] [\-\-retry=NUMBER] [\-\-shebang=SHEBANG] [\-\-standalone[=GROUP[ GROUP\|\.\|\.\|\.]]] [\-\-system] [\-\-trust\-policy=TRUST\-POLICY] [\-\-target\-rbconfig=TARGET\-RBCONFIG] [\-\-with=GROUP[ GROUP\|\.\|\.\|\.]] [\-\-without=GROUP[ GROUP\|\.\|\.\|\.]]
\fBbundle install\fR [\-\-binstubs[=DIRECTORY]] [\-\-clean] [\-\-deployment] [\-\-force] [\-\-frozen] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-local] [\-\-no\-cache] [\-\-no\-prune] [\-\-path PATH] [\-\-prefer\-local] [\-\-quiet] [\-\-retry=NUMBER] [\-\-shebang=SHEBANG] [\-\-standalone[=GROUP[ GROUP\|\.\|\.\|\.]]] [\-\-system] [\-\-trust\-policy=TRUST\-POLICY] [\-\-target\-rbconfig=TARGET\-RBCONFIG] [\-\-with=GROUP[ GROUP\|\.\|\.\|\.]] [\-\-without=GROUP[ GROUP\|\.\|\.\|\.]]
.SH "DESCRIPTION"
Install the gems specified in your Gemfile(5)\. If this is the first time you run bundle install (and a \fBGemfile\.lock\fR does not exist), Bundler will fetch all remote sources, resolve dependencies and install all needed gems\.
.P
@ -29,8 +29,8 @@ In \fIdeployment mode\fR, Bundler will 'roll\-out' the bundle for production or
.IP
This option is deprecated in favor of the \fBdeployment\fR setting\.
.TP
\fB\-\-redownload\fR, \fB\-\-force\fR
Force download every gem, even if the required versions are already available locally\.
\fB\-\-force\fR, \fB\-\-redownload\fR
Force reinstalling every gem, even if already installed\.
.TP
\fB\-\-frozen\fR
Do not allow the Gemfile\.lock to be updated after this install\. Exits non\-zero if there are going to be changes to the Gemfile\.lock\.

View file

@ -6,6 +6,7 @@ bundle-install(1) -- Install the dependencies specified in your Gemfile
`bundle install` [--binstubs[=DIRECTORY]]
[--clean]
[--deployment]
[--force]
[--frozen]
[--full-index]
[--gemfile=GEMFILE]
@ -16,7 +17,6 @@ bundle-install(1) -- Install the dependencies specified in your Gemfile
[--path PATH]
[--prefer-local]
[--quiet]
[--redownload]
[--retry=NUMBER]
[--shebang=SHEBANG]
[--standalone[=GROUP[ GROUP...]]]
@ -80,9 +80,8 @@ automatically and that requires `bundler` to silently remember them. Since
This option is deprecated in favor of the `deployment` setting.
* `--redownload`, `--force`:
Force download every gem, even if the required versions are already available
locally.
* `--force`, `--redownload`:
Force reinstalling every gem, even if already installed.
* `--frozen`:
Do not allow the Gemfile.lock to be updated after this install. Exits

View file

@ -4,7 +4,7 @@
.SH "NAME"
\fBbundle\-update\fR \- Update your gems to the latest available versions
.SH "SYNOPSIS"
\fBbundle update\fR \fI*gems\fR [\-\-all] [\-\-group=NAME] [\-\-source=NAME] [\-\-local] [\-\-ruby] [\-\-bundler[=VERSION]] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-quiet] [\-\-patch|\-\-minor|\-\-major] [\-\-pre] [\-\-redownload] [\-\-strict] [\-\-conservative]
\fBbundle update\fR \fI*gems\fR [\-\-all] [\-\-group=NAME] [\-\-source=NAME] [\-\-local] [\-\-ruby] [\-\-bundler[=VERSION]] [\-\-force] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-quiet] [\-\-patch|\-\-minor|\-\-major] [\-\-pre] [\-\-strict] [\-\-conservative]
.SH "DESCRIPTION"
Update the gems specified (all gems, if \fB\-\-all\fR flag is used), ignoring the previously installed gems specified in the \fBGemfile\.lock\fR\. In general, you should use bundle install(1) \fIbundle\-install\.1\.html\fR to install the same exact gems and versions across machines\.
.P
@ -29,6 +29,9 @@ Update the locked version of Ruby to the current version of Ruby\.
\fB\-\-bundler[=BUNDLER]\fR
Update the locked version of bundler to the invoked bundler version\.
.TP
\fB\-\-force\fR, \fB\-\-redownload\fR
Force reinstalling every gem, even if already installed\.
.TP
\fB\-\-full\-index\fR
Fall back to using the single\-file index of all gems\.
.TP
@ -44,9 +47,6 @@ Retry failed network or git requests for \fInumber\fR times\.
\fB\-\-quiet\fR
Only output warnings and errors\.
.TP
\fB\-\-redownload\fR, \fB\-\-force\fR
Force downloading every gem\.
.TP
\fB\-\-patch\fR
Prefer updating only to next patch version\.
.TP

View file

@ -9,13 +9,13 @@ bundle-update(1) -- Update your gems to the latest available versions
[--local]
[--ruby]
[--bundler[=VERSION]]
[--force]
[--full-index]
[--gemfile=GEMFILE]
[--jobs=NUMBER]
[--quiet]
[--patch|--minor|--major]
[--pre]
[--redownload]
[--strict]
[--conservative]
@ -54,6 +54,9 @@ gem.
* `--bundler[=BUNDLER]`:
Update the locked version of bundler to the invoked bundler version.
* `--force`, `--redownload`:
Force reinstalling every gem, even if already installed.
* `--full-index`:
Fall back to using the single-file index of all gems.
@ -70,9 +73,6 @@ gem.
* `--quiet`:
Only output warnings and errors.
* `--redownload`, `--force`:
Force downloading every gem.
* `--patch`:
Prefer updating only to next patch version.