Commit graph

46 commits

Author SHA1 Message Date
David Rodríguez
441f18df52
Skip to Bundler 4 directly 2025-06-19 10:23:36 +09:00
Thomas Marshall
ee55b82b34
[rubygems/rubygems] Cache commit SHA ref revisions
If the `ref` option is a specific commit SHA, we can check to see if
it's already fetched locally. If it is, then we don't need to re-fetch
it from the remote.

The `ref` option might not be a commit SHA, so we're using the `#commit`
method which returns the full SHA if it's a commit ref, or the locked
revision, or nil.

This is a small improvement that will make `bundle update` slightly
faster in cases for git-sourced gems pinned to a specific commit.

f434c2e66c
2025-06-06 10:09:14 +09:00
David Rodríguez
3b78b88842 [rubygems/rubygems] Support git 2.49
One error message that we parse is now slightly different.

758528791d
2025-03-24 13:25:07 +09:00
Tara Bass
4323674fe4 [rubygems/rubygems] Don't treat a git-sourced gem install as complete if only the '.git' directory is present. This recovers cases where a git-sourced install can be left in a partially installed state.
d132b7008d
2025-03-10 12:43:36 +09:00
David Rodríguez
9a4d91fa95 [rubygems/rubygems] Restore previous application cache format for git sources
And make sure `bundle install --local` can install from it without git.

7d6b631620
2024-11-29 15:27:39 +00:00
David Rodríguez
060932af98 [rubygems/rubygems] Fix old cache format detection when application is not source controlled
b2adcc0173
2024-09-30 05:08:25 +00:00
David Rodríguez
669d1f79d8 [rubygems/rubygems] Restore support for passing relative paths to :git
The `file://` protocol does not really work with relative paths and it's
not necessary anyways. So restore support for that by not using
`file://`.

16a68998ce
2024-08-21 14:47:57 +00:00
David Rodríguez
54b6025887 [rubygems/rubygems] Regeneration previous git application caches that didn't include bare repos
417319ecb1
2024-08-21 12:06:28 +00:00
Ellen Keal
5b9b6b4d2b [rubygems/rubygems] move git clone depth error handling to else branch
022eb473f8
2024-05-22 06:01:51 +00:00
Ellen Keal
ec9de0c471 [rubygems/rubygems] fix for gems not downloading from git via http
592a2fcd54
2024-05-22 06:01:50 +00:00
David Rodríguez
f3123f8af2 [rubygems/rubygems] Use rubygems vendored uri from Bundler when available
5d6a8f2fb4
2024-01-29 12:15:10 +09:00
Samuel Giddins
baf2ec2ca8 [rubygems/rubygems] Use match? when regexp match data is unused
Improved performance / reduced allocations

b04726c9a7
2023-12-13 22:00:26 +00:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
David Rodríguez
5b076e00ce
[rubygems/rubygems] Fix regression on old git versions
abd91ca2e5
2023-11-08 09:04:28 +09:00
Peter Boling
9ffd659d47
[rubygems/rubygems] 🐛 Specification of branch or ref with tag is ambiguous
- Specs for GitProxy were incorrect and insufficient
- Specs are now correct and less insufficient

63d0a8cfd0
2023-10-03 16:13:18 +09:00
krororo
bc664609df [rubygems/rubygems] Refactor full sha revision match logic
f0d8255ebd
2023-09-27 05:18:10 +00:00
krororo
fbee93fc19 [rubygems/rubygems] Fix bundle install when older revisions of git source
a30712c0fc
2023-09-27 05:18:10 +00:00
David Rodríguez
09382135de [rubygems/rubygems] Fix git source lockfile unstability
We have some flags that limit running git commit commands under certain
situations, for example, when running under `--local`. However, those
should only affect remote git operations, not local read-only operations
like `git --version`, or `git rev-parse --abbrev-ref HEAD`.

This commit refactors things to achieve that.

By doing this, the `#to_s` representation of a source is more
consistent, since we don't get any errors when reading the checked out
branch, and we avoid some flip-flop lockfile issues.

4a529fce81
2023-07-04 14:54:26 +09:00
David Rodríguez
c65d7b4bea When running bundle lock --update <name>, checkout locked revision of unrelated git sources directly
Since Bundler 2.4, we will try to checkout any branch specified in the
Gemfile, while until Bundler 2.3 we would directly checkout the locked
revision.

This should not make any difference in most situations, but in some edge
cases, like if the branch specified in the `Gemfile` has been renamed,
but the locked revision still exist, it causes an error now while before
it would update the lockfile without issues.

I debated which behavior was best, since I was not sure. But my
conclusion is that if the situation does not require expiring the
lockfile source in favor of the Gemfile source, we should use the locked
revision directly and proceed happily. So I restored Bundler 2.3
behavior.

I think this is consistent with how yanked gems are handled, for example.

Of course, if explicitly updating the git source itself, or all gems, we
will still get any errors like missing branches related to the git source.
2023-03-17 18:50:55 +09:00
David Rodríguez
a47e1328e6 [rubygems/rubygems] Give a better message when Gemfile branch does not exist
cb4fc41cbc
2023-02-21 19:28:12 +09:00
David Rodríguez
e7bf85961d [rubygems/rubygems] Restore better error message when locked ref does not exist
c8e024359f
2023-02-21 19:28:12 +09:00
David Rodríguez
8f05e4f54b Update Bundler to 2.4.1 & and RubyGems to 3.4.1 2022-12-25 05:55:36 +09:00
Hiroshi SHIBATA
f6620037ba Merge RubyGems-3.4.0 and Bundler-2.4.0 2022-12-24 16:57:07 +09:00
Hiroshi SHIBATA
18ba89093a Merge RubyGems/Bundler master
Pick from ba3adad4d8
2022-12-20 13:15:02 +09:00
Hiroshi SHIBATA
49b0f3b024 Merge RubyGems/Bundler master
Pick from 084f7d1f21
2022-12-15 19:06:40 +09:00
Hiroshi SHIBATA
bbe56a6437 Merge RubyGems/Bundler master
from bfb0ae6977
2022-12-12 10:49:43 +09:00
Hiroshi SHIBATA
a4e14b9d9d Merge RubyGems/Bundler master
Pick from 823c776d95
2022-12-09 16:36:22 +09:00
David Rodríguez
26303c31f0 [rubygems/rubygems] Pass "--" to git commands to separate positional and optional args
To make sure git uri's specified in Gemfile are never misinterpreted as
optional arguments, potentially allowing for local code execution.

