Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70200

Get only the git history from pull request's base

XMLWordPrintable

      Currently, when building PRs in a multi-branch pipeline job, one has two choices:

      • clone the repository with the whole history of the PR's branch (default)
      • clone the repository with a fixed amount of commits using the `cloneOptionTrait`

      A third option that would retrieve only the commits from the PR that are on top of the PR base would be awesome.

      Basically, I want to inspect the git history of my PR to implement checks on the git diff and currently, I either fetch the whole repository (in GitOps repositories it's heavyweight) or settle for an arbitrary depth and pray that no PR becomes too big.

      Even getting the number of commits in the PR (in the environment for example) would do, I can just call `git fetch --deepen=$PR_COMMITS_NUMBER` which would be enough.

            Unassigned Unassigned
            quilicicf Cyprien Quilici
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: