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

Feature Request: Support for Sapling #860

Closed
hacker-DOM opened this issue Nov 16, 2022 · 3 comments
Closed

Feature Request: Support for Sapling #860

hacker-DOM opened this issue Nov 16, 2022 · 3 comments

Comments

@hacker-DOM
Copy link

hacker-DOM commented Nov 16, 2022

Summary 💡

So I'm playing around with Sapling and it looks fantastic; the only thing I'm missing is onefetch haha

It would be great if Sapling support was added to oneftech 🙏

Motivation 🔦

No response

@spenserblack
Copy link
Collaborator

Thanks for bringing this up! I didn't know about Sapling, it looks pretty interesting!


Onefetch is a command-line Git information tool

@o2sh What do you think? Do we keep Onefetch as a Git information tool, or open it up to be a "local repository information tool"?


Just noting here while I'm thinking about it, not arguing for or against Sapling support: onefetch currently assumes a git repo in a lot of places, so, to support other repos, we'll definitely need to refactor. Here's a general idea that I'm thinking of:

trait RepoAnalyzer {
    fn repo_info() -> RepoInfo; // a subset of the `Info` struct
}

struct GitAnalyzer;
impl RepoAnalyzer for GitAnalyzer {
    // ...
}

struct SaplingAnalyzer;
impl RepoAnalyzer for SaplingAnalyzer {
    // ...
}

// The above format is so that we can easily plug new analyzers into the below. The trait
// might not be needed, but using it for at least example purposes.
enum Repo {
    Git,
    Sapling,
}

impl Repo {
    fn detect(path: Path) -> Result<Self> {
        // if .git exists, return Git. etc.
        // if no repos detected, or multiple detected, Err
    }

    fn analyze(&self) -> RepoInfo {
        match self {
            Self::Git => GitAnalyzer::repo_info(),
            Self::Sapling => SaplingAnalyzer::repo_info(),
        }
    }
}

@o2sh
Copy link
Owner

o2sh commented Feb 19, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@o2sh o2sh added the stale label Feb 19, 2023
@o2sh o2sh closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2023
@spenserblack
Copy link
Collaborator

Since this issue has gone stale and been closed as "not planned", I think it's OK to post this:

@hacker-DOM I rewrote this personal project "repofetch" to support 3rd-party plugins. So, if you want, you could write a plugin for sapling support.

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

No branches or pull requests

3 participants