90b1ed8b9f
2021-12-07 23:27:59 +09:00
David Rodríguez
f634d1ee00 [rubygems/rubygems] Better error when installing a git lockfile and git not present
28f4842196
2021-10-30 06:11:39 +09:00
David Rodríguez
095b5bbcc1
[rubygems/rubygems] Lazily load shellwords
ef6388656a
2021-07-27 09:25:56 +09:00
David Rodríguez
53468cc111 Sync latest development version of bundler & rubygems 2021-03-08 13:47:35 +09:00
Hiroshi SHIBATA
69ed64949b Track Bundler master(2.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20 2021-01-04 13:14:43 +09:00
Hiroshi SHIBATA
473f9d2df0 Merge prepare version of Bundler 2.2.0 2020-12-08 17:30:02 +09:00
Hiroshi SHIBATA
d386a58f6f Merge bundler-2.2.0.rc.2 2020-10-15 17:19:02 +09:00
Jakob Krigovsky
f9872c50cc Update links from rubygems/bundler to rubygems/rubygems 2020-06-05 07:32:42 +09:00
Hiroshi SHIBATA
0e60b59d58 Update the bundler version with master branch 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA
38002a8adb Prepare to release bundler-2.1.0 2019-12-15 16:41:10 +09:00
Hiroshi SHIBATA
7585bc3187 Merge Bundler 2.1.0.pre.3
Features:
    - Add caller information to some deprecation messages to make them easier to fix [#7361](https://github.com/bundler/bundler/pull/7361)
    - Reconcile `bundle cache` vs `bundle package` everywhere. Now in docs, CLI help and everywhere else `bundle cache` is the preferred version and `bundle package` remains as an alias [#7389](https://github.com/bundler/bundler/pull/7389)
    - Display some basic `bundler` documentation together with ruby's RDoc based documentation [#7394](https://github.com/bundler/bundler/pull/7394)

  Bugfixes:
    - Fix typos deprecation message and upgrading docs [#7374](https://github.com/bundler/bundler/pull/7374)
    - Deprecation warnings about `taint` usage on ruby 2.7 [#7385](https://github.com/bundler/bundler/pull/7385)
    - Fix `--help` flag not correctly delegating to `man` when used with command aliases [#7388](https://github.com/bundler/bundler/pull/7388)
    - `bundle add` should cache newly added gems if an application cache exists [#7393](https://github.com/bundler/bundler/pull/7393)
    - Stop using an insecure folder as a "fallback home" when user home is not defined [#7416](https://github.com/bundler/bundler/pull/7416)
    - Fix `bundler/inline` warning about `Bundler.root` redefinition [#7417](https://github.com/bundler/bundler/pull/7417)
2019-11-11 18:56:25 +09:00
Takayuki Nakata
c27aaf1a8f
[bundler/bundler] Fix comments and messages to refer to https url
a86b49f1b9
2019-09-18 18:26:32 +09:00
David Rodríguez
4b1395ab4a
[bundler/bundler] Clearer MissingRevision git errors
b47d23edf5
2019-08-03 09:29:56 +09:00
David Rodríguez
cad71f7089
[bundler/bundler] Migrate git proxy helpers to use Open3
4a37d66f3f
2019-08-03 09:29:55 +09:00
hsbt
68ddd4d300 Merge Bundler 2.1.0.pre.1 as developed version from upstream.
a53709556b

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14 06:01:35 +00:00
hsbt
59c8d50653 Added bundler as default gems. Revisit [Feature #12733]
* bin/*, lib/bundler/*, lib/bundler.rb, spec/bundler, man/*:
    Merge from latest stable branch of bundler/bundler repository and
    added workaround patches. I will backport them into upstream.
  * common.mk, defs/gmake.mk: Added `test-bundler` task for test suite
    of bundler.
  * tool/sync_default_gems.rb: Added sync task for bundler.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 23:07:56 +00:00
hsbt
7825e8363d Postponing the Bundler merge.
I faced a big issue about Bundler with ruby core.
  I have no time to resolve it issue before 2.5 final release.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 23:08:05 +00:00
hsbt
be7b592912 Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0.
  * common.mk: rspec examples of bundler-1.16.0 needs require option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01 23:29:38 +00:00
hsbt
8598f8c2dc Merge bundler to standard libraries.
rubygems 2.7.x depends bundler-1.15.x. This is preparation for
  rubygems and bundler migration.

  * lib/bundler.rb, lib/bundler/*: files of bundler-1.15.4
  * spec/bundler/*: rspec examples of bundler-1.15.4. I applied patches.
    * https://github.com/bundler/bundler/pull/6007
    * Exclude not working examples on ruby repository.
    * Fake ruby interpriter instead of installed ruby.
  * Makefile.in: Added test task named `test-bundler`. This task is only
    working macOS/linux yet. I'm going to support Windows environment later.
  * tool/sync_default_gems.rb: Added sync task for bundler.

  [Feature #12733][ruby-core:77172]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-08 08:45:41 +00:00