# [PATCH] generate-cmdlist.sh: avoid selecting synopsis at wrong place

3 messages from 2008-09-18 to 2008-09-18. Participants: Nguyễn Thái Ngọc Duy, Santi Béjar, Nguyen Thai Ngoc Duy.
Thread: https://gitlist.dev/t/15576

## Nguyễn Thái Ngọc Duy, 2008-09-18 16:01

Subject: [PATCH] generate-cmdlist.sh: avoid selecting synopsis at wrong place
Message-ID: <1221753703-3331-1-git-send-email-pclouds@gmail.com>
URL: https://gitlist.dev/e/1221753703-3331-1-git-send-email-pclouds%40gmail.com

```
In "common" man pages there is luckily no "NAME" anywhere except at
beginning of documents. If there is another "NAME", sed could
mis-select it and lead to common-cmds.h corruption. So better nail it
at beginning of line, which would reduce corruption chance.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 generate-cmdlist.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index a2913c2..75c68d9 100755
--- a/generate-cmdlist.sh
+++ b/generate-cmdlist.sh
@@ -14,7 +14,7 @@ sort |
 while read cmd
 do
      sed -n '
-     /NAME/,/git-'"$cmd"'/H
+     /^NAME/,/git-'"$cmd"'/H
      ${
             x
             s/.*git-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
-- 
1.6.0.96.g2fad1.dirty

```

## Santi Béjar, 2008-09-18 16:09

Subject: Re: [PATCH] generate-cmdlist.sh: avoid selecting synopsis at wrong place
Message-ID: <adf1fd3d0809180909o2043ae36vda7ae2370f900169@mail.gmail.com>
URL: https://gitlist.dev/e/adf1fd3d0809180909o2043ae36vda7ae2370f900169%40mail.gmail.com
In-Reply-To: <1221753703-3331-1-git-send-email-pclouds@gmail.com>

```
On Thu, Sep 18, 2008 at 6:01 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
> In "common" man pages there is luckily no "NAME" anywhere except at
> beginning of documents. If there is another "NAME", sed could
> mis-select it and lead to common-cmds.h corruption. So better nail it
> at beginning of line, which would reduce corruption chance.
>

You could narrow it even more with /^NAME$/

Santi

```

## Nguyen Thai Ngoc Duy, 2008-09-18 16:20

Subject: Re: [PATCH] generate-cmdlist.sh: avoid selecting synopsis at wrong place
Message-ID: <fcaeb9bf0809180920v33af3910h7ce56aec1db09a54@mail.gmail.com>
URL: https://gitlist.dev/e/fcaeb9bf0809180920v33af3910h7ce56aec1db09a54%40mail.gmail.com
In-Reply-To: <adf1fd3d0809180909o2043ae36vda7ae2370f900169@mail.gmail.com>

```
On 9/18/08, Santi Béjar <santi@agolina.net> wrote:
> On Thu, Sep 18, 2008 at 6:01 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
>  > In "common" man pages there is luckily no "NAME" anywhere except at
>  > beginning of documents. If there is another "NAME", sed could
>  > mis-select it and lead to common-cmds.h corruption. So better nail it
>  > at beginning of line, which would reduce corruption chance.
>  >
>
>
> You could narrow it even more with /^NAME$/

That may miss "^NAME $", which is hard to recognize by eyes, although
I'm pretty sure there is no trailing spaces in git. It's up to Junio
to decide how strict he wants.
-- 
Duy

```
