4

My company is using a private GitLab. I recently looked to the graph of branches and commits, and it showed this. A [1 note] label that looks like the labels GitLab uses to show the branches' heads (but "1 note" isn't one of our branches).

(Screenshot of GitLab commit graph)

When I browse through a CLI git log, I can't see anything related to that.

Does anyone know what this [1 note] means/represent ?

If context can help, here's what the dev did:

Looking at the commit tree:

  • Was on the bottom red commit
  • Made the 2 green commits
  • Made a reset --hard to the bottom red commit
  • Made the middle red commit ([bugfix]...)
  • Pulled the top green commit into its current commit (still middle red one), leading to a merge : the top red commit.

2 Answers 2

6

So I just found the origin of this label.

The commit has this label, because another commit has a comment looking like "blablabla ... id_of_the_famous_labeled_commit ... blablabla"

It seems that GitLab recognises that this is a commit's id, and link them.

0

git notes is a way to attach information to Git objects (primarily commits) after they've been created. Since objects are immutable, the notes are stored in a separate ref (kind of a special branch).

To enable fetching notes from a remote, use:

git config --add remote.origin.fetch "+refs/notes/*:refs/notes/*"
git fetch origin

git ls-remote origin | grep refs/notes
git ls-remote . | grep refs/notes

To display commit-related notes in git log, use:

git config notes.displayRef refs/notes/commits
3
  • As if Git wasn’t hard enough to teach...this is the first I’ve heard of notes.
    – Wildcard
    Sep 6, 2019 at 8:27
  • 1
    Good news, most users don't need to be taught about it. (Frankly it's not a very useful feature either – the attached information is as easy to lose as actual post-it notes.) Sep 6, 2019 at 8:29
  • 3
    I finally find where this thing comes from. And it's not git-notes, it's because its commit number (hash) is written in another commit's comment. I suppose this to be a GitLab functionnality, not a Git one. But you just make me discover git-notes, thanks a lot for that !
    – Motiss
    Sep 6, 2019 at 10:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .