# Removing all notes containing a specific string

3 messages from 2013-09-13 to 2013-09-13. Participants: Francis Moreau, Johan Herland.
Thread: https://gitlist.dev/t/34925

## Francis Moreau, 2013-09-13 06:51

Subject: Removing all notes containing a specific string
Message-ID: <CAC9WiBi4=SVF6SE0hpccPLRdv-n8hcRUg+Pa+BbRWN1YudtXjQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAC9WiBi4%3DSVF6SE0hpccPLRdv-n8hcRUg%2BPa%2BBbRWN1YudtXjQ%40mail.gmail.com

```
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

```

## Johan Herland, 2013-09-13 08:12

Subject: Re: Removing all notes containing a specific string
Message-ID: <CALKQrgfX-tEm84h8a2qcaoZuZ0U7BCe34V0HMyuvJHCX72-y=A@mail.gmail.com>
URL: https://gitlist.dev/e/CALKQrgfX-tEm84h8a2qcaoZuZ0U7BCe34V0HMyuvJHCX72-y%3DA%40mail.gmail.com
In-Reply-To: <CAC9WiBi4=SVF6SE0hpccPLRdv-n8hcRUg+Pa+BbRWN1YudtXjQ@mail.gmail.com>

```
On Fri, Sep 13, 2013 at 8:51 AM, Francis Moreau <francis.moro@gmail.com> 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, <johan@herland.net>
www.herland.net

```

## Francis Moreau, 2013-09-13 15:43

Subject: Re: Removing all notes containing a specific string
Message-ID: <CAC9WiBj0SEwZmqjGPpJTzStic0RJ2vLnN39mTenji4rCeyH26A@mail.gmail.com>
URL: https://gitlist.dev/e/CAC9WiBj0SEwZmqjGPpJTzStic0RJ2vLnN39mTenji4rCeyH26A%40mail.gmail.com
In-Reply-To: <CALKQrgfX-tEm84h8a2qcaoZuZ0U7BCe34V0HMyuvJHCX72-y=A@mail.gmail.com>

```
On Fri, Sep 13, 2013 at 10:12 AM, Johan Herland <johan@herland.net> wrote:
> On Fri, Sep 13, 2013 at 8:51 AM, Francis Moreau <francis.moro@gmail.com> 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
>

Looks "magic" to me but does the trick

Thanks !
-- 
Francis

```
