git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "W. Trevor King" <wking@tremily.us>
To: Git <git@vger.kernel.org>
Cc: "W. Trevor King" <wking@tremily.us>
Subject: [PATCH 0/2] Add --expand to 'git notes get-ref'
Date: Wed, 05 Sep 2012 08:48:13 -0400	[thread overview]
Message-ID: <cover.1346848834.git.wking@tremily.us> (raw)

From: "W. Trevor King" <wking@tremily.us>

I was recently confused when

  $ git notes merge -v refs/remotes/origin/notes/commits

failed to do (or print) anything.  It turns out that note refs must
live under 'refs/notes/', so my command line ref was expanding to

  refs/notes/refs/remotes/origin/notes/commits

which wasn't matching anything.

The first of my commits here adds the '--expand' option, so you can
see how Git is expanding your ref internally:

  $ GIT_NOTES_REF=commits git notes get-ref --expand
  refs/notes/commits

The second commit makes the expansion less strict about the location
of note refs.  In his initial mail introducing 'git notes', Johan says
that note refs should live under 'refs/notes' [1].  This seems like a
good place for local notes, but note refs from remote repos should
probably live somewhere else (e.g. 'refs/remote-notes/' or
'refs/remotes/<name>/notes/'.  In the initial thread there are a few
messages talking about looking up reverse mappings under 'refs/notes/',
but this seems to all have been before the 'refs/notes/<namespace>/'
stage.  If I'm missing a good reason to keep everything under
'refs/notes/', feel free to ignore the second patch.

Cheers,
Trevor

[1]: http://permalink.gmane.org/gmane.comp.version-control.git/48540


W. Trevor King (2):
  notes get-ref: --expand expands the output notes ref.
  notes: don't alter refs starting with 'refs/' in expand_notes_ref

 Documentation/git-notes.txt |  6 +++++-
 builtin/notes.c             | 26 +++++++++++++++++++++-----
 notes.c                     |  2 +-
 t/t3301-notes.sh            | 12 ++++++++++++
 4 files changed, 39 insertions(+), 7 deletions(-)

-- 
1.7.12.176.g3fc0e4c.dirty

             reply	other threads:[~2012-09-05 13:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 12:48 W. Trevor King [this message]
2012-09-05 12:52 ` [PATCH 1/2] notes get-ref: --expand expands the output notes ref W. Trevor King
2012-09-05 12:52   ` [PATCH 2/2] notes: don't alter refs starting with 'refs/' in expand_notes_ref W. Trevor King
2012-09-05 15:49   ` [PATCH 1/2] notes get-ref: --expand expands the output notes ref Johan Herland
2012-09-06  5:23     ` Junio C Hamano
2012-09-06  6:11       ` W. Trevor King
2012-09-06 19:47         ` Junio C Hamano
2012-09-10 20:21           ` Johan Herland
2012-09-05 15:58 ` [PATCH 0/2] Add --expand to 'git notes get-ref' Johan Herland
2012-09-05 17:53   ` W. Trevor King
2012-09-05 22:44     ` Johan Herland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1346848834.git.wking@tremily.us \
    --to=wking@tremily.us \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).