Removing all notes containing a specific string

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

Removing all notes containing a specific string

From: Francis Moreau <hidden>
Date: 2016-06-15 22:58:45

Hello,

I'd like to know if that's possible to parse all notes to detect a
special string and if it's the case, remove the note like "git-notes
remove" would do.

Thanks
-- 
Francis

Re: Removing all notes containing a specific string

From: Johan Herland <hidden>
Date: 2016-06-15 22:58:45

On Fri, Sep 13, 2013 at 8:51 AM, Francis Moreau [off-list ref] wrote:
Hello,

I'd like to know if that's possible to parse all notes to detect a
special string and if it's the case, remove the note like "git-notes
remove" would do.
Hi,

There's no built-in command/option to do this, but the following shell
one-liner should do the job:

  git grep -l $mystring refs/notes/commits | cut -d':' -f2 | tr -d '/'
| xargs git notes remove


...Johan

-- 
Johan Herland, [off-list ref]
www.herland.net

Re: Removing all notes containing a specific string

From: Francis Moreau <hidden>
Date: 2016-06-15 22:58:45

On Fri, Sep 13, 2013 at 10:12 AM, Johan Herland [off-list ref] wrote:
On Fri, Sep 13, 2013 at 8:51 AM, Francis Moreau [off-list ref] wrote:
quoted
Hello,

I'd like to know if that's possible to parse all notes to detect a
special string and if it's the case, remove the note like "git-notes
remove" would do.
Hi,

There's no built-in command/option to do this, but the following shell
one-liner should do the job:

  git grep -l $mystring refs/notes/commits | cut -d':' -f2 | tr -d '/'
| xargs git notes remove
Looks "magic" to me but does the trick

Thanks !
-- 
Francis
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help