git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jan Larres <jan@majutsushi.net>, git@vger.kernel.org
Subject: Re: check-attr doesn't respect recursive definitions
Date: Tue, 2 Apr 2013 12:51:28 -0400	[thread overview]
Message-ID: <20130402165128.GA19712@sigill.intra.peff.net> (raw)
In-Reply-To: <7vhajog9xp.fsf@alter.siamese.dyndns.org>

On Tue, Apr 02, 2013 at 09:43:30AM -0700, Junio C Hamano wrote:

> > In some systems, yes, but git does not have any notion of "doc/" as an
> > item (after all, we track content in files, not directories), so I do
> > not see what it means to specify a directory except to say "everything
> > under it has this property".
> 
> That was true back when gitattributes (and ignore) was defined to
> apply only to the paths we track.  But export-ignore abuses the
> attrtibute system, allows a directory to be specified in the match
> pattern, and we declared that is a kosher use by the patch that
> caused 1.8.1.X regression, no?  So "Git does not have any notion of
> "doc/' as an item" is no longer true, I think.

Yes, but as I explained later, the meaning of "apply an attribute to
dir" in such cases is always equivalent to "apply attribute
recursively to dir/*". So I do not think we are violating that rule to
recursively apply all attributes.

But let's take a step back. I think Jan is trying to do a very
reasonable thing: come up with the same set of paths that git-archive
would. What's the best way to solve that? Recursive application of
attributes is one way, but is there another way we could help with
solving that?

Using:

  git ls-tree --name-only -zrt HEAD |
  git check-attr --stdin -z export-ignore

means we can find out that "foo/" is ignored. But he would have to
manually post-process the output to see that "foo/bar" is below "foo".
Not impossible, but I just wonder if git can be more helpful in figuring
this out.

-Peff

  reply	other threads:[~2013-04-02 16:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-30  9:45 check-attr doesn't respect recursive definitions Jan Larres
2013-04-02 14:31 ` Jeff King
2013-04-02 14:48   ` Jeff King
2013-04-02 16:11   ` Junio C Hamano
2013-04-02 16:30     ` Jeff King
2013-04-02 16:43       ` Junio C Hamano
2013-04-02 16:51         ` Jeff King [this message]
2013-04-02 17:15           ` Jeff King
2013-04-02 17:16           ` Junio C Hamano
2013-04-02 19:16             ` Jeff King
2013-04-03 10:05               ` Jan Larres
2013-04-05  2:09 ` Duy Nguyen
2013-04-05 12:04   ` Jan Larres

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=20130402165128.GA19712@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jan@majutsushi.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).