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

discussion: local (on disk) forks + highlighting when is it "safe" to delete a repo (fork)? #135

Open
Dieterbe opened this issue Apr 2, 2023 · 1 comment

Comments

@Dieterbe
Copy link
Contributor

Dieterbe commented Apr 2, 2023

Hello, cool tool! I was looking to build something similar, but:

  1. for cleaning up checked out repositories on my laptop
  2. in a way that uses less "mental work" for the user of the tool. I don't want to have to manually review every single repository and read the text, because sometime the text is "benign" (like my fork has stars), and sometimes it is of vital importance (like my fork has unmerged commits)

Therefore, I think I would like to expand upon this tool. But before I start contributing PR's, i want to see if these ideas make sense.

Concretely, here's what I think:

  1. visual indicator (via color or emoji) whether a fork is safe to delete (while keeping what you have: selecting the fork shows more details)

  2. the rules whether a fork is safe to delete, would be as follows:

    a) for forks on github:

    • no commits that are not pushed upstream (in any branch)

    b) for forks on disk: the above, plus:

    • working copy is not "dirty" (i tend to create todo files, notes, or code files that is often not comitted)
    • index is empty
    • "git stash" is empty
  3. to keep things simple, the app would probably either scan GH forks, or on disk forks, not both at once.

  4. if you forked a repo on GH, and then cloned that code to your disk, it's possible the local fork only has a remote for the GH fork, and not for the upstream. so to keep things simple, you would probably clean up your on-disk forks first, before cleaning GH forks.

  5. which file paths to scan on disk: i see two options:

  • provide a parent path, and process all git repos inside it, but some code repositories have other "sub git repositories" as part of their build process, or vendored code, so keeping the behavior proper, seems a bit tricky
  • rely on shell expansion to provide an explicit list of all git repos to process, like $GOPATH/src/github.com/*/*, this would avoid that problem, although it might result in "argument list too long"
@caarlos0
Copy link
Owner

caarlos0 commented Apr 2, 2023

highlighting when its safe to delete seems like a cool feature, 100%.

the local fork thing I'm not sure if I would particularly use, but if you want to PR it I'll take a look :)

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

No branches or pull requests

2 participants