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

Re: [PATCH 4/4] archive: queue directories for all types of pathspecs

From
Stefan Beller <sbeller@google.com>
Date
Aug 21, 2017, 18:17 UTC
Message-ID
<CAGZ79kZm31jYZs5BXh8pwV2sLnhsy0AcQzoBWv1UZKtDFfYhkw@mail.gmail.com>
In-Reply-To
<33fa4f08-8f06-5a98-e492-3f05cc742555@web.de>
On Sat, Aug 19, 2017 at 9:53 AM, René Scharfe <l.s.r@web.de> wrote:
Show 17 quoted lines
> Am 19.08.2017 um 07:33 schrieb René Scharfe:
>> When read_tree_recursive() encounters a directory excluded by a pathspec
>> then it enters it anyway because it might contain included entries.  It
>> calls the callback function before it is able to decide if the directory
>> is actually needed.
>>
>> For that reason git archive adds directories to a queue and writes
>> entries for them only when it encounters the first child item -- but
>> only if pathspecs with wildcards are used.  Do the same for literal
>> pathspecs as well, as the reasoning above applies to them, too.  This
>> prevents git archive from writing entries for excluded directories.
>
> This breaks the test "archive empty subtree with no pathspec" in t5004 by
> omitting the empty directory from the archive.  Sorry for missing that!
>
> This is kind of a bonus patch, so please discard it for now; the first
> three are OK IMHO.

I thought so up to reading this patch. I found the naming and content of should_queue_directories not obvious at first read. This patch confused me even more for that name to be chosen. I have no alternative to propose, though.

Thanks, Stefan

Previous: René ScharfeNext: Junio C Hamano
Message 15 of 17 in “Bug?: git archive exclude pathspec and gitattributes export-ignore”
  1. David AdamAug 13, 2017
  2. René ScharfeAug 14, 2017
  3. David AdamAug 15, 2017
  4. René ScharfeAug 19, 2017
  5. 1/4 t5001: add tests for export-ignore attributes and exclude pathspecsRené Scharfe, Aug 19, 2017
  6. 2/4 archive: factor out helper functions for handling attributesRené Scharfe, Aug 19, 2017
  7. 4/4 archive: queue directories for all types of pathspecsRené Scharfe, Aug 19, 2017
  8. René ScharfeAug 19, 2017
  9. René ScharfeAug 19, 2017
  10. Junio C HamanoAug 19, 2017
  11. Jeff KingAug 20, 2017
  12. René ScharfeSep 12, 2017
  13. Jeff KingSep 13, 2017
  14. René ScharfeSep 13, 2017
  15. Stefan BellerAug 21, 2017
  16. Junio C HamanoAug 19, 2017
  17. 3/4 archive: don't queue excluded directoriesRené Scharfe, Aug 19, 2017

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.