Re: [PATCH 07/18] builtin/notes.c: Split notes ref DWIMmery into a separate function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johan Herland wrote:

> --- a/builtin/notes.c
> +++ b/builtin/notes.c
> @@ -83,6 +83,16 @@ struct msg_arg {
>  	struct strbuf buf;
>  };
>  
> +static void expand_notes_ref(struct strbuf *sb)
> +{
> +	if (!prefixcmp(sb->buf, "refs/notes/"))
> +		return; /* we're happy */
> +	else if (!prefixcmp(sb->buf, "notes/"))
> +		strbuf_insert(sb, 0, "refs/", 5);
> +	else
> +		strbuf_insert(sb, 0, "refs/notes/", 11);
> +}

Aside: I'm not sure this is the most convenient rule to use after all.

Example:

 $ git log --notes-ref=charon/notes/full
 fatal: unrecognized argument: --notes-ref=charon/notes/full
 $ git log --show-notes=charon/notes/full
 warning: notes ref refs/notes/charon/notes/full is invalid
...
 $ git log --show-notes=remotes/charon/notes/full
 warning: notes ref refs/notes/remotes/charon/notes/full is invalid
...
 $ git log --show-notes=refs/remotes/charon/notes/full -1
 commit 16461e8e5fc5b2dbe9176b9a8313c395e1e07304
 Merge: c3e5a06 79bd09f
 Author: Junio C Hamano <gitster@xxxxxxxxx>
 Date:   Thu Sep 30 16:02:27 2010 -0700
 
     Merge branch 'il/remote-fd-ext' into pu
     
     * il/remote-fd-ext:
       fixup! git-remote-fd
 
 Notes (remotes/charon/notes/full):
     Pu-Overview:
         What's cooking in git.git (Sep 2010, #07; Wed, 29)
 $

And now that I think of it, the revision args parser uses its own code
for this...

Regardless, this patch is a step in the right direction imho.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]