Count Contributing Developers

This feature is supported in JFrog CLI version 2.60.0

The git count-contributors command allows JFrog users to easily determine the number of Git developers contributing to their code. The counts indicate the number of contributing developers to the default branch.

The command counts the contributing developers for all commits performed within a specified time range. The results are based on email addresses, thus giving you a specific number of unique developers.

We provide several options to obtain the developer count:

  • A single repository: Analyze a single Git repository by providing the repository name.

  • Across a project/group: Analyze multiple repositories organized under a project/group by providing the owner command option.

  • Across multiple Git servers: Analyze repositories across various Git servers by providing a YAML file as an input file with the required parameters outlined below.

This information can be helpful when purchasing an Advanced Security subscription, as the number of developers is often a key factor in pricing.

Supported Git providers:

  • GitHub

  • GitLab

  • Bitbucket

The CLI outputs may include an estimation of the contributing developers based on the input provided by the user. They may be based on third-party resources and databases and JFrog does not guarantee that the CLI outputs are accurate and/or complete. The CLI outputs are not legal advice and you are solely responsible for your use of it. CLI outputs are provided "as is" and any representation or warranty of or concerning any third-party technology is strictly between the user and the third-party owner or distributor of the third-party technology.

Usage

The git count-contributors command can be run from the JFrog CLI with the following syntax:

git count-contributors [command options]

Command Option

Description

--scm-type

[Mandatory]

The type of SCM to use for the analysis.

Supported Values: github, gitlab, bitbucket Example: --scm-type=github

--scm-api-url

[Mandatory]

The base URL of the SCM system's API endpoint.

Format: The full URL, including the protocol Example: --scm-api-url=https://api.github.com

--token

[Mandatory]

The authentication token required to access the SCM system's API. In the absence of a flag, tokens should be passed in the JF_GIT_TOKEN environment variable, or the corresponding environment variables 'JFROG_CLI_GITLAB_TOKEN, JFROG_CLI_GITHUB_TOKEN or JFROG_CLI_BITBUCKET_TOKEN' Example: --token:your_access_token

--owner

[Mandatory]

The owner or organization of the repositories to be analyzed. Format: Depending on the Git provider. On GitHub and GitLab, the owner is typically an individual or an organization, On Bitbucket, the owner can also be a project. In the case of a private instance on Bitbucket, the individual or organization name should be prefixed with '~'. When using this option without a specific repository name, all repositories will be analyzed at the group/project level. Example: owner=your-organization

--months

[Optional]

The number of months to analyze for developer activity. Default: 1 Example: --months=6

--detailed-summary

[Optional]

Generates a more detailed summary of the contributors. Default: false Example: --detailed-summary=true

--repo-name

[Optional]

List of semicolon-separated(;) repositories names to analyze, If not provided all repositories related to the provided owner will be analyzed. Example: --repo-name=repo1;repo2

--input-file

[Optional]

The path to an input file in YAML format that contains multiple git providers. Example: --input-file="/Users/path/to/file/input.yaml"

--verbose

[Optional]

Enables verbose output, providing more detailed information.

Example Commands

Single Repository

git cc --scm-type=github --scm-api-url=https://api.github.com --token=<token> --owner=jfrog --months=4 --detailed-summary=false --repo-name=cli-core

Required Parameters:

  • --scm-type

  • --scm-api-url

  • --token

  • --repo-name

Group/Project

git cc --scm-type=gitlab --scm-api-url=https://git.vdoo.io --token=<token> --owner=vdoo --months=3 --detailed-summary

Required Parameters:

  • --scm-type

  • --scm-api-url

  • --token

  • --owner

Multiple Git Servers- YAML File

git-servers-list:
  - scm-type: bitbucket
    scm-api-url: "https://api.bitbucket.url"
    token: "token"
    owner: "owner"
    repositories:
      - "repo1"
      - "repo2"
  - scm-type: gitlab
    scm-api-url: "https://api.github.com"
    token: "token"
    owner: "owner"

Sample Output:

{
  "total_unique_contributors": 4,	-	        
  "total_commits": 4,				-	
  "scanned_repos": [				-	
    "test-go",
    "test-cli-core"
  ],
  "report_date": "2024-07-22T12:08:04+03:00",	-	
  "number_of_months": "5",			-	
  "unique_contributors_list": [			-	
    {
      "email": "dev1@users.noreply.github.com",
      "name": "`Developer 1",
      "last_commit": {
        "repo": "test-cli-core",
        "date": "2024-02-22T14:21:55Z",
        "hash": "3463b55aa453fb5dd3d5e7c6ebf45a3e33710e72"
      }
    },
    {
      "email": "dev2@users.noreply.github.com",
      "name": "Developer 2",
      "last_commit": {
        "repo": "test-go",
        "date": "2024-03-24T07:56:17Z",
        "hash": "8b102603458044b434689fc3832e12d30af12d15"
      }
    },
    {
      "email": "dev3@jfrog.com",
      "name": "Developer 3",
      "last_commit": {
        "repo": "test-cli-core",
        "date": "2024-02-25T15:15:19Z",
        "hash": "de88b95a38242b9984877a8e928ceafedb147843"
      }
    }
  ],
  "detailed_contributors_list": {		-	
    "dev2@users.noreply.github.com": [
      {
        "repo_path": "test-go",
        "last_commit": {
          "date": "2024-03-24T07:56:17Z",
          "hash": "8b102603458044b434689fc3832e12d30af12d15"
        }
      },
      {
        "repo_path": "test-cli-core",
        "last_commit": {
          "date": "2024-02-25T12:40:40Z",
          "hash": "0941c5ce1007501c2793efa0e09b0e9531b8d503"
        }
      }
    ],
    "dev3@jfrog.com": [
      {
        "repo_path": "test-cli-core",
        "last_commit": {
          "date": "2024-02-25T15:15:19Z",
          "hash": "de88b95a38242b9984877a8e928ceafedb147843"
        }
      }
    ],
    "dev1@users.noreply.github.com": [
      {
        "repo_path": "test-cli-core",
        "last_commit": {
          "date": "2024-02-22T14:21:55Z",
          "hash": "3463b55aa453fb5dd3d5e7c6ebf45a3e33710e72"
        }
      }
    ]
  },
  "detailed_repos_list": { -	
    "test-go": [
      {
        "email": "dev2@users.noreply.github.com",
        "last_commit": {
          "date": "2024-03-24T07:56:17Z",
          "hash": "8b102603458044b434689fc3832e12d30af12d15"
        }
      }
    ],
    "test-cli-core": [
      {
        "email": "dev3@jfrog.com",
        "last_commit": {
          "date": "2024-02-25T15:15:19Z",
          "hash": "de88b95a38242b9984877a8e928ceafedb147843"
        }
      },
      {
        "email": "dev2@users.noreply.github.com",
        "last_commit": {
          "date": "2024-02-25T12:40:40Z",
          "hash": "0941c5ce1007501c2793efa0e09b0e9531b8d503"
        }
      },
      {
        "email": "dev1@users.noreply.github.com",
        "last_commit": {
          "date": "2024-02-22T14:21:55Z",
          "hash": "3463b55aa453fb5dd3d5e7c6ebf45a3e33710e72"
        }
      }
    ]
  }
}

Last updated

© 2024 JFrog Ltd All Rights Reserved