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

[Feature]: Roll back to previous packages version #24

Open
1 task done
jumper047 opened this issue Oct 31, 2022 · 4 comments
Open
1 task done

[Feature]: Roll back to previous packages version #24

jumper047 opened this issue Oct 31, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@jumper047
Copy link

Feature Description

As far as I know, Straight.el has command straight-freeze-version. Is similar feature planned for Elpaca? Ideally, I would love to have ability to roll back packages versions to ones before last upgrade

Confirmation

  • The feature I'm proposing does not already exist in Elpaca
@jumper047 jumper047 added the enhancement New feature or request label Oct 31, 2022
@progfolio
Copy link
Owner

Is similar feature planned for Elpaca?

Yes. The elpaca-write-lockfile and elpaca-load-lockfile commands are stubbed out in elpaca.el.
I'm still considering some aspects of the design.

I would love to have ability to roll back packages versions to ones before last upgrade

My plan is to make general commands that would make this easy to do.
I don't know if I'll provide a "roll back to the the versions just before an update" command specifically, but it will be easy to write one.

@noctuid
Copy link

noctuid commented Mar 8, 2023

It would be nice if these things would be supported:

  • A command to write the current hash for a single package
  • A key to manually ignore a dirty work tree when processing packages and just write the hash
  • A setting to automatically ignore a dirty worktree for certain packages (my main reason for wanting this is that the first Emacs packages I wrote have a lot of unused files I need to clean up but haven't had the time to; I also have todo files in some repos I'd like to clean and add at some point rather than .gitignore)
  • An option to to print using lv or something else (so messages/prompts persist even if something else prints to the echo area)
  • Some command to validate a configuration/lockfile. Sometimes a recipe (normally a custom one) is no longer valid due to the repo moving, for example. I've even seen a couple cases where a hash was no longer valid due to force pushes to master... It may be overkill/unreasonable for elpaca to do this. You can validate manually by running Emacs with a different home directory, for example.

jamesnvc added a commit to jamesnvc/dotfiles that referenced this issue Apr 20, 2023
So not going to bother at this juncture...waiting on
progfolio/elpaca#24 before migrating
ramblehead added a commit to ramblehead/.emacs.d that referenced this issue May 15, 2023
Seems to be working. No lockfile yet:
progfolio/elpaca#24

So, will stay with straight.el for now
progfolio added a commit that referenced this issue Feb 2, 2025
docs: document basic usage
elpaca-menu-functions: add elpaca-menu-lock-file
elpaca-load-lockfile: remove
elpaca-lock-file: user option to set lock file
elpaca-menu-lock-file: menu to defer to lock file recipes
elpaca--lock-file-init-p: predicate to exclude non-init elpacas
elpaca-lock-file-functions: filtering hook for elpaca-write-lock-file
elpaca-write-lock-file: command to write lock files

Related: #24 #151 #404 #405
@progfolio
Copy link
Owner

Rudimentary support for lock files added.

  • A command to write the current hash for a single package

Should be possible via elpaca-lock-file-functions.

  • A key to manually ignore a dirty work tree when processing packages and just
    write the hash

Currently no worktrees are checked. Current hash is written.

  • Some command to validate a configuration/lockfile. Sometimes a recipe
    (normally a custom one) is no longer valid due to the repo moving, for
    example. I've even seen a couple cases where a hash was no longer valid due to
    force pushes to master... It may be overkill/unreasonable for elpaca to do
    this. You can validate manually by running Emacs with a different home
    directory, for example.

I think attempting a bootstrap with the --init-directory option or using the elpaca-test macro should work for this.

@progfolio
Copy link
Owner

I would love to have ability to roll back packages versions to ones before last upgrade

On latest master you should be able to:

  1. M-x elpaca-write-lock-file to the desired path.
  2. Update desired packages.
  3. M-x elpaca-delete any packages you want to roll back.
  4. (setq elpaca-lock-file "/path/to/file/from/step/one.eld")
  5. M-x restart-emacs

At that point the packages should be installed in the state they were in at step 1.
This workflow could be automated to some extent by interested parties.
I have plans to do more work on lock files in the future, but it's enough to get started with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants