git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Save notes state when releasing

From
Jeff King <peff@peff.net>
Date
Sep 20, 2013, 10:34 UTC
Message-ID
<20130920103401.GB21684@sigill.intra.peff.net>
In-Reply-To
<CAC9WiBh3ha61M789DL==Nch30P_mvGwDLODqNzwaAbmHtyhPkQ@mail.gmail.com>
On Fri, Sep 20, 2013 at 07:38:17AM +0200, Francis Moreau wrote:
Show 8 quoted lines
> I'm using notes in my project. I'm wondering if it's possible to save
> the state of the notes when I'm releasing/tagging a new version of my
> project so I can restore the saved notes state if I checkout back the
> old release.
> 
> Therefore I would be able to inspect notes (which may have been
> removed or modified after the release) as they were when the release
> happened.

The notes are stored as git trees, so you can point a "tag" ref at a particular state, just as you would with a normal branch. The "git tag" command expects to create refs under "refs/tags", whereas "git notes" expects to find notes under "refs/notes". The simplest thing is to just use "git update-ref" rather than "git tag" to create the pointer. Like:

  $ git update-ref refs/notes/v1.0 refs/notes/commits
and then you can always view the v1.0 notes as:
  $ git --notes=v1.0 log

You can even set the notes.displayRef config to always show v1.0 notes when they are available for a commit. Though if they are a subset of the current notes, you would expect to see duplicates. Depending on what you are storing in your notes, you may want to clean out your notes tree after the release.

-Peff
Previous: Francis MoreauNext: Francis Moreau
Message 2 of 3 in “Save notes state when releasing”
  1. Francis MoreauSep 20, 2013
  2. Jeff KingSep 20, 2013
  3. Francis MoreauSep 23, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.