From: Junio C Hamano <gitster@pobox•com>
To: David Aguilar <davvid@gmail•com>
Cc: git@vger•kernel.org, "Jeff King" <peff@peff•net>,
"Jonathan Nieder" <jrnieder@gmail•com>,
"René Scharfe" <l.s.r@web•de>,
"Matthieu Moy" <Matthieu.Moy@grenoble-inp•fr>
Subject: Re: [PATCH 1/2] check-headers: add header usage checks for .c files
Date: Mon, 15 Sep 2014 12:14:43 -0700 [thread overview]
Message-ID: <xmqqr3zc66ho.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1410680445-84593-1-git-send-email-davvid@gmail.com> (David Aguilar's message of "Sun, 14 Sep 2014 00:40:44 -0700")
David Aguilar <davvid@gmail•com> 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
q
}' "$1"
next prev parent reply other threads:[~2014-09-15 19:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-14 7:40 [PATCH 1/2] check-headers: add header usage checks for .c files David Aguilar
2014-09-14 7:40 ` [PATCH 2/2] cleanups: ensure that git-compat-util.h is included first David Aguilar
2014-09-15 19:14 ` Junio C Hamano [this message]
2014-09-15 19:16 ` [PATCH 1/2] check-headers: add header usage checks for .c files Junio C Hamano
2014-09-15 19:19 ` Junio C Hamano
2014-09-15 19:49 ` David Aguilar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqr3zc66ho.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=Matthieu.Moy@grenoble-inp$(echo .)fr \
--cc=davvid@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=jrnieder@gmail$(echo .)com \
--cc=l.s.r@web$(echo .)de \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox