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

GitAttributes feature export-ignore works, but -export-ignore (with dash) should also work

From
MLM Lewis <picevio@gmail.com>
Date
Nov 20, 2019, 16:44 UTC
Message-ID
<01e0a4ab-d809-d968-5671-b731438c2bc4@gmail.com>

When running 'git archive', the .gitattributes file is used to determine paths that should be ignored when building the archive by using 'export-ignore'. But it would be useful to include certain sub-paths in the ignored path.

For example, say I have folders like these
     /all_useful                  # this entire sub directory is needed 
in the archive
     /mostly_unuseful             # there are many sub directories in 
here to ignore
/mostly_unuseful/needed_a    # but these specific sub directories are 
desired in the archive
/mostly_unuseful/needed_b

The git-attribute document says a dash '-' prefix should unset the attribute. It should work with 'export-ignore'

So if I want for example '/mostly_unuseful/needed_a' in my archive, I should be able to specify that in my .gitattributes file like this:

     /mostly_unuseful                  export-ignore # do not archive
/mostly_unuseful/needed_a -export-ignore # do add to archive
/mostly_unuseful/needed_b    -export-ignore # do add to archive
Thank you
Next: Jeff King
Message 1 of 6 in “GitAttributes feature export-ignore works, but -export-ignore (with dash) should also work”
  1. M LewisNov 20, 2019
  2. Jeff KingNov 21, 2019
  3. Junio C HamanoNov 21, 2019
  4. Jeff KingNov 22, 2019
  5. M LewisNov 21, 2019
  6. Jeff KingNov 22, 2019

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.