Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle repos which are no longer desired #10

Open
JakeWharton opened this issue May 20, 2020 · 4 comments
Open

Handle repos which are no longer desired #10

JakeWharton opened this issue May 20, 2020 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@JakeWharton
Copy link
Owner

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

@JakeWharton JakeWharton added the enhancement New feature or request label May 20, 2020
@JakeWharton JakeWharton added this to the 1.0.0 milestone May 20, 2020
@JakeWharton
Copy link
Owner Author

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
Copy link
Owner Author

Also need

@JakeWharton JakeWharton changed the title Handle deleted repos Handle repos which are no longer desired May 21, 2020
@JakeWharton
Copy link
Owner Author

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
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant