From: Jeff King <peff@peff.net>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH/WIP] attr: make attributes depend on file type
Date: Mon, 28 Feb 2011 12:30:37 -0500 [thread overview]
Message-ID: <20110228173037.GC24915@sigill.intra.peff.net> (raw)
In-Reply-To: <f35b1b4b57a563f57f169602440b3b0abdef5a07.1298906628.git.git@drmicha.warpmail.net>
On Mon, Feb 28, 2011 at 04:26:18PM +0100, Michael J Gruber wrote:
> This is a whether balloon patch (to check whether this balloons or not,
> uhm). Hit it hard, not me ;)
Ouch.
> It's part of the way to revive the old idea of making attributes depend
> on file type. I am not following the old path
>
> pattern is_symlink otherattr
>
> because that would mean something which looks like an attribute
> (is_symlink) but is not. Instead,
>
> symlink:pattern attrs
>
> is to specify attrs for pattern if it is a symlink. So, e.g.,
This is way better than what I proposed. From the user's perspective, it
is visually clearer that the symlink bit is part of the selector, and
not an attribute. And it syntactically disallows nonsense like:
pattern is_symlink is_gitlink otherattr
The only downside is that it is technically a regression if somebody was
using gitattributes for the bizarrely named file "symlink:". It seems
pretty unlikely, but possibly we should be carving out a syntactic
namespace like:
^[a-z]+:
or even:
^[a-z]+(=[^:]*)?:
And that would later allow stuff like "submodule:" if people wanted to
attach specific bits to submodules (though perhaps it is not necessary,
because we have the entire separate .gitmodules file). I don't know if
there are other non-name elements people would be interested in
selecting on. So maybe that is over-engineering.
We also need some way of quoting. Duy has a 1.8.0 proposal to handle
this. If we're going to make a syntactic change to gitattributes for
this, it should probably be related (since the quoting mechanism is the
way you would fix it if you _are_ affected), and should probably follow
the same migration mechanism (it looks like there is talk of a "#
feature: foo bar" line).
See:
http://article.gmane.org/gmane.comp.version-control.git/165970
I didn't test, but do we now assume that a pattern like "foo.*
diff=bar" will only match when foo is a regular file? I think that would
fix stuff like "*.pdf merge=pdf" when there is a symlink named
"file.pdf", which I'm pretty sure is currently broken (but did not
test).
OTOH, that is yet another behavior change if somebody had something like
"foo diff=symlink", which we would be breaking. So perhaps we will need
many "# feature" markers to make this right. :)
-Peff
next prev parent reply other threads:[~2011-02-28 17:30 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-26 13:16 git diff: add option for omitting the contents of deletes Mart Sõmermaa
2011-02-26 20:11 ` Junio C Hamano
2011-02-27 14:41 ` Michael J Gruber
2011-02-27 22:33 ` Mart Sõmermaa
2011-02-28 9:58 ` Michael J Gruber
2011-02-28 10:51 ` Mart Sõmermaa
2011-02-27 22:54 ` Junio C Hamano
2011-02-27 23:07 ` Junio C Hamano
2011-02-28 7:31 ` Michael J Gruber
2011-02-28 12:17 ` Jeff King
2011-02-28 12:23 ` Jeff King
2011-02-28 12:32 ` Michael J Gruber
2011-02-28 12:59 ` Jeff King
2011-02-28 13:05 ` Michael J Gruber
2011-02-28 21:54 ` Jeff King
2011-02-28 18:11 ` Junio C Hamano
2011-02-28 22:23 ` Jeff King
2011-02-28 23:28 ` Junio C Hamano
2011-03-01 0:11 ` Junio C Hamano
2011-03-07 20:38 ` Mart Sõmermaa
2011-03-08 7:14 ` Michael J Gruber
2011-03-08 19:49 ` Junio C Hamano
2011-03-08 21:25 ` Mart Sõmermaa
2011-03-08 21:31 ` Jeff King
2011-02-28 12:42 ` symling diff driver (Was: Re: git diff: add option for omitting the contents of deletes) Michael J Gruber
2011-02-28 13:08 ` Jeff King
2011-02-28 15:26 ` [PATCH/WIP] attr: make attributes depend on file type Michael J Gruber
2011-02-28 17:30 ` Jeff King [this message]
2011-02-28 17:48 ` Junio C Hamano
2011-03-01 7:46 ` Michael J Gruber
2011-02-28 10:45 ` git diff: add option for omitting the contents of deletes Mart Sõmermaa
2011-02-28 16:10 ` Michael J Gruber
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=20110228173037.GC24915@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).