4

Using Gitlab for the first time.

I had an existing web project on my local PC, I ran these commands;

cd /myFolder
git init
git add .
git remote add origin remote repository URL
git commit -m "First commit"
git push origin master

This added all my files to my remote repo - all working well so far.

I noticed that on the gitlab website, on my project page, there was a button Add Changelog (as well as add readme, add licence, etc.). I clicked this button and an empty changelog.md was created in my folder, which i've been able to pull into my local repo.

How do I generate changelog entries?

I've read the documentation and this question but I still don't understand.

I can't see a bin/changelog anywhere in my local repo.

Do I have to clone the whole Gitlab repo somewhere?

Any advice is appreciated.

TheOrdinaryGeek
  • 2,273
  • 5
  • 21
  • 47
  • Does this help: https://docs.gitlab.com/ee/development/changelog.html#how-to-generate-a-changelog-entry – OliverRadini Aug 01 '18 at 11:50
  • It should be wherever the gitlab repo is cloned, this answer may be helpful: https://stackoverflow.com/questions/46384937/how-to-make-a-gitlab-changelog-entry – OliverRadini Aug 01 '18 at 11:57
  • How did you install gitlab? – OliverRadini Aug 01 '18 at 12:02
  • Please have a quick read through on git basics from a tutorial. `git` is a version control system that exists on your file system, which is also a distributed VCS. You need to `git clone` a repository to work on it locally (i.e. on your PC). `git clone` is basically downloading the file. That's what @OliverRadini asked, where did you download the project? Also, gitlab change log is a Ruby script. The file should be created on your gitlab server, try a `git pull` to update your local repo and use the script according to the documentation – clamentjohn Aug 01 '18 at 12:38
  • @TheOrdinaryGeek I think perhaps there's some confusion here about how gitlab works. You can either push your repositories to `gitlab.com` or you can host a version of gitlab yourself. As far as I understand it, you need to be hosting your own version of gitlab in order to automatically generate changelogs using gitlab. – OliverRadini Aug 01 '18 at 13:30
  • Gitlab has a slight issue based on the fact that it has three major versions; `gitlab.com`, `gitlab community edition`, and `gitlab enterprise edition`. Knowing which is which when you're looking at documentation isn't always very easy, the url is often an indicator; notice the `ce` in this url: https://docs.gitlab.com/ce/development/changelog.html#how-to-generate-a-changelog-entry – OliverRadini Aug 01 '18 at 13:35
  • My bad. @OliverRadini 's answer sounds more educated. I've removed my answer – clamentjohn Aug 01 '18 at 13:40
  • @OliverRadini's answer is rather misleading. The `bin/changelog` script is part of the GitLab Development Kit (GDK) used for developing GitLab itself. It's not a general tool for repositories hosted on GitLab. Whether @TheOrdinaryGeek is using CE or EE has no bearing here. – King Chung Huang Aug 01 '18 at 17:17
  • @OliverRadini TheOrdinaryGeek's commands show a new repository being created. He/she is not developing GitLab, and appears to be confused by the documentation for the development of GitLab CE/EE.The bin/changelog script is not a GitLab feature, and does not describe how to generate changelogs for repositories hosted on GitLab. – King Chung Huang Aug 02 '18 at 17:45

2 Answers2

9

No more script needed.

See GitLab 13.9 (February 2021)

Create changelogs using the GitLab API

Previously, generating a changelog using GitLab was a manual process. Release Managers had to collect all the changes for a given release and then manually add them to a changelog file, which was time-consuming and prone to error. To make this process easier, we have now added an API that will automatically generate a changelog for a given release based on commit history. This enables development teams to better communicate changes to end users by delivering a consistent and comprehensive set of changelogs for every release.

See Documentation and Issue.

Example:

## 1.0.0 (2021-01-05)

### Features (4 changes)

- [Feature 1](gitlab-org/gitlab@123abc) by @alice ([merge request](gitlab-org/gitlab!123))
- [Feature 2](gitlab-org/gitlab@456abc) ([merge request](gitlab-org/gitlab!456))
- [Feature 3](gitlab-org/gitlab@234abc) by @steve
- [Feature 4](gitlab-org/gitlab@456)

And, May 2023, glab 1.30.0 adds:

glab changelog generate, which does the same, through the glab CLI.

This is mentioned with GitLab 16.1 (June 2023)

Create a changelog from the GitLab CLI

Changelogs generate comprehensive lists of changes based on commits to a project. They can be challenging to automate or view, and require interacting with the GitLab API.

With the release of GitLab CLI v1.30.0 you can now generate changelogs for projects directly from your shell. The glab changelog generate command makes it easier to review, automate, and publish changelogs.

Thanks Michael Mead for your contribution!

See Documentation and Issue.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I like this feature but the problem is tat in a commit you can't put more than one type of Changelog. I have tryed to put multiple type but only the last is chosen – Macdeveloper May 05 '21 at 13:58
  • @Macdeveloper Good point. That would be a good feature request to add to the team who proposed that feature: https://gitlab.com/groups/gitlab-com/gl-infra/-/issues – VonC May 05 '21 at 14:38
  • thank you, but in the list of the project at the link you proposed I don't find any project for the api management – Macdeveloper May 06 '21 at 15:41
  • @Macdeveloper I mentioned them because they are involved in https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/351 – VonC May 06 '21 at 15:46
  • 1
    ok i will do it, meanwhile I forked a good go software cli (https://juhani.gitlab.io/go-semrel-gitlab/) that create changelog using semrel syntax and work perfectly integrated into gitlab CI. I start forking go-semrel (https://github.com/bisegni/go-semrel) lib for producing many change for one commit and then forked go-semrel-gitlab (https://gitlab.com/bisegni/go-semrel-gitlab) to use it. Give it a try. – Macdeveloper May 09 '21 at 09:25
3

It's up to you how you'd like to manage changelog.md. Take a look at other questions like Good ways to manage a changelog using git? for examples of generating changelogs from git commit messages.

The documentation you linked to is about generating changelogs for the GitLab projects (ce/ee). It's not a feature for repositories hosted on GitLab.

King Chung Huang
  • 5,026
  • 28
  • 24
  • 1
    This answers a separate question, there are lots of ways to generate changelogs, this concerns generating those logs using gitlab – OliverRadini Aug 02 '18 at 07:29