Skip to content

Support alternative modes to "check all refs" (e.g. "check a single branch") #104

Description

@jakub-g

Feature

It seems that as of 1.5.0, git metrics has a single mode that analyzes all commits in the repo.

It could be interesting to support a few other ways to analyse the repo, like:

  1. Check all refs (as it's the current case)
  2. Only check the current/main branch

A stretch:

  1. Compare all branches against current/main branch, one by one, and find the ones with the biggest diff in object count/disk size.

Explanation

I'm currently analyzing a repo which is ~20GB in --single-branch clone mode, vs ~38GB when all 10k+ branches are cloned. I'm trying to figure out whether the 18GB diff is due to just 10k branches x small diff in each, or are there some "rogue" branches that disproportionately affect the size.

(By accident, I already found one rogue branch which had a completely unrelated git history pushed over by mistake, with a different root commit -- essentially it was a different repo that was pushed into the current one due to a messed up git config of a contributor -- which got me interested in pursuing this further).

Notes

Re: (2) the current workaround is just to git clone --single-branch on the side, and run git metrics in that clone; it's fine, but just wasteful.

Re: (3) to be frank, I know that it might be quite expensive to calculate.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions