From 94c9f0ef90ba1c95673a0dbab5f559d10e555504 Mon Sep 17 00:00:00 2001 From: Mrityunjay Raj Date: Tue, 7 Jul 2026 12:26:06 +0530 Subject: [PATCH] create: log the archive name, not just the repository (fixes #9865) --- src/borg/archiver/create_cmd.py | 2 +- src/borg/testsuite/archiver/create_cmd_test.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/borg/archiver/create_cmd.py b/src/borg/archiver/create_cmd.py index 891cb85d6d..9558a4e4bd 100644 --- a/src/borg/archiver/create_cmd.py +++ b/src/borg/archiver/create_cmd.py @@ -221,7 +221,7 @@ def create_inner(archive, cache, fso): dry_run = args.dry_run self.start_backup = time.time_ns() t0 = archive_ts_now() - logger.info('Creating archive at "%s"' % args.location.processed) + logger.info('Creating archive "%s" in repository %s' % (args.name, args.location.processed)) if not dry_run: with Cache( repository, diff --git a/src/borg/testsuite/archiver/create_cmd_test.py b/src/borg/testsuite/archiver/create_cmd_test.py index 96c7721b92..d0d4df7ecc 100644 --- a/src/borg/testsuite/archiver/create_cmd_test.py +++ b/src/borg/testsuite/archiver/create_cmd_test.py @@ -886,6 +886,15 @@ def test_create_stats_store(archivers, request): assert store_stats["backend_load_volume"] >= 0 +def test_create_logs_archive_name(archivers, request): + """`borg create --info` announces the archive name, not just the repository.""" + archiver = request.getfixturevalue(archivers) + cmd(archiver, "repo-create", RK_ENCRYPTION) + create_regular_file(archiver.input_path, "testfile", contents=b"data") + output = cmd(archiver, "create", "--info", "my_archive", archiver.input_path) + assert 'Creating archive "my_archive"' in output + + def test_create_json(archivers, request): archiver = request.getfixturevalue(archivers) create_regular_file(archiver.input_path, "file1", size=1024 * 80)