Re: [PATCH] notes: Use get_sha1_committish instead of read_ref in init_notes()

2015-06-17 Thread Johan Herland
On Wed, Jun 17, 2015 at 5:18 PM, Junio C Hamano wrote: > Mike Hommey writes: > > I'm tempted to make init_notes itself do the check, based on the value > > it is given for a "read_only" argument. > > Yeah, that would be one sensible way to go after making sure that > everything goes thru this int

Re: [PATCH] notes: Use get_sha1_committish instead of read_ref in init_notes()

2015-06-17 Thread Jeff King
On Wed, Jun 17, 2015 at 06:02:46PM +0900, Mike Hommey wrote: > > In a sense that is weirdly broken already: > > > > $ git log --notes=:/foo >/dev/null > > warning: notes ref refs/notes/:/foo is invalid > > > > but I wonder if we should be making expand_notes_ref a little more > > careful as

Re: [PATCH] notes: Use get_sha1_committish instead of read_ref in init_notes()

2015-06-17 Thread Junio C Hamano
Mike Hommey writes: > I'm tempted to make init_notes itself do the check, based on the value > it is given for a "read_only" argument. Yeah, that would be one sensible way to go after making sure that everything goes thru this interface. > On the other hand, some commands > do their ref resolvi

Re: [PATCH] notes: Use get_sha1_committish instead of read_ref in init_notes()

2015-06-17 Thread Mike Hommey
On Tue, Jun 16, 2015 at 08:17:03PM -0700, Junio C Hamano wrote: > Mike Hommey writes: > > > init_notes() is essentially the only point of entry to the notes API. > > It is an arbitrary restriction that all it allows as input is a strict > > ref name, when callers may want to give an arbitrary com

Re: [PATCH] notes: Use get_sha1_committish instead of read_ref in init_notes()

2015-06-17 Thread Mike Hommey
On Tue, Jun 16, 2015 at 11:22:31PM -0400, Jeff King wrote: > On Wed, Jun 17, 2015 at 10:15:31AM +0900, Mike Hommey wrote: > > > init_notes() is essentially the only point of entry to the notes API. > > It is an arbitrary restriction that all it allows as input is a strict > > ref name, when caller

Re: [PATCH] notes: Use get_sha1_committish instead of read_ref in init_notes()

2015-06-16 Thread Jeff King
On Wed, Jun 17, 2015 at 10:15:31AM +0900, Mike Hommey wrote: > init_notes() is essentially the only point of entry to the notes API. > It is an arbitrary restriction that all it allows as input is a strict > ref name, when callers may want to give an arbitrary committish. > > This has the side ef

Re: [PATCH] notes: Use get_sha1_committish instead of read_ref in init_notes()

2015-06-16 Thread Junio C Hamano
Mike Hommey writes: > init_notes() is essentially the only point of entry to the notes API. > It is an arbitrary restriction that all it allows as input is a strict > ref name, when callers may want to give an arbitrary committish. While it may be a good idea to allow reading from any note-shape

[PATCH] notes: Use get_sha1_committish instead of read_ref in init_notes()

2015-06-16 Thread Mike Hommey
init_notes() is essentially the only point of entry to the notes API. It is an arbitrary restriction that all it allows as input is a strict ref name, when callers may want to give an arbitrary committish. This has the side effect of enabling the use of committish as notes refs in commands allowin