[postgis-devel] git notes: a quick & short howto

Sandro Santilli strk at kbt.io
Mon Oct 3 05:01:37 PDT 2022


It happens that we push commits containing some broken reference in
the commit log. When that happens, it may be useful to "attach" a
note to the commit, so that other readers don't get confused.
It's a form of "errata corrige" that doesn't require re-writing
history.

Example of how to do this:

  # make sure we have latest notes from origin first
  git fetch origin refs/notes/*:refs/notes/*

  # add our note
  git notes add -m "Correct ticket reference is #5252" 171f8007

  # push our notes to origin
  git push origin refs/notes/*

The so added note will be shown by `git show` or `git log`:

  $ git log -1 171f8007
  commit 171f8007a002057046823a0bf366fb9a4bd09000
  Author: Regina Obe <lr at pcorp.us>
  Date:   Fri Sep 30 15:03:07 2022 -0400

      try to fix winnie's upgrade. References #5242 for PostGIS 3.4.0dev

  Notes:
      Correct ticket reference is #5252

The note will also be rendered by Gitea:

  https://git.osgeo.org/gitea/postgis/postgis/commit/171f8007

More on git notes:

  https://git-scm.com/docs/git-notes

--strk;

  Libre GIS consultant/developer
  https://strk.kbt.io/services.html


More information about the postgis-devel mailing list