git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Save notes state when releasing
@ 2013-09-20  5:38 Francis Moreau
  2013-09-20 10:34 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Francis Moreau @ 2013-09-20  5:38 UTC (permalink / raw
  To: git@vger.kernel.org

Hello,

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.

Thanks
-- 
Francis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Save notes state when releasing
  2013-09-20  5:38 Save notes state when releasing Francis Moreau
@ 2013-09-20 10:34 ` Jeff King
  2013-09-23  7:25   ` Francis Moreau
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2013-09-20 10:34 UTC (permalink / raw
  To: Francis Moreau; +Cc: git@vger.kernel.org

On Fri, Sep 20, 2013 at 07:38:17AM +0200, Francis Moreau wrote:

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Save notes state when releasing
  2013-09-20 10:34 ` Jeff King
@ 2013-09-23  7:25   ` Francis Moreau
  0 siblings, 0 replies; 3+ messages in thread
From: Francis Moreau @ 2013-09-23  7:25 UTC (permalink / raw
  To: Jeff King; +Cc: git@vger.kernel.org

On Fri, Sep 20, 2013 at 12:34 PM, Jeff King <peff@peff.net> wrote:
> On Fri, Sep 20, 2013 at 07:38:17AM +0200, Francis Moreau wrote:
>
>> 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.

Thank you Jeff, that's what I was needing.
-- 
Francis

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-23  7:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-20  5:38 Save notes state when releasing Francis Moreau
2013-09-20 10:34 ` Jeff King
2013-09-23  7:25   ` Francis Moreau

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).