git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] generate-cmdlist.sh: avoid selecting synopsis at wrong place
@ 2008-09-18 16:01 Nguyễn Thái Ngọc Duy
  2008-09-18 16:09 ` Santi Béjar
  0 siblings, 1 reply; 3+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2008-09-18 16:01 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] generate-cmdlist.sh: avoid selecting synopsis at wrong place
  2008-09-18 16:01 [PATCH] generate-cmdlist.sh: avoid selecting synopsis at wrong place Nguyễn Thái Ngọc Duy
@ 2008-09-18 16:09 ` Santi Béjar
  2008-09-18 16:20   ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 3+ messages in thread
From: Santi Béjar @ 2008-09-18 16:09 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] generate-cmdlist.sh: avoid selecting synopsis at wrong place
  2008-09-18 16:09 ` Santi Béjar
@ 2008-09-18 16:20   ` Nguyen Thai Ngoc Duy
  0 siblings, 0 replies; 3+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2008-09-18 16:20 UTC (permalink / raw)
  To: Santi Béjar; +Cc: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-18 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18 16:01 [PATCH] generate-cmdlist.sh: avoid selecting synopsis at wrong place Nguyễn Thái Ngọc Duy
2008-09-18 16:09 ` Santi Béjar
2008-09-18 16:20   ` Nguyen Thai Ngoc Duy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).