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

Re: git format-patch should honor notes

From
Johan Herland <johan@herland.net>
Date
Dec 8, 2010, 10:50 UTC
Message-ID
<201012081150.09424.johan@herland.net>
In-Reply-To
<4CFF5CD2.2000009@drmicha.warpmail.net>
On Wednesday 08 December 2010, Michael J Gruber wrote:
Show 30 quoted lines
> Johan Herland venit, vidit, dixit 08.12.2010 11:12:
> > On Wednesday 08 December 2010, Michael J Gruber wrote:
> >> Also, in order to be really useful, I would need a place to store
> >> the cover letter also. I was experimenting a while back with a
> >> design for annotating branchnames which "basically" worked but
> >> haven't had time to really implement it. If I remember correctly,
> >> I had to set up some "bogus" refs to keep my notes from being
> >> garbage collected and was still figuring out the best place to put
> >> them. I'll dig it up when I have time to.
> >
> > I believe the last time the issue of adding notes to branch names
> > was discussed, the consensus was that rather than using notes, they
> > could be stored using a custom entry in the config file, e.g.
> >
> >   git config branch.mybranch.description "Description of mybranch"
> >
> > I might have misremembered this, though.
>
> They certainly "could". The question whether they "should" depends on
> what they are used for:
>
> - config is neither versioned nor easily shareable; perfect for your
> own scratch notes to go away once work is done
>
> - notes are versioned and can be shared (I don't need to tell
> you...); perfect for longer term annotations you want to keep
>
> Note that "sharing" here includes also pushing to your backup repo
> and cloning around. I'd certainly put patch series cover letters in
> the second category.

True. I was wrong to equate cover letters with local-only branch name descriptions.

As has been discussed before, you can use notes to store the cover letter, the question is which SHA-1 to attach it to.

Using a SHA-1 that doesn't exist in the repo (e.g. the SHA-1 of the branch name) leaves the note vulnerable to 'git notes prune', but maybe that is an acceptable restriction ('git notes prune' must be manually invoked in any case). For extra safety, we could add a config option that refuses 'git notes prune' for a given notes ref, something like:

  git config notes.mynotes.refusePrune true
...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Michael J GruberNext: Thomas Rast
Message 7 of 8 in “git format-patch should honor notes”
  1. Eric BlakeDec 7, 2010
  2. Junio C HamanoDec 7, 2010
  3. Jeff KingDec 7, 2010
  4. Michael J GruberDec 8, 2010
  5. Johan HerlandDec 8, 2010
  6. Michael J GruberDec 8, 2010
  7. Johan HerlandDec 8, 2010
  8. Thomas RastDec 8, 2010

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.