Skip to content

lore branch archive ignores --dry-run and deletes the branch, locally and on the remote #181

Description

@wallace-eduardo

Lore version

lore 0.8.7-nightly+0

Installation method

Built from source

Operating system / architecture

Windows -- x86_64

Steps to reproduce

  1. lore branch create scratch
  2. lore branch archive scratch --dry-run
  3. lore branch list

Expected vs actual behavior

Expected: the dry run reports what it would do and changes nothing. The global flag's help says "only report what would have been changed and perform no changes".

Actual: the branch is deleted, locally and on the remote. It prints Archived branch scratch, exactly what a real run prints, so the output gives no way to tell them apart. Running it again answers branch not found, which is usually how you find out.

Cause: archive_impl in lore/src/branch.rs never reads execution.globals().dry_run(). At 65822ad that file contains no reference to dry_run at all. Other write paths do check it; lore-revision/src/commit.rs checks it in six places.

Two details worth having: the global help says "no changes to local file system", but this also deletes the remote branch, so the help understates the scope. And skipping the delete also skips the BranchArchive event, which is emitted inside branch::delete, a fix must emit it separately or the dry run prints nothing, which reads the same as a command that never ran.

We carry a local fix and can open a PR if useful.

Component

Client (CLI)

Server context

No response

Regression?

no

Relevant logs or output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageNot yet reviewed by a maintainer, awaiting initial triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions