git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: check-attr doesn't respect recursive definitions

From
Jeff King <peff@peff.net>
Date
Apr 2, 2013, 16:51 UTC
Message-ID
<20130402165128.GA19712@sigill.intra.peff.net>
In-Reply-To
<7vhajog9xp.fsf@alter.siamese.dyndns.org>
On Tue, Apr 02, 2013 at 09:43:30AM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> > 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
Previous: Junio C HamanoNext: Jeff King
Message 7 of 13 in “check-attr doesn't respect recursive definitions”
  1. Jan LarresMar 30, 2013
  2. Jeff KingApr 2, 2013
  3. Jeff KingApr 2, 2013
  4. Junio C HamanoApr 2, 2013
  5. Jeff KingApr 2, 2013
  6. Junio C HamanoApr 2, 2013
  7. Jeff KingApr 2, 2013
  8. Jeff KingApr 2, 2013
  9. Junio C HamanoApr 2, 2013
  10. Jeff KingApr 2, 2013
  11. Jan LarresApr 3, 2013
  12. Duy NguyenApr 5, 2013
  13. Jan LarresApr 5, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.