diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-02 00:11:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-02 00:11:09 +0300 |
commit | 11b7785066d3e81916cbf653f4eb6568148f7e01 (patch) | |
tree | d4e66091e1cbef57db10d2c9c16cd98106e9a633 /doc/api/repositories.md | |
parent | 69f0d90aad454a2b8f3c4e2f2ca31886a14a8642 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/api/repositories.md')
-rw-r--r-- | doc/api/repositories.md | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/doc/api/repositories.md b/doc/api/repositories.md index 649fe0cce8b..49a53039847 100644 --- a/doc/api/repositories.md +++ b/doc/api/repositories.md @@ -337,38 +337,41 @@ attribute. ### Examples -For these examples we use the project ID 42, and assume the project is hosted on -GitLab.com. The example API token we use is `token`. We use -[curl](https://curl.se/) to perform the HTTP requests. +These examples use [cURL](https://curl.se/) to perform HTTP requests. +The example commands use these values: -Let's start with a basic example: +- **Project ID**: 42 +- **Location**: hosted on GitLab.com +- **Example API token**: `token` + +This command generates a changelog for version `1.0.0`. + +The commit range: + +- Starts with the tag of the last release. +- Ends with the last commit on the target branch. The default target branch is the project's default branch. + +If the last tag is `v0.9.0` and the default branch is `main`, the range of commits +included in this example is `v0.9.0..main`: ```shell curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0" "https://gitlab.com/api/v4/projects/42/repository/changelog" ``` -This generates a changelog for version `1.0.0`. The start of the range of -commits to include is the tag of the last release. The end of the range is the -last commit on the target branch, which defaults to the project's default -branch. So if the last tag is `v0.9.0`, and the default branch is `main`, this -means the range of commits is `v0.9.0..main`. - -If you want to generate the data on a different branch, you can do so as -follows: +To generate the data on a different branch, specify the `branch` parameter. This +command generates data from the `foo` branch: ```shell curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0&branch=foo" "https://gitlab.com/api/v4/projects/42/repository/changelog" ``` -This generates the data on the `foo` branch. - -A different trailer to use is specified as follows: +To use a different trailer, use the `trailer` parameter: ```shell curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0&trailer=Type" "https://gitlab.com/api/v4/projects/42/repository/changelog" ``` -Or perhaps you want to store the results in a different file: +To store the results in a different file, use the `file` parameter: ```shell curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0&file=NEWS" "https://gitlab.com/api/v4/projects/42/repository/changelog" |