git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
To: git@vger.kernel.org
Subject: Bug?: git archive exclude pathspec and gitattributes export-ignore
Date: Sun, 13 Aug 2017 12:53:58 +0800 (AWST)	[thread overview]
Message-ID: <alpine.DEB.2.11.1708131240360.15538@motsugo.ucc.gu.uwa.edu.au> (raw)

Hi all,

I think I have a bug in git (tested 2.11.0 on Debian 8, 2.14.1 on OS X and 
2.14.1.145.gb3622a4 on OS X).

Given a repository with an export-ignore directive for a subdirectory in 
.gitattributes, `git archive` with a pathspec that excludes a different 
subdirectory produces no output file and git exits with -1 as the return 
status.

As shown:

   > git init foo && cd foo
   Initialized empty Git repository in /Users/david/src/foo/.git/
   > mkdir a b
   > touch {a,b}/somefile
   > echo "/a export-ignore" >> .gitattributes
   > git add .
   > git commit -m "Initial commit"
   [master (root-commit) 53527a7] Initial commit
    3 files changed, 1 insertion(+)
    create mode 100644 .gitattributes
    create mode 100644 a/somefile
    create mode 100644 b/somefile
   > git archive --verbose master ':(top)' ':(exclude)b*'
   .gitattributes
   > echo $?
   255

If this is intended behaviour, is there any way of achieving the goal of 
excluding a subdirectory not listed as export-ignore? Using the exclude 
pathspec ":(exclude)b" produces an empty subdirectory b in the output, 
which I would like to avoid.

This is a reduced testcase; my goal is to end up with two archives, one 
containing directory b only, and one containing everything except for 
directory b - so I can't just add 'b export-ignore' to gitattributes.

Thanks

David Adam
zanchey@ucc.gu.uwa.edu.au

             reply	other threads:[~2017-08-13  5:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-13  4:53 David Adam [this message]
2017-08-14 16:43 ` Bug?: git archive exclude pathspec and gitattributes export-ignore René Scharfe
2017-08-15  2:39   ` David Adam
2017-08-19  5:26   ` René Scharfe
2017-08-19  5:28     ` [PATCH 1/4] t5001: add tests for export-ignore attributes and exclude pathspecs René Scharfe
2017-08-19  5:29     ` [PATCH 2/4] archive: factor out helper functions for handling attributes René Scharfe
2017-08-19  5:32     ` [PATCH 3/4] archive: don't queue excluded directories René Scharfe
2017-08-19  5:33     ` [PATCH 4/4] archive: queue directories for all types of pathspecs René Scharfe
2017-08-19 16:53       ` René Scharfe
2017-08-19 16:58         ` René Scharfe
2017-08-19 17:42           ` Junio C Hamano
2017-08-20  9:06         ` Jeff King
2017-09-12 22:43           ` René Scharfe
2017-09-13 12:53             ` Jeff King
2017-09-13 14:56               ` René Scharfe
2017-08-21 18:17         ` Stefan Beller
2017-08-19 16:58       ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.11.1708131240360.15538@motsugo.ucc.gu.uwa.edu.au \
    --to=zanchey@ucc.gu.uwa.edu.au \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).