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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bare repository support #1299

Open
walderich opened this issue Mar 30, 2024 · 2 comments
Open

Bare repository support #1299

walderich opened this issue Mar 30, 2024 · 2 comments
Labels
enhancement New feature or request upstream

Comments

@walderich
Copy link

Summary 馃挕

Would it be possible to read repository information from a bare git repository? Currently only an error is printed that no repository can be found.

Motivation 馃敠

I have a server running where all of my Git repositories are stored for synchronization. These are only bare repositories and it would be really helpful to get the statistics without cloning them or installing onefetch on every machine (I am developing on Windows, Linux and Mac).

@walderich walderich added the enhancement New feature or request label Mar 30, 2024
@spenserblack
Copy link
Collaborator

spenserblack commented Mar 31, 2024

Would it be possible to read repository information from a bare git repository?

Not as long as we use tokei, since that uses the actual files in the repository's directory, not the files in the git history. Though we might switch to a tool that can read bare repos.

Though we're still figuring out what the "source" for the files should be after the switch (e.g. #1152 (comment)).

@o2sh o2sh added the upstream label Apr 9, 2024
@spenserblack
Copy link
Collaborator

Sorry, I got a bit tunnel-visioned, I just realized, besides building language stats, onefetch reads files from "non-bare" repositories for

  • Manifests (package.json, Cargo.toml)
  • License files

So, besides #1305 (supersedes #1152), we'd have to update those utilities to read from a git commit/index. I don't think these stats will break, but they won't be included until those are updated as well.

Also, if I'm not mistaken, our call to gix::ThreadSafeRepository::discover_opts doesn't currently support bare repos and would need to be updated:

onefetch/src/info/mod.rs

Lines 113 to 120 in 3cdc171

let mut repo = gix::ThreadSafeRepository::discover_opts(
&cli_options.input,
gix::discover::upwards::Options {
dot_git_only: true,
..Default::default()
},
Mapping::default(),
)?

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

No branches or pull requests

3 participants