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

git-archive ignores export-ignore

From
TJTodd A. Jacobs <nospam@codegnome.org>
Date
Jan 21, 2010, 22:13 UTC
Message-ID
<20100121221312.GB5307@penguin.codegnome.org>
Using git 1.6.4.2, the manual page prophesies that:
    Files and directories with the attribute export-ignore won't be
    added to archive files. See gitattributes(5) for details.

However, various tools seem to be unhappy about this attribute. In particular, checkout complains about invalid attributes:

    $ cat .gitattributes
    *.py export-subst
    *.html export-subst
    juniperxml.cfg export-ignore
    $ git checkout juniperxml.cfg
    export-ignore is not a valid attribute name: .gitattributes:3

It appears that git-archive doesn't seem to respect the attribute either. Consider the following example:

    cd /tmp
    mkdir foo
    cd foo
    git init
    touch foo.sh
    echo '*sh' > .gitattributes
    git add foo.sh
    git add .gitattributes
    git commit -m test
    git archive HEAD
    pax_global_header00006660000000000000000000000064113261226070014512gustar00rootroot0000000000000052 comment=202d78e6a44c7f10bee2ad96a3b2adc80fc33468
    .gitattributes000066400000000000000000000000041132612260700137430ustar00rootroot00000000000000*sh
    foo.sh000066400000000000000000000000001132612260700121630ustar00rootroot00000000000000

In addition to whatever bugs there might be in reading and applying the attributes correctly, it would seem that the man page could be a bit clearer on how and where to apply the attributes.

Assuming PEBKAC for the moment, how can I get the behavior I'm expecting?

-- 
"Oh, look: rocks!"
	-- Doctor Who, "Destiny of the Daleks"
Next: Junio C Hamano
Message 1 of 3 in “git-archive ignores export-ignore”
  1. Todd A. JacobsJan 21, 2010
  2. Junio C HamanoJan 22, 2010
  3. Todd A. JacobsJan 22, 2010

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.