Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • P Pacman Contrib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare
    • Locked Files
  • Issues 12
    • Issues 12
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Pacman
  • Pacman Contrib
  • Issues
  • #19
Closed
Open
Issue created Jun 07, 2022 by Matthew Armand@matthewarmandContributor

pacdiff: Add a "backup" option for saving overwritten files

This might not be deemed worthwhile or useful to others, but it would be convenient for my workflow so I thought I'd propose it.

My typical workflow when resolving pacdiff merges is to:

  1. (V)iew them,
  2. Save the old version as $file.bak (ie: /etc/pacman.conf.bak),
  3. Resolve differences on $file.pacnew,
  4. and (O)verwrite.

This allows me to hold onto the old version of the file in case there's a problem with the updates and I need to quickly revert.

Given that it's pretty simple to add that as an optional step to pacdiff's logic, I propose a new optional flag be added (-b/--backup or similar) to supply this functionality. If the flag is specified, then during the (O)verwrite step the existing file will be renamed with an appended .bak extension before the .pacnew file is renamed to replace the existing file.

Usage would be something like the following:

$ pacdiff -b
==> pacnew file found for /etc/pacman.conf
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q] v
2 files to edit
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q] o
renamed '/etc/pacman.conf' -> '/etc/pacman.conf.bak'
renamed '/etc/pacman.conf.pacnew' -> '/etc/pacman.conf'     

As I don't have permission to fork or create a Merge Request here, please find in the expandable block below a proposed patch to add this functionality to pacdiff.

Edited Jun 20, 2022 by Matthew Armand
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking