On Mon, Sep 15, 2014 at 12:19:06PM -0700, Junio C Hamano wrote:
> Junio C Hamano writes:
>
> > David Aguilar writes:
> >
> >> Teach check-header.sh to ensure that the first included header in .c
> >> files is either git-compat-util.h, builtin.h, or cache.h.
> >>
> >> Ensure that common-cmds.h is
Junio C Hamano writes:
> David Aguilar writes:
>
>> Teach check-header.sh to ensure that the first included header in .c
>> files is either git-compat-util.h, builtin.h, or cache.h.
>>
>> Ensure that common-cmds.h is only included by help.c.
>>
>> Move the logic into functions so that we can ski
David Aguilar writes:
> Teach check-header.sh to ensure that the first included header in .c
> files is either git-compat-util.h, builtin.h, or cache.h.
>
> Ensure that common-cmds.h is only included by help.c.
>
> Move the logic into functions so that we can skip parts of the check.
>
> Signed-o
David Aguilar writes:
> +check_header_usage () {
> + first=$(grep '^#include' "$1" |
> + head -n1 |
> + sed -e 's,#include ",,' -e 's,"$,,')
perhaps a single "sed" invocation suffices?
sed -n -e '/^#include/{
s/#include ["<]\(.*\)".*/\1/p
Teach check-header.sh to ensure that the first included header in .c
files is either git-compat-util.h, builtin.h, or cache.h.
Ensure that common-cmds.h is only included by help.c.
Move the logic into functions so that we can skip parts of the check.
Signed-off-by: David Aguilar
---
This depend
5 matches
Mail list logo