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

Use cp -c when copying files #17373

Merged
merged 19 commits into from
Jun 13, 2024
Merged

Use cp -c when copying files #17373

merged 19 commits into from
Jun 13, 2024

Commits on May 27, 2024

  1. Add Utils::Cp for interacting with cp command

    This module determines the `cp` command to use based on availability of
    the `coreutils` formula and optimizes the command invocation to prefer a
    lightweight copy-on-write clone, which is significantly faster than a
    full file copy and helps to reduce the risk of exhausting the storage
    during the operation.
    tesaguri committed May 27, 2024
    Configuration menu
    Copy the full SHA
    b905959 View commit details
    Browse the repository at this point in the history
  2. Use Utils::Cp to copy files

    This replaces `FileUtils.cp` and `system_command! "cp"` with the new
    `Utils::Cp` utility where it is expected that the performance
    improvement outweighs the cost of the system command invocation.
    tesaguri committed May 27, 2024
    Configuration menu
    Copy the full SHA
    deaac7c View commit details
    Browse the repository at this point in the history
  3. Utils::Cp: Fix tests

    tesaguri committed May 27, 2024
    Configuration menu
    Copy the full SHA
    b8af1c5 View commit details
    Browse the repository at this point in the history
  4. Utils::Cp: Use cp from macOS

    tesaguri committed May 27, 2024
    Configuration menu
    Copy the full SHA
    942906b View commit details
    Browse the repository at this point in the history

Commits on May 28, 2024

  1. Utils::Cp: Drop special case for coreutils cp

    As per review feedback:
    
    Homebrew#17373 (comment)
    tesaguri committed May 28, 2024
    Configuration menu
    Copy the full SHA
    b4dcb94 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2024

  1. Utils::Cp: Fix Linux tests

    tesaguri committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    a5500aa View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2024

  1. Configuration menu
    Copy the full SHA
    5885210 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7cfcc59 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d9239fa View commit details
    Browse the repository at this point in the history
  4. Utils::Cp: Remove copy prefix from method name

    As per review feedback:
    
    Homebrew#17373 (review)
    
    Co-authored-by: Mike McQuaid <[email protected]>
    tesaguri and MikeMcQuaid committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    b2ddeec View commit details
    Browse the repository at this point in the history
  5. Apply suggestions from code review

    Homebrew#17373 (review)
    
    Co-authored-by: Mike McQuaid <[email protected]>
    tesaguri and MikeMcQuaid committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    a4271fd View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2024

  1. Utils::Cp: Use FileUtils.cp on Linux

    `FileUtils.cp` is implemented with the lightweight `copy_file_range(2)`
    syscall on Linux, so it's more performant than the plain `cp` command on
    that platform.
    
    cf. Homebrew#17373 (review)
    tesaguri committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    9156891 View commit details
    Browse the repository at this point in the history
  2. Utils::Cp: Add force_system keyword argument

    This fixes the test for `UnpackStrategy::Directory`, which needs the
    `cp` command.
    tesaguri committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    67f280e View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2024

  1. Configuration menu
    Copy the full SHA
    eab1e87 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2024

  1. Utils::Cp: Add tests

    tesaguri committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    4edbbfd View commit details
    Browse the repository at this point in the history
  2. Utils::Cp: Rename to Utils::Copy

    As per review feedback:
    
    Homebrew#17373 (comment)
    tesaguri committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    028cfe1 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2024

  1. brew style --fix

    tesaguri committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    8e8d0c0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e4fefc9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a30cd15 View commit details
    Browse the repository at this point in the history