Re: [PATCH 2/2 v2] check-attr: Add --stdin-paths option
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Oct 8, 2008, 15:24 UTC
- Message-ID
- <20081008152443.GA4795@spearce.org>
- In-Reply-To
- <20081007001652.GR21650@dpotapov.dyndns.org>
Dmitry Potapov <dpotapov@gmail.com> wrote:
> This allows multiple paths to be specified on stdin.
Show 9 quoted lines
> diff --git a/Documentation/git-check-attr.txt b/Documentation/git-check-attr.txt > index 2b821f2..0839a57 100644 > --- a/Documentation/git-check-attr.txt > +++ b/Documentation/git-check-attr.txt > @@ -9,6 +9,7 @@ git-check-attr - Display gitattributes information. > SYNOPSIS > -------- > 'git check-attr' attr... [--] pathname... > +'git check-attr' --stdin-paths attr... < <list-of-paths
I wonder if the option should just be "--stdin". And since its being used mostly by automated tools (gitk/git-gui) I wonder if a -z should also be supported for input termination with NUL instead of LF.
Show 9 quoted lines
> diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh > index 3d8e06a..f6901b4 100755 > --- a/t/t0003-attributes.sh > +++ b/t/t0003-attributes.sh > @@ -47,6 +47,23 @@ test_expect_success 'attribute test' ' > > ' > > +test_expect_success 'attribute test: read paths from stdin' '
A test case for the quoting might also be good.
Show 14 quoted lines
> + > + cat <<EOF > expect > +f: test: f > +a/f: test: f > +a/c/f: test: f > +a/g: test: a/g > +a/b/g: test: a/b/g > +b/g: test: unspecified > +a/b/h: test: a/b/h > +a/b/d/g: test: a/b/d/* > +EOF > + > + sed -e "s/:.*//" < expect | git check-attr --stdin-paths test > actual && > + test_cmp expect actual
-- Shawn.