gitout icon indicating copy to clipboard operation
gitout copied to clipboard

Handle repos which are no longer desired

Open JakeWharton opened this issue 5 years ago • 4 comments

But how do we detect this case? Need some kind of local database on which we can do a diff.

JakeWharton avatar May 20 '20 03:05 JakeWharton

don't really want to do anything fancy here. how about we keep a text file of each with the version in the filename.

  • github/owned.1.txt
  • github/watched.1.txt
  • github/starred.1.txt
  • git/repos.1.txt

Each is sorted. Then we just do a one-pass zipper diff down the API lists and local lists and delete anything that's removed.

JakeWharton avatar May 21 '20 02:05 JakeWharton

Also need

  • github/clone/repos.1.txt
  • github/archive/repos.1.txt (for #3)

JakeWharton avatar May 21 '20 02:05 JakeWharton

More to think about, there's at least three cases to handle:

  1. The repo was unstarred/unwatched in which case we want it removed.
  2. The repo was moved in which case we want to move our local copy as well.
  3. The repo was deleted in which case we want to do nothing.

For 1 we can still ping the repo on GitHub to confirm it exists in which case we know it was removed. For 2 we should be able to get information from GitHub from that same ping in which case we can move the local repo before the sync occurs (the sync list will already have the new repo in it). For 3, presumably the GitHub ping will 404 in which we do nothing.

JakeWharton avatar May 31 '20 00:05 JakeWharton

The behavior of 3 is annoying for forks in which case you only want to send a PR and then later delete. Not sure what to do about it. That's just GitHub's dumb-ass model of sending PRs.

JakeWharton avatar Jun 01 '20 02:06 JakeWharton