{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/comments/239940255","pull_request_review_id":182865405,"id":239940255,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTk0MDI1NQ==","diff_hunk":"@@ -0,0 +1,123 @@\n+﻿using GVFS.Common.Git;\r\n+using GVFS.Common.Tracing;\r\n+using System;\r\n+using System.Collections.Generic;\r\n+using System.Diagnostics;\r\n+using System.IO;\r\n+using System.Linq;\r\n+\r\n+namespace GVFS.Common.Maintenance\r\n+{\r\n+    public class LooseObjectsStep : GitMaintenanceStep\r\n+    {\r\n+        private const string LooseObjects = \"loose-objects.history\";\r\n+        private readonly string looseObjectsHistoryPath = null;\r\n+        private readonly bool ignoreTimeRestriction = false;\r\n+\r\n+        public LooseObjectsStep(GVFSContext context, bool requireCacheLock, bool ignoreTimeRestriction)\r\n+            : this(context, requireCacheLock)\r\n+        {\r\n+            this.ignoreTimeRestriction = ignoreTimeRestriction;\r\n+        }\r\n+\r\n+        public LooseObjectsStep(GVFSContext context, bool requireCacheLock)\r\n+            : base(context, gitObjects: null, requireObjectCacheLock: requireCacheLock)\r\n+        {\r\n+            this.looseObjectsHistoryPath = Path.Combine(this.Context.Enlistment.GitObjectsRoot, \"info\", LooseObjects);         \r\n+        }\r\n+\r\n+        public override string Area => \"LooseObjectsStep\";\r\n+\r\n+        protected override bool PerformMaintenance()\r\n+        {\r\n+            using (ITracer activity = this.Context.Tracer.StartActivity(\"LooseObjectsStep\", EventLevel.Informational, Keywords.Telemetry, metadata: null))\r\n+            {\r\n+                try\r\n+                {\r\n+                    if (!this.ignoreTimeRestriction && !this.EnoughTimeBetweenRuns())\r\n+                    {\r\n+                        activity.RelatedWarning(\"Skipping step due to not enough time between runs\");\r\n+                        return false;\r\n+                    }\r\n+\r\n+                    // Verify no git processes are running\r\n+                    IEnumerable<int> processIds = this.RunningGitProcessIds();\r\n+                    if (processIds.Count() > 0)\r\n+                    {                            \r\n+                        activity.RelatedWarning(\"Skipping LooseObjectsStep due to git pids {0}\", string.Join(\",\", processIds));\r\n+                        return false;\r\n+                    }\r\n+\r\n+                    // Perform prune-packed\r","path":"GVFS/GVFS.Common/Maintenance/LooseObjectsStep.cs","position":51,"original_position":51,"commit_id":"6272a79e7f0a63f91e32ffe1f56bd58c34594007","original_commit_id":"6272a79e7f0a63f91e32ffe1f56bd58c34594007","user":{"login":"derrickstolee","id":570044,"node_id":"MDQ6VXNlcjU3MDA0NA==","avatar_url":"https://avatars0.githubusercontent.com/u/570044?v=4","gravatar_id":"","url":"https://api.github.com/users/derrickstolee","html_url":"https://github.com/derrickstolee","followers_url":"https://api.github.com/users/derrickstolee/followers","following_url":"https://api.github.com/users/derrickstolee/following{/other_user}","gists_url":"https://api.github.com/users/derrickstolee/gists{/gist_id}","starred_url":"https://api.github.com/users/derrickstolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derrickstolee/subscriptions","organizations_url":"https://api.github.com/users/derrickstolee/orgs","repos_url":"https://api.github.com/users/derrickstolee/repos","events_url":"https://api.github.com/users/derrickstolee/events{/privacy}","received_events_url":"https://api.github.com/users/derrickstolee/received_events","type":"User","site_admin":false},"body":"It's worth testing to see if `prune-packed` doesn't need a `.git` dir, but it may complain \"I'm not in a git repo\"","created_at":"2018-12-07T20:41:21Z","updated_at":"2018-12-07T20:41:21Z","html_url":"https://github.com/Microsoft/VFSForGit/pull/596#discussion_r239940255","pull_request_url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/596","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/comments/239940255"},"html":{"href":"https://github.com/Microsoft/VFSForGit/pull/596#discussion_r239940255"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/596"}},"in_reply_to_id":239925382},"pull_request":{"url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/596","id":236969949,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2OTY5OTQ5","html_url":"https://github.com/Microsoft/VFSForGit/pull/596","diff_url":"https://github.com/Microsoft/VFSForGit/pull/596.diff","patch_url":"https://github.com/Microsoft/VFSForGit/pull/596.patch","issue_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/596","number":596,"state":"open","locked":false,"title":"[WIP] MaintenanceVerb + LooseObjectsStep","user":{"login":"jeschu1","id":20819937,"node_id":"MDQ6VXNlcjIwODE5OTM3","avatar_url":"https://avatars2.githubusercontent.com/u/20819937?v=4","gravatar_id":"","url":"https://api.github.com/users/jeschu1","html_url":"https://github.com/jeschu1","followers_url":"https://api.github.com/users/jeschu1/followers","following_url":"https://api.github.com/users/jeschu1/following{/other_user}","gists_url":"https://api.github.com/users/jeschu1/gists{/gist_id}","starred_url":"https://api.github.com/users/jeschu1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeschu1/subscriptions","organizations_url":"https://api.github.com/users/jeschu1/orgs","repos_url":"https://api.github.com/users/jeschu1/repos","events_url":"https://api.github.com/users/jeschu1/events{/privacy}","received_events_url":"https://api.github.com/users/jeschu1/received_events","type":"User","site_admin":false},"body":"Lot of code here so plenty of room for feedback :-).\r\nStill to do are unit tests & functional tests and the PR will not be completed without them.  \r\n\r\n**LooseObjectsStep**\r\n- We call prune-packed to remove loose objects that are already in pack-files\r\n- This is scheduled to run every 12 hours, but only runs if it's been 7 days since last run or ignoreTimeRestriction=true\r\n- There will be  part 2 of this Step that packs loose objects into a packfile.  That will come in a later iteration\r\n\r\n**MaintenaceVerb**\r\n-  This allows running a maintenance job (currently there is just 1 but this will be expanded)\r\n-  Allows forcing of Step (ignoreTimeRestriction=true)\r\n- Will also be used by functional tests to test running Steps","created_at":"2018-12-07T19:28:21Z","updated_at":"2018-12-07T20:41:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8f7496c4248d5cf02f354faf486ae27b1b4d0d3","assignee":null,"assignees":[],"requested_reviewers":[{"login":"derrickstolee","id":570044,"node_id":"MDQ6VXNlcjU3MDA0NA==","avatar_url":"https://avatars0.githubusercontent.com/u/570044?v=4","gravatar_id":"","url":"https://api.github.com/users/derrickstolee","html_url":"https://github.com/derrickstolee","followers_url":"https://api.github.com/users/derrickstolee/followers","following_url":"https://api.github.com/users/derrickstolee/following{/other_user}","gists_url":"https://api.github.com/users/derrickstolee/gists{/gist_id}","starred_url":"https://api.github.com/users/derrickstolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derrickstolee/subscriptions","organizations_url":"https://api.github.com/users/derrickstolee/orgs","repos_url":"https://api.github.com/users/derrickstolee/repos","events_url":"https://api.github.com/users/derrickstolee/events{/privacy}","received_events_url":"https://api.github.com/users/derrickstolee/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1039746735,"node_id":"MDU6TGFiZWwxMDM5NzQ2NzM1","url":"https://api.github.com/repos/Microsoft/VFSForGit/labels/WIP","name":"WIP","color":"f9c9a2","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/596/commits","review_comments_url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/596/comments","review_comment_url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/596/comments","statuses_url":"https://api.github.com/repos/Microsoft/VFSForGit/statuses/6272a79e7f0a63f91e32ffe1f56bd58c34594007","head":{"label":"jeschu1:newcleanjob","ref":"newcleanjob","sha":"6272a79e7f0a63f91e32ffe1f56bd58c34594007","user":{"login":"jeschu1","id":20819937,"node_id":"MDQ6VXNlcjIwODE5OTM3","avatar_url":"https://avatars2.githubusercontent.com/u/20819937?v=4","gravatar_id":"","url":"https://api.github.com/users/jeschu1","html_url":"https://github.com/jeschu1","followers_url":"https://api.github.com/users/jeschu1/followers","following_url":"https://api.github.com/users/jeschu1/following{/other_user}","gists_url":"https://api.github.com/users/jeschu1/gists{/gist_id}","starred_url":"https://api.github.com/users/jeschu1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeschu1/subscriptions","organizations_url":"https://api.github.com/users/jeschu1/orgs","repos_url":"https://api.github.com/users/jeschu1/repos","events_url":"https://api.github.com/users/jeschu1/events{/privacy}","received_events_url":"https://api.github.com/users/jeschu1/received_events","type":"User","site_admin":false},"repo":{"id":149776239,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk3NzYyMzk=","name":"VFSForGit","full_name":"jeschu1/VFSForGit","private":false,"owner":{"login":"jeschu1","id":20819937,"node_id":"MDQ6VXNlcjIwODE5OTM3","avatar_url":"https://avatars2.githubusercontent.com/u/20819937?v=4","gravatar_id":"","url":"https://api.github.com/users/jeschu1","html_url":"https://github.com/jeschu1","followers_url":"https://api.github.com/users/jeschu1/followers","following_url":"https://api.github.com/users/jeschu1/following{/other_user}","gists_url":"https://api.github.com/users/jeschu1/gists{/gist_id}","starred_url":"https://api.github.com/users/jeschu1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeschu1/subscriptions","organizations_url":"https://api.github.com/users/jeschu1/orgs","repos_url":"https://api.github.com/users/jeschu1/repos","events_url":"https://api.github.com/users/jeschu1/events{/privacy}","received_events_url":"https://api.github.com/users/jeschu1/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jeschu1/VFSForGit","description":"Virtual File System for Git: Enable Git at Enterprise Scale","fork":true,"url":"https://api.github.com/repos/jeschu1/VFSForGit","forks_url":"https://api.github.com/repos/jeschu1/VFSForGit/forks","keys_url":"https://api.github.com/repos/jeschu1/VFSForGit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeschu1/VFSForGit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeschu1/VFSForGit/teams","hooks_url":"https://api.github.com/repos/jeschu1/VFSForGit/hooks","issue_events_url":"https://api.github.com/repos/jeschu1/VFSForGit/issues/events{/number}","events_url":"https://api.github.com/repos/jeschu1/VFSForGit/events","assignees_url":"https://api.github.com/repos/jeschu1/VFSForGit/assignees{/user}","branches_url":"https://api.github.com/repos/jeschu1/VFSForGit/branches{/branch}","tags_url":"https://api.github.com/repos/jeschu1/VFSForGit/tags","blobs_url":"https://api.github.com/repos/jeschu1/VFSForGit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeschu1/VFSForGit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeschu1/VFSForGit/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeschu1/VFSForGit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeschu1/VFSForGit/statuses/{sha}","languages_url":"https://api.github.com/repos/jeschu1/VFSForGit/languages","stargazers_url":"https://api.github.com/repos/jeschu1/VFSForGit/stargazers","contributors_url":"https://api.github.com/repos/jeschu1/VFSForGit/contributors","subscribers_url":"https://api.github.com/repos/jeschu1/VFSForGit/subscribers","subscription_url":"https://api.github.com/repos/jeschu1/VFSForGit/subscription","commits_url":"https://api.github.com/repos/jeschu1/VFSForGit/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeschu1/VFSForGit/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeschu1/VFSForGit/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeschu1/VFSForGit/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeschu1/VFSForGit/contents/{+path}","compare_url":"https://api.github.com/repos/jeschu1/VFSForGit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeschu1/VFSForGit/merges","archive_url":"https://api.github.com/repos/jeschu1/VFSForGit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeschu1/VFSForGit/downloads","issues_url":"https://api.github.com/repos/jeschu1/VFSForGit/issues{/number}","pulls_url":"https://api.github.com/repos/jeschu1/VFSForGit/pulls{/number}","milestones_url":"https://api.github.com/repos/jeschu1/VFSForGit/milestones{/number}","notifications_url":"https://api.github.com/repos/jeschu1/VFSForGit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeschu1/VFSForGit/labels{/name}","releases_url":"https://api.github.com/repos/jeschu1/VFSForGit/releases{/id}","deployments_url":"https://api.github.com/repos/jeschu1/VFSForGit/deployments","created_at":"2018-09-21T14:40:32Z","updated_at":"2018-09-21T14:40:36Z","pushed_at":"2018-12-07T20:17:58Z","git_url":"git://github.com/jeschu1/VFSForGit.git","ssh_url":"git@github.com:jeschu1/VFSForGit.git","clone_url":"https://github.com/jeschu1/VFSForGit.git","svn_url":"https://github.com/jeschu1/VFSForGit","homepage":"https://gvfs.io/","size":3708,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"2fc0a498fc36b0d412339f4d928e0f30cf2a3da3","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":80058269,"node_id":"MDEwOlJlcG9zaXRvcnk4MDA1ODI2OQ==","name":"VFSForGit","full_name":"Microsoft/VFSForGit","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/VFSForGit","description":"Virtual File System for Git: Enable Git at Enterprise Scale","fork":false,"url":"https://api.github.com/repos/Microsoft/VFSForGit","forks_url":"https://api.github.com/repos/Microsoft/VFSForGit/forks","keys_url":"https://api.github.com/repos/Microsoft/VFSForGit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/VFSForGit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/VFSForGit/teams","hooks_url":"https://api.github.com/repos/Microsoft/VFSForGit/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/VFSForGit/events","assignees_url":"https://api.github.com/repos/Microsoft/VFSForGit/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/VFSForGit/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/VFSForGit/tags","blobs_url":"https://api.github.com/repos/Microsoft/VFSForGit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/VFSForGit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/VFSForGit/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/VFSForGit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/VFSForGit/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/VFSForGit/languages","stargazers_url":"https://api.github.com/repos/Microsoft/VFSForGit/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/VFSForGit/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/VFSForGit/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/VFSForGit/subscription","commits_url":"https://api.github.com/repos/Microsoft/VFSForGit/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/VFSForGit/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/VFSForGit/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/VFSForGit/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/VFSForGit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/VFSForGit/merges","archive_url":"https://api.github.com/repos/Microsoft/VFSForGit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/VFSForGit/downloads","issues_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/VFSForGit/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/VFSForGit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/VFSForGit/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/VFSForGit/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/VFSForGit/deployments","created_at":"2017-01-25T21:10:29Z","updated_at":"2018-12-07T19:34:08Z","pushed_at":"2018-12-07T20:28:40Z","git_url":"git://github.com/Microsoft/VFSForGit.git","ssh_url":"git@github.com:Microsoft/VFSForGit.git","clone_url":"https://github.com/Microsoft/VFSForGit.git","svn_url":"https://github.com/Microsoft/VFSForGit","homepage":"https://vfsforgit.org/","size":3710,"stargazers_count":4420,"watchers_count":4420,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":298,"mirror_url":null,"archived":false,"open_issues_count":159,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":298,"open_issues":159,"watchers":4420,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/596"},"html":{"href":"https://github.com/Microsoft/VFSForGit/pull/596"},"issue":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/issues/596"},"comments":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/issues/596/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/596/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/596/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/statuses/6272a79e7f0a63f91e32ffe1f56bd58c34594007"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"derrickstolee"}}