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

improvements to checks for core.notesRef / GIT_NOTES_REF / --ref

From
Adam Spiers <git@adamspiers.org>
Date
Apr 29, 2013, 16:39 UTC
Message-ID
<20130429163909.GA19014@pacific.linksys.moosehall>
In-Reply-To
<20130429133205.GA4672@pacific.linksys.moosehall>
On Mon, Apr 29, 2013 at 02:32:05PM +0100, Adam Spiers wrote:
Show 18 quoted lines
> I've just written another quick wrapper around 'git notes' which makes
> it less painless to share notes to and from remote repositories:
> 
>     https://github.com/aspiers/git-config/blob/master/bin/git-rnotes
> 
> This makes sharing of notes as easy as:
> 
>     git rnotes $remote push
>     git rnotes $remote fetch
>     git rnotes $remote merge
>     git rnotes $remote pull
> 
> and was born from this discussion:
> 
>     http://stackoverflow.com/questions/12055303/merging-git-notes-when-there-are-merge-conflicts-in-them/
> 
> Once the Great Refs Namespace Debate is resolved[0], would this kind
> of UI would be a candidate for pushing into git-notes itself?

I just had a discussion on #git IRC with Thomas about how the above wrapper uses refs/notes/$remote/commits or similar to simulate a remote tracking branch for notes, and we agreed that it's not ideal due to potential collisions if --ref=$remote or refs/notes/* are ever used. As has probably been discussed already in the Great Debate, something like refs/remote-notes/ might be a better namespace; however the current implementation of git notes prevents this:

    static struct notes_tree *init_notes_check(const char *subcommand)
    {
            struct notes_tree *t;
            init_notes(NULL, NULL, NULL, 0);
            t = &default_notes_tree;
            if (prefixcmp(t->ref, "refs/notes/"))
                    die("Refusing to %s notes in %s (outside of refs/notes/)",
                        subcommand, t->ref);
            return t;
    }

Can we relax this to "refs/", to allow better isolation of namespaces for remote notes? Also, the check is applied for GIT_NOTES_REF and core.notesRef, but not for values passed via --ref. Therefore I would propose that init_notes_check() is not only relaxed but also moved from builtin/notes.c to notes.c, so that it can be consumed by default_notes_ref(). Thoughts?

Also, are there any plans in the future for making "git notes merge" provide an index, so that a proper 3-way merge with ancestor can be done using git mergetool?

Cheers, Adam

Previous: Adam SpiersNext: Junio C Hamano
Message 3 of 8 in “git-icing: sugary wrapper around git-cherry”
  1. Adam SpiersApr 27, 2013
  2. git-rnotes: git-notes wrapper for sharing notes between repositoriesAdam Spiers, Apr 29, 2013
  3. improvements to checks for core.notesRef / GIT_NOTES_REF / --refAdam Spiers, Apr 29, 2013
  4. Junio C HamanoApr 29, 2013
  5. Adam SpiersApr 29, 2013
  6. Johan HerlandApr 30, 2013
  7. Adam SpiersApr 30, 2013
  8. tools for making upstreaming / backporting easier in gitAdam Spiers, Sep 21, 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.