* [U-Boot-Users] script to delete all trailing space
@ 2007-03-12 10:14 Aubrey Li
2007-03-12 11:59 ` Wolfgang Denk
2007-03-12 23:52 ` Timur Tabi
0 siblings, 2 replies; 12+ messages in thread
From: Aubrey Li @ 2007-03-12 10:14 UTC (permalink / raw)
To: u-boot
Hi all Custodians,
I'm suffering from coding style issues when I request a blackfin git
pull to the upstream u-boot. Here I wrote a simple script(attached) to
delete all the trailing space in the files. Hope it's useful for you
and feel free to re-write it.
Best Regards,
-Aubrey
------------------------------------------
#!/bin/sh
# delete all the trailing white space characters (SPACE and
# TAB) at the end of all the lines in a file
# Usage:
#|______./strip-trailing-space.sh files
#
# The script:
#
# Copyright (C) 2007 Aubrey Li, All Rights Reserved.
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
strip()
{
|_______cp $1 $1~
|_______sed -e 's/\s\+$//' < $1~ > $1
}
for i in $*
do strip $i
done
------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strip-trailing-space.sh
Type: application/x-sh
Size: 501 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20070312/a0ec47c3/attachment.sh
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-12 10:14 [U-Boot-Users] script to delete all trailing space Aubrey Li
@ 2007-03-12 11:59 ` Wolfgang Denk
2007-03-12 13:46 ` Aubrey Li
2007-03-12 23:52 ` Timur Tabi
1 sibling, 1 reply; 12+ messages in thread
From: Wolfgang Denk @ 2007-03-12 11:59 UTC (permalink / raw)
To: u-boot
In message <27d85ee10703120314i2f5601ffica5fe5a0958b7ba1@mail.gmail.com> you wrote:
>
> for i in $*
> do strip $i
> done
This will typically NOT do what you might expect.
strip - Discard symbols from object files
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Mistakes are often the stepping stones to utter failure.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-12 11:59 ` Wolfgang Denk
@ 2007-03-12 13:46 ` Aubrey Li
2007-03-12 13:51 ` Peter Pearse
0 siblings, 1 reply; 12+ messages in thread
From: Aubrey Li @ 2007-03-12 13:46 UTC (permalink / raw)
To: u-boot
On 3/12/07, Wolfgang Denk <wd@denx.de> wrote:
> In message <27d85ee10703120314i2f5601ffica5fe5a0958b7ba1@mail.gmail.com> you wrote:
> >
> > for i in $*
> > do strip $i
> > done
>
> This will typically NOT do what you might expect.
>
> strip - Discard symbols from object files
>
You are wrong. If the name of the function in the script is the same
as the external application, the function will be executed, NOT the
external application.
Best Regards,
-Aubrey
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-12 13:46 ` Aubrey Li
@ 2007-03-12 13:51 ` Peter Pearse
2007-03-12 14:06 ` Aubrey Li
0 siblings, 1 reply; 12+ messages in thread
From: Peter Pearse @ 2007-03-12 13:51 UTC (permalink / raw)
To: u-boot
>
> You are wrong. If the name of the function in the script is
> the same as the external application, the function will be
> executed, NOT the external application.
>
> Best Regards,
> -Aubrey
But it might be less confusing if the script function had a distinct and
unique name.....
e.g. ali_strip
Regards
Peter
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-12 13:51 ` Peter Pearse
@ 2007-03-12 14:06 ` Aubrey Li
2007-03-12 16:36 ` Jon Loeliger
0 siblings, 1 reply; 12+ messages in thread
From: Aubrey Li @ 2007-03-12 14:06 UTC (permalink / raw)
To: u-boot
On 3/12/07, Peter Pearse <peter.pearse@arm.com> wrote:
> >
> > You are wrong. If the name of the function in the script is
> > the same as the external application, the function will be
> > executed, NOT the external application.
> >
> > Best Regards,
> > -Aubrey
>
> But it might be less confusing if the script function had a distinct and
> unique name.....
> e.g. ali_strip
>
Sure, re-post the script.
----------------------------------------------------------------
#!/bin/sh
# delete all the trailing white space characters (SPACE and
# TAB) at the end of all the lines in a file
# Usage:
#|______./strip-trailing-space.sh files
#
# The script:
#
# Copyright (C) 2007 Aubrey Li, All Rights Reserved.
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
ali_strip()
{
|_______cp $1 $1~
|_______sed -e 's/\s\+$//' < $1~ > $1
}
for i in $*
do ali_strip $i
done
---------------------------------------------------------------------
Best Regards,
-Aubrey
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-12 14:06 ` Aubrey Li
@ 2007-03-12 16:36 ` Jon Loeliger
2007-03-12 16:52 ` Grant Likely
2007-03-13 0:51 ` Aubrey Li
0 siblings, 2 replies; 12+ messages in thread
From: Jon Loeliger @ 2007-03-12 16:36 UTC (permalink / raw)
To: u-boot
On Mon, 2007-03-12 at 09:06, Aubrey Li wrote:
> Sure, re-post the script.
Folks,
So, there are a few things git provides that might help with
some of these issues. The case of a line starting with a
space and followed by a tab can be identified, as well as
automatically stripping trailing whitespace from source lines.
You might investigate the "--check" options in "git apply"
or "git am", and you might investigate "--whitespace=strip"
as well.
HTH,
jdl
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-12 16:36 ` Jon Loeliger
@ 2007-03-12 16:52 ` Grant Likely
2007-03-13 0:51 ` Aubrey Li
1 sibling, 0 replies; 12+ messages in thread
From: Grant Likely @ 2007-03-12 16:52 UTC (permalink / raw)
To: u-boot
On 3/12/07, Jon Loeliger <jdl@freescale.com> wrote:
> You might investigate the "--check" options in "git apply"
> or "git am", and you might investigate "--whitespace=strip"
> as well.
IIRC, you can also use 'git-config apply.whitespace strip' to set this
option permanently for your local repo.
g.
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-12 10:14 [U-Boot-Users] script to delete all trailing space Aubrey Li
2007-03-12 11:59 ` Wolfgang Denk
@ 2007-03-12 23:52 ` Timur Tabi
2007-03-13 0:26 ` Aubrey Li
1 sibling, 1 reply; 12+ messages in thread
From: Timur Tabi @ 2007-03-12 23:52 UTC (permalink / raw)
To: u-boot
Aubrey Li wrote:
> Hi all Custodians,
>
> I'm suffering from coding style issues when I request a blackfin git
> pull to the upstream u-boot. Here I wrote a simple script(attached) to
> delete all the trailing space in the files. Hope it's useful for you
> and feel free to re-write it.
Why don't you just use a text editor that takes care of this problem for
you?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-12 23:52 ` Timur Tabi
@ 2007-03-13 0:26 ` Aubrey Li
2007-03-13 0:45 ` Grant Likely
0 siblings, 1 reply; 12+ messages in thread
From: Aubrey Li @ 2007-03-13 0:26 UTC (permalink / raw)
To: u-boot
On 3/13/07, Timur Tabi <timur@freescale.com> wrote:
> Aubrey Li wrote:
> > Hi all Custodians,
> >
> > I'm suffering from coding style issues when I request a blackfin git
> > pull to the upstream u-boot. Here I wrote a simple script(attached) to
> > delete all the trailing space in the files. Hope it's useful for you
> > and feel free to re-write it.
>
> Why don't you just use a text editor that takes care of this problem for
> you?
>
Because there are a bunch of files need to be formated.
-Aubrey
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-13 0:26 ` Aubrey Li
@ 2007-03-13 0:45 ` Grant Likely
2007-03-13 2:49 ` Aubrey Li
0 siblings, 1 reply; 12+ messages in thread
From: Grant Likely @ 2007-03-13 0:45 UTC (permalink / raw)
To: u-boot
On 3/12/07, Aubrey Li <aubrey.adi@gmail.com> wrote:
> On 3/13/07, Timur Tabi <timur@freescale.com> wrote:
> > Aubrey Li wrote:
> > > Hi all Custodians,
> > >
> > > I'm suffering from coding style issues when I request a blackfin git
> > > pull to the upstream u-boot. Here I wrote a simple script(attached) to
> > > delete all the trailing space in the files. Hope it's useful for you
> > > and feel free to re-write it.
> >
> > Why don't you just use a text editor that takes care of this problem for
> > you?
> >
> Because there are a bunch of files need to be formated.
BTW, there is already a script that takes care of %90 of all
whitespace issues. Look at scripts/Lindent in the Linux source tree.
The only whitespace is won't fix is whitespace in comments.
Cheers,
g.
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-12 16:36 ` Jon Loeliger
2007-03-12 16:52 ` Grant Likely
@ 2007-03-13 0:51 ` Aubrey Li
1 sibling, 0 replies; 12+ messages in thread
From: Aubrey Li @ 2007-03-13 0:51 UTC (permalink / raw)
To: u-boot
On 3/13/07, Jon Loeliger <jdl@freescale.com> wrote:
> On Mon, 2007-03-12 at 09:06, Aubrey Li wrote:
>
> > Sure, re-post the script.
>
> Folks,
>
> So, there are a few things git provides that might help with
> some of these issues. The case of a line starting with a
> space and followed by a tab can be identified, as well as
> automatically stripping trailing whitespace from source lines.
>
> You might investigate the "--check" options in "git apply"
> or "git am", and you might investigate "--whitespace=strip"
> as well.
>
Could you please add this to the u-boot wiki?
http://www.denx.de/wiki/UBoot/CustodianGitTrees
Thanks,
-Aubrey
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot-Users] script to delete all trailing space
2007-03-13 0:45 ` Grant Likely
@ 2007-03-13 2:49 ` Aubrey Li
0 siblings, 0 replies; 12+ messages in thread
From: Aubrey Li @ 2007-03-13 2:49 UTC (permalink / raw)
To: u-boot
On 3/13/07, Grant Likely <grant.likely@secretlab.ca> wrote:
>
> On 3/12/07, Aubrey Li <aubrey.adi@gmail.com> wrote:
> > On 3/13/07, Timur Tabi <timur@freescale.com> wrote:
> > > Aubrey Li wrote:
> > > > Hi all Custodians,
> > > >
> > > > I'm suffering from coding style issues when I request a blackfin git
> > > > pull to the upstream u-boot. Here I wrote a simple script(attached)
> to
> > > > delete all the trailing space in the files. Hope it's useful for you
> > > > and feel free to re-write it.
> > >
> > > Why don't you just use a text editor that takes care of this problem
> for
> > > you?
> > >
> > Because there are a bunch of files need to be formated.
>
> BTW, there is already a script that takes care of %90 of all
> whitespace issues. Look at scripts/Lindent in the Linux source tree.
Lindent can't deal with assemble file. And 90% is far away from enough. The
patch should match the u-boot coding style requirements 100%.
-Aubrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070313/ce80ea99/attachment.htm
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2007-03-13 2:49 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-12 10:14 [U-Boot-Users] script to delete all trailing space Aubrey Li
2007-03-12 11:59 ` Wolfgang Denk
2007-03-12 13:46 ` Aubrey Li
2007-03-12 13:51 ` Peter Pearse
2007-03-12 14:06 ` Aubrey Li
2007-03-12 16:36 ` Jon Loeliger
2007-03-12 16:52 ` Grant Likely
2007-03-13 0:51 ` Aubrey Li
2007-03-12 23:52 ` Timur Tabi
2007-03-13 0:26 ` Aubrey Li
2007-03-13 0:45 ` Grant Likely
2007-03-13 2:49 ` Aubrey Li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.