borgbackup / borgbackup/borg

extract: shall borg warn if cwd is not empty?

Open
#10,057 1 comment 0 reactions 0 assignees View on GitHub
cmd: extract question
Dominant language
Python
Stars
13.7k
Forks
875
Avg merge
11h 15m
Merged PRs (30d)
192

Description

Just read an old story on reddit, where somebody damaged their home directory by running:
```
borg extract REPO::archive
```

Well, that is designed to extract the archive contents to `.`, which usually should be a new/empty directory, just made for extraction purposes.

In that case, it was their normal home directory, so the archived files overwrote the current files - likely the archive was created using: `borg create REPO::archive .`

Shall borg extract warn and ask for confirmation if the cwd is not empty?

Contributor guide

Open the contributing guide

Research direction

Start at the implementation of the `borg extract` command and inspect existing confirmation behavior and related tests. Determine how a non-empty current directory is detected and how a confirmation prompt should behave; done means extraction warns before proceeding and the behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.