{"action":"created","comment":{"url":"https://api.github.com/repos/borgbackup/borg/pulls/comments/71986282","id":71986282,"diff_hunk":"@@ -158,6 +158,20 @@ def list_archive_infos(self, sort_by=None, reverse=False):\n             archives = sorted(archives, key=attrgetter(sort_by), reverse=reverse)\n         return archives\n \n+    @property\n+    def oldest_archive(self):\n+        return self.oldest_archives(1) or None","path":"src/borg/helpers.py","position":6,"original_position":6,"commit_id":"d69acff92c4f4feb4af3650939a80a7d38a8a7de","original_commit_id":"d69acff92c4f4feb4af3650939a80a7d38a8a7de","user":{"login":"funkyfuture","id":2004405,"avatar_url":"https://avatars.githubusercontent.com/u/2004405?v=3","gravatar_id":"","url":"https://api.github.com/users/funkyfuture","html_url":"https://github.com/funkyfuture","followers_url":"https://api.github.com/users/funkyfuture/followers","following_url":"https://api.github.com/users/funkyfuture/following{/other_user}","gists_url":"https://api.github.com/users/funkyfuture/gists{/gist_id}","starred_url":"https://api.github.com/users/funkyfuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funkyfuture/subscriptions","organizations_url":"https://api.github.com/users/funkyfuture/orgs","repos_url":"https://api.github.com/users/funkyfuture/repos","events_url":"https://api.github.com/users/funkyfuture/events{/privacy}","received_events_url":"https://api.github.com/users/funkyfuture/received_events","type":"User","site_admin":false},"body":"if there's no use for it, i will remove it.","created_at":"2016-07-24T10:37:16Z","updated_at":"2016-07-24T10:37:16Z","html_url":"https://github.com/borgbackup/borg/pull/1369#discussion_r71986282","pull_request_url":"https://api.github.com/repos/borgbackup/borg/pulls/1369","_links":{"self":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/comments/71986282"},"html":{"href":"https://github.com/borgbackup/borg/pull/1369#discussion_r71986282"},"pull_request":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/1369"}}},"pull_request":{"url":"https://api.github.com/repos/borgbackup/borg/pulls/1369","id":78579890,"html_url":"https://github.com/borgbackup/borg/pull/1369","diff_url":"https://github.com/borgbackup/borg/pull/1369.diff","patch_url":"https://github.com/borgbackup/borg/pull/1369.patch","issue_url":"https://api.github.com/repos/borgbackup/borg/issues/1369","number":1369,"state":"open","locked":false,"title":"Extends delete command with --oldest & --latest options","user":{"login":"funkyfuture","id":2004405,"avatar_url":"https://avatars.githubusercontent.com/u/2004405?v=3","gravatar_id":"","url":"https://api.github.com/users/funkyfuture","html_url":"https://github.com/funkyfuture","followers_url":"https://api.github.com/users/funkyfuture/followers","following_url":"https://api.github.com/users/funkyfuture/following{/other_user}","gists_url":"https://api.github.com/users/funkyfuture/gists{/gist_id}","starred_url":"https://api.github.com/users/funkyfuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funkyfuture/subscriptions","organizations_url":"https://api.github.com/users/funkyfuture/orgs","repos_url":"https://api.github.com/users/funkyfuture/repos","events_url":"https://api.github.com/users/funkyfuture/events{/privacy}","received_events_url":"https://api.github.com/users/funkyfuture/received_events","type":"User","site_admin":false},"body":"i added a `--latest` and `--oldest` option to simply delete the newest resp. oldest backup from a repository. eg, it comes handy in bash scripts:\r\n\r\n``` bash\r\nwhile used_space_exceeds_pcent; do\r\n    log 'Used space exceeds ${MAX_DISK_USAGE}%, deleting oldest backup archive.'\r\n    borg delete --oldest --force $BACKUP_PATH & wait\r\ndone\r\n```\r\n\r\nalternatively, it could be implemented as `--last n` and `--first n` where `n` defaults to 1.","created_at":"2016-07-23T19:09:23Z","updated_at":"2016-07-24T10:37:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"104993a333ff887663195ff839e378e364c4e1ef","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/borgbackup/borg/pulls/1369/commits","review_comments_url":"https://api.github.com/repos/borgbackup/borg/pulls/1369/comments","review_comment_url":"https://api.github.com/repos/borgbackup/borg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/borgbackup/borg/issues/1369/comments","statuses_url":"https://api.github.com/repos/borgbackup/borg/statuses/d69acff92c4f4feb4af3650939a80a7d38a8a7de","head":{"label":"funkyfuture:delete_oldest_latest","ref":"delete_oldest_latest","sha":"d69acff92c4f4feb4af3650939a80a7d38a8a7de","user":{"login":"funkyfuture","id":2004405,"avatar_url":"https://avatars.githubusercontent.com/u/2004405?v=3","gravatar_id":"","url":"https://api.github.com/users/funkyfuture","html_url":"https://github.com/funkyfuture","followers_url":"https://api.github.com/users/funkyfuture/followers","following_url":"https://api.github.com/users/funkyfuture/following{/other_user}","gists_url":"https://api.github.com/users/funkyfuture/gists{/gist_id}","starred_url":"https://api.github.com/users/funkyfuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funkyfuture/subscriptions","organizations_url":"https://api.github.com/users/funkyfuture/orgs","repos_url":"https://api.github.com/users/funkyfuture/repos","events_url":"https://api.github.com/users/funkyfuture/events{/privacy}","received_events_url":"https://api.github.com/users/funkyfuture/received_events","type":"User","site_admin":false},"repo":{"id":64015883,"name":"borg","full_name":"funkyfuture/borg","owner":{"login":"funkyfuture","id":2004405,"avatar_url":"https://avatars.githubusercontent.com/u/2004405?v=3","gravatar_id":"","url":"https://api.github.com/users/funkyfuture","html_url":"https://github.com/funkyfuture","followers_url":"https://api.github.com/users/funkyfuture/followers","following_url":"https://api.github.com/users/funkyfuture/following{/other_user}","gists_url":"https://api.github.com/users/funkyfuture/gists{/gist_id}","starred_url":"https://api.github.com/users/funkyfuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funkyfuture/subscriptions","organizations_url":"https://api.github.com/users/funkyfuture/orgs","repos_url":"https://api.github.com/users/funkyfuture/repos","events_url":"https://api.github.com/users/funkyfuture/events{/privacy}","received_events_url":"https://api.github.com/users/funkyfuture/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/funkyfuture/borg","description":"Deduplicating backup program with compression and authenticated encryption.","fork":true,"url":"https://api.github.com/repos/funkyfuture/borg","forks_url":"https://api.github.com/repos/funkyfuture/borg/forks","keys_url":"https://api.github.com/repos/funkyfuture/borg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/funkyfuture/borg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/funkyfuture/borg/teams","hooks_url":"https://api.github.com/repos/funkyfuture/borg/hooks","issue_events_url":"https://api.github.com/repos/funkyfuture/borg/issues/events{/number}","events_url":"https://api.github.com/repos/funkyfuture/borg/events","assignees_url":"https://api.github.com/repos/funkyfuture/borg/assignees{/user}","branches_url":"https://api.github.com/repos/funkyfuture/borg/branches{/branch}","tags_url":"https://api.github.com/repos/funkyfuture/borg/tags","blobs_url":"https://api.github.com/repos/funkyfuture/borg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/funkyfuture/borg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/funkyfuture/borg/git/refs{/sha}","trees_url":"https://api.github.com/repos/funkyfuture/borg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/funkyfuture/borg/statuses/{sha}","languages_url":"https://api.github.com/repos/funkyfuture/borg/languages","stargazers_url":"https://api.github.com/repos/funkyfuture/borg/stargazers","contributors_url":"https://api.github.com/repos/funkyfuture/borg/contributors","subscribers_url":"https://api.github.com/repos/funkyfuture/borg/subscribers","subscription_url":"https://api.github.com/repos/funkyfuture/borg/subscription","commits_url":"https://api.github.com/repos/funkyfuture/borg/commits{/sha}","git_commits_url":"https://api.github.com/repos/funkyfuture/borg/git/commits{/sha}","comments_url":"https://api.github.com/repos/funkyfuture/borg/comments{/number}","issue_comment_url":"https://api.github.com/repos/funkyfuture/borg/issues/comments{/number}","contents_url":"https://api.github.com/repos/funkyfuture/borg/contents/{+path}","compare_url":"https://api.github.com/repos/funkyfuture/borg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/funkyfuture/borg/merges","archive_url":"https://api.github.com/repos/funkyfuture/borg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/funkyfuture/borg/downloads","issues_url":"https://api.github.com/repos/funkyfuture/borg/issues{/number}","pulls_url":"https://api.github.com/repos/funkyfuture/borg/pulls{/number}","milestones_url":"https://api.github.com/repos/funkyfuture/borg/milestones{/number}","notifications_url":"https://api.github.com/repos/funkyfuture/borg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/funkyfuture/borg/labels{/name}","releases_url":"https://api.github.com/repos/funkyfuture/borg/releases{/id}","deployments_url":"https://api.github.com/repos/funkyfuture/borg/deployments","created_at":"2016-07-23T12:46:55Z","updated_at":"2016-07-23T12:46:56Z","pushed_at":"2016-07-23T23:53:11Z","git_url":"git://github.com/funkyfuture/borg.git","ssh_url":"git@github.com:funkyfuture/borg.git","clone_url":"https://github.com/funkyfuture/borg.git","svn_url":"https://github.com/funkyfuture/borg","homepage":"https://borgbackup.readthedocs.io/","size":4835,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"borgbackup:master","ref":"master","sha":"3c2d41898f7fcc8cb1e676957575db75000f63e6","user":{"login":"borgbackup","id":12418060,"avatar_url":"https://avatars.githubusercontent.com/u/12418060?v=3","gravatar_id":"","url":"https://api.github.com/users/borgbackup","html_url":"https://github.com/borgbackup","followers_url":"https://api.github.com/users/borgbackup/followers","following_url":"https://api.github.com/users/borgbackup/following{/other_user}","gists_url":"https://api.github.com/users/borgbackup/gists{/gist_id}","starred_url":"https://api.github.com/users/borgbackup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borgbackup/subscriptions","organizations_url":"https://api.github.com/users/borgbackup/orgs","repos_url":"https://api.github.com/users/borgbackup/repos","events_url":"https://api.github.com/users/borgbackup/events{/privacy}","received_events_url":"https://api.github.com/users/borgbackup/received_events","type":"Organization","site_admin":false},"repo":{"id":35517126,"name":"borg","full_name":"borgbackup/borg","owner":{"login":"borgbackup","id":12418060,"avatar_url":"https://avatars.githubusercontent.com/u/12418060?v=3","gravatar_id":"","url":"https://api.github.com/users/borgbackup","html_url":"https://github.com/borgbackup","followers_url":"https://api.github.com/users/borgbackup/followers","following_url":"https://api.github.com/users/borgbackup/following{/other_user}","gists_url":"https://api.github.com/users/borgbackup/gists{/gist_id}","starred_url":"https://api.github.com/users/borgbackup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borgbackup/subscriptions","organizations_url":"https://api.github.com/users/borgbackup/orgs","repos_url":"https://api.github.com/users/borgbackup/repos","events_url":"https://api.github.com/users/borgbackup/events{/privacy}","received_events_url":"https://api.github.com/users/borgbackup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/borgbackup/borg","description":"Deduplicating backup program with compression and authenticated encryption.","fork":false,"url":"https://api.github.com/repos/borgbackup/borg","forks_url":"https://api.github.com/repos/borgbackup/borg/forks","keys_url":"https://api.github.com/repos/borgbackup/borg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/borgbackup/borg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/borgbackup/borg/teams","hooks_url":"https://api.github.com/repos/borgbackup/borg/hooks","issue_events_url":"https://api.github.com/repos/borgbackup/borg/issues/events{/number}","events_url":"https://api.github.com/repos/borgbackup/borg/events","assignees_url":"https://api.github.com/repos/borgbackup/borg/assignees{/user}","branches_url":"https://api.github.com/repos/borgbackup/borg/branches{/branch}","tags_url":"https://api.github.com/repos/borgbackup/borg/tags","blobs_url":"https://api.github.com/repos/borgbackup/borg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/borgbackup/borg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/borgbackup/borg/git/refs{/sha}","trees_url":"https://api.github.com/repos/borgbackup/borg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/borgbackup/borg/statuses/{sha}","languages_url":"https://api.github.com/repos/borgbackup/borg/languages","stargazers_url":"https://api.github.com/repos/borgbackup/borg/stargazers","contributors_url":"https://api.github.com/repos/borgbackup/borg/contributors","subscribers_url":"https://api.github.com/repos/borgbackup/borg/subscribers","subscription_url":"https://api.github.com/repos/borgbackup/borg/subscription","commits_url":"https://api.github.com/repos/borgbackup/borg/commits{/sha}","git_commits_url":"https://api.github.com/repos/borgbackup/borg/git/commits{/sha}","comments_url":"https://api.github.com/repos/borgbackup/borg/comments{/number}","issue_comment_url":"https://api.github.com/repos/borgbackup/borg/issues/comments{/number}","contents_url":"https://api.github.com/repos/borgbackup/borg/contents/{+path}","compare_url":"https://api.github.com/repos/borgbackup/borg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/borgbackup/borg/merges","archive_url":"https://api.github.com/repos/borgbackup/borg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/borgbackup/borg/downloads","issues_url":"https://api.github.com/repos/borgbackup/borg/issues{/number}","pulls_url":"https://api.github.com/repos/borgbackup/borg/pulls{/number}","milestones_url":"https://api.github.com/repos/borgbackup/borg/milestones{/number}","notifications_url":"https://api.github.com/repos/borgbackup/borg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/borgbackup/borg/labels{/name}","releases_url":"https://api.github.com/repos/borgbackup/borg/releases{/id}","deployments_url":"https://api.github.com/repos/borgbackup/borg/deployments","created_at":"2015-05-12T23:10:47Z","updated_at":"2016-07-24T03:44:02Z","pushed_at":"2016-07-23T23:53:11Z","git_url":"git://github.com/borgbackup/borg.git","ssh_url":"git@github.com:borgbackup/borg.git","clone_url":"https://github.com/borgbackup/borg.git","svn_url":"https://github.com/borgbackup/borg","homepage":"https://borgbackup.readthedocs.io/","size":5736,"stargazers_count":1346,"watchers_count":1346,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":119,"mirror_url":null,"open_issues_count":197,"forks":119,"open_issues":197,"watchers":1346,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/1369"},"html":{"href":"https://github.com/borgbackup/borg/pull/1369"},"issue":{"href":"https://api.github.com/repos/borgbackup/borg/issues/1369"},"comments":{"href":"https://api.github.com/repos/borgbackup/borg/issues/1369/comments"},"review_comments":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/1369/comments"},"review_comment":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/1369/commits"},"statuses":{"href":"https://api.github.com/repos/borgbackup/borg/statuses/d69acff92c4f4feb4af3650939a80a7d38a8a7de"}}}}
{"actor":{"display_login":"funkyfuture"}}