From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <junkio@cox.net>
Subject: Re: [PATCH] Quick description of possible gitattributes system
Date: Fri, 2 Mar 2007 08:56:31 +0000 [thread overview]
Message-ID: <200703020856.35246.andyparkins@gmail.com> (raw)
In-Reply-To: <7vejo8o69o.fsf@assigned-by-dhcp.cox.net>
On Friday 2007 March 02 00:09, Junio C Hamano wrote:
[deleted lots of easily-agreed-with stuff]
> I would suggest making handler section _match_ the attribute
> names. By "match", what I mean is to allow something like this:
I don't see that working. If it were possible to do that why would we need
separate handlers and attributes? You're example is fine
> [handler "image/*"]
> pretty = "cmd display -"
But what about when I want to do this:
[handler "lossless-images-only"]
attribute = "image/png"
attribute = "image/gif"
pre-commit = /bin/false
To prevent the adding of all lossless image formats? I actually can't see a
time when the handler name needs referencing, so it can be anything (as long
as it's unique - perhaps). If you wanted to use/encourage the attribute
name - fine, but it shouldn't be required. However I think it's more
sensible to name the handler after what it does than what it applies to - the
applies to can change, what it does never.
The handlers are like function calls. You wouldn't want to name functions
after where they were called.
> > +[handler "show-images"]
> > + attribute = image/gif
> > + prettyfilter = pipe display -
>
> I would recommend against calling them *filter. After all, the
> semantics of each handler action (such as input, output and
> pretty) already determine if it needs to act as a filter or data
> sink. We do not need to say prettyfilter either; it is not even
> a filter to begin with -- it is a data sink.
That's true; I don't have any strong feelings. I just didn't like "convert"
being used. Convert always sounds like something that takes one thing and
makes another out of it - at the end you have two things. Filters transform
one thing into another - at the end you have one thing.
Perhaps better names would be simply to name them after the operation the runs
them.
infilter = checkin
outfilter = checkout
prettyfilter = show
?
Is the document useful; would you like me to maintain it? I don't want to
waste your time with it.
Andy
--
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
next prev parent reply other threads:[~2007-03-02 12:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-01 12:06 [PATCH] Quick description of possible gitattributes system Andy Parkins
2007-03-01 16:06 ` Brian Gernhardt
2007-03-02 12:00 ` Andy Parkins
2007-03-02 18:05 ` Brian Gernhardt
2007-03-02 19:35 ` Andy Parkins
2007-03-02 20:35 ` Brian Gernhardt
2007-03-01 18:01 ` Robin Rosenberg
2007-03-02 0:09 ` Junio C Hamano
2007-03-02 4:46 ` Junio C Hamano
2007-03-02 8:58 ` Andy Parkins
2007-03-02 8:56 ` Andy Parkins [this message]
2007-03-02 13:56 ` Jakub Narebski
2007-03-02 16:58 ` Linus Torvalds
2007-03-02 19:37 ` Andy Parkins
2007-03-02 21:02 ` Linus Torvalds
2007-03-02 21:45 ` Johannes Schindelin
2007-03-02 22:21 ` Andy Parkins
2007-03-02 22:24 ` Andy Parkins
2007-03-03 13:11 ` Junio C Hamano
2007-03-03 20:27 ` Jakub Narebski
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=200703020856.35246.andyparkins@gmail.com \
--to=andyparkins@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).