docs:borg init: explain the encryption modes better
The documentation for borg init was not structured logically:
1. The topic is switched from the general discussion of `borg init`
to the discussion of encryption modes without a title.
2. Obscure technical details (chunking, id generation etc) were
above the high-level overview and other key information.
I am about to add documentation for this feature. Per the "If you liked
it, you should have put a CI test on it" rule I am adding tests to
detect if the feature regresses (causing a discrepancy between the docs
and the real behavior).
If we create a new repo (and a new keyfile key, create=True),
there must not already exist a keyfile at the path/filename
where we want to write the new one.
In other use cases (e.g. if we overwrite a keyfile due
to the user changing their passphrase, create=False),
of course overwriting at the same path/fname is desired.
compact_segments produced separate 17b files for intermediate commits, although they were intended to be end-of-segment-file commits.
this is because when the intermediate commit is triggered, we are already at an offset beyond the limit.
thus needed to add the no_new flag to indicate that we do not want a new segment file just for the commit IF it is an intermediate commit.
- use expanded location for log output
- support placeholder expansion for BORG_REPO env var
- use Location.raw for the unprocessed, not expanded location string
https://github.com/borgbackup/borg/pull/6186#issuecomment-1023504905
> could you rename the strip test a little, so that there is
> ..._remote_repo in the test name. if one does not fully read the test
> (like me), one would assume that a strip-related test also applies to
> local repos, but in this case, the condition checked only applies to
> remote repos.
add test for: info: emit repo info even if repo has 0 archives
In https://github.com/borgbackup/borg/pull/6152 it has been neglected to
add a regression test for the bug that has been fixed. This is the test.
storage_quota_use should reflect current disk space usage (not considering some overheads like for the index etc.).
if a chunk is deleted, but the segment file containing the chunk is not yet compacted, the chunk's disk space is still in use!
when compact_segments is dropping the unused chunks, it is the right time to reduce storage_quota_use.
storage_quota_use includes the put header overhead.
the tests do object patching, this does not work
when we call the external binary "borg.exe".
this made these tests fail IF the borg.exe was
available (like in the debian stretch vagrant VM).
While doing some doc updates I needed a way to test them - to build
the documentation and inspect the output. I ran into an issue:
running python setup.py build_man was throwing exceptions:
1. The import-tar parser had a None description causing:
File "/home/user/borg/setup_docs.py", line 451, in write_heading
write(char * len(header))
TypeError: object of type 'NoneType' has no len()
2. There was no docs/usage/import-tar.rst causing an exception too
this re-introduces a race between os.path.exists vs. SaveFile creating that file, but due to the way how SaveFile works, it still makes sure that in the end there is a good cache tag file in place.
While reading the docs I noticed that in `borg list` the options --list-format and --format do the same thing. Using `git log -S` I have uncovered that --list-format used to be deprecated and was supposed to be removed in c87393cab7, but you overlooked it and undeprecated it instead. What should we do now? Just remove it or deprecate it again?