"--latest" behavior change

Hi :waving_hand: me again :slight_smile:

Realized there are some changes on the output of snapshots command, specific to –latest. Let me explain:

What I want to see: “last snapshots of each host, which has a certain tag”. We’ve always used restic snapshots --tag mytag --latest 1 command for this.

  • Previously, it was giving what I expected, latest mytag snapshots from each host
~> sudo -E ./restic_0.17.3_linux_amd64 snapshots -c --tag mytag --latest 1
repository 128ec820 opened (version 2, compression level auto)
ID        Time                 Host                              Tags                                          Size
--------------------------------------------------------------------------------------------------------------------------
0111c924  2025-11-06 03:09:39  host1 ...<redacted>
53641f4f  2025-11-06 03:09:40  host2 ...
3cbe05e7  2025-11-06 03:32:58  host3 ...
--------------------------------------------------------------------------------------------------------------------------
3 snapshots
  • On later versions (I have now 0.18.1-dev) I only see 1 snapshot on the output; which is time-wise latest snapshot, having mytag
~> sudo -E restic snapshots -c --tag mytag --latest 1
repository 128ec820 opened (version 2, compression level auto)
ID        Time                 Host                      Tags                                          Size
------------------------------------------------------------------------------------------------------------------
3cbe05e7  2025-11-06 03:32:58  host3 ...<redacted>
------------------------------------------------------------------------------------------------------------------
Timestamps shown in CET timezone
1 snapshots

I can still somehow get what I want only by forcing group-by to “host”:

~> sudo -E restic snapshots -c --tag mytag --latest 1 -g host
repository 128ec820 opened (version 2, compression level auto)
snapshots for (host [host3]):
ID        Time                 Host                      Tags                                          Size
------------------------------------------------------------------------------------------------------------------
3cbe05e7  2025-11-06 03:32:58  host3 ...<redacted>
------------------------------------------------------------------------------------------------------------------
Timestamps shown in CET timezone
1 snapshots
snapshots for (host [host1]):
ID        Time                 Host                              Tags                    Size
----------------------------------------------------------------------------------------------------
0111c924  2025-11-06 03:09:39  host1 ...<redacted>
----------------------------------------------------------------------------------------------------
Timestamps shown in CET timezone
1 snapshots
snapshots for (host [host2]):
ID        Time                 Host                              Tags                    Size
----------------------------------------------------------------------------------------------------
53641f4f  2025-11-06 03:09:40  host2 ...<redacted>
----------------------------------------------------------------------------------------------------
Timestamps shown in CET timezone
1 snapshots

But this prints a lot of useless cruft with it as you see.

Visual things aside, behavior is different with –json output too, which got me worried about breaking the scripts using json output (luckily I didn’t rely on –latest yet).

Is this expected? If not I can create a bug report.

Thanks!