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

Re: [PATCH 3/8] archive: add a failure test wrt .gitattributes misreading

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Apr 13, 2009, 13:56 UTC
Message-ID
<49E3448B.8010602@lsrfire.ath.cx>
In-Reply-To
<7vab6rkl5f.fsf@gitster.siamese.dyndns.org>
Junio C Hamano schrieb:
Show 30 quoted lines
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
> 
>> "git archive" is used to create archives from a tree (or commit), so
>> it should not consult any .gitattributes files on working directory.
>>
>> It currently does,...
> 
> ...which _might_ be actively used as a _feature_ by people; I do not think
> it is a bad idea to have a mode of operation where it solely works with
> in-tree attributes ignoring the work tree ones, and I suspect we probably
> would want to make that the default, but "so it should not" is probably a
> bit too strong.
> 
> For example, an older version may record $Id$ with keyword expansion set
> in its in-tree .gitattributes, and you later found it to be a mistake and
> have removed it in the current version.  Re-exporting an older version
> with the current code wouldn't have $Id$ expanded, but with your patch it
> will.
> 
> A stronger example would be crlf conversion, I suppose, but the same "with
> the current code we can fix it up but after this patch we can't" worry
> applies.
> 
> So perhaps you may want to resurrect the current behaviour with a new
> option --fix-attributes, whose description would be "normally the command
> takes attributes settings from the tree being exported, but .gitattributes
> files in it may record wrong attributes you may want to fix while
> exporting.  With this option, corresponding .gitattributes files in the
> work tree will override the in-tree .gitattributes" or something like
> that.

Hmm, "fix" implies that something is broken without this option, which is not necessarily the case. A purely descriptive name like --worktree-attributes fits better IMHO.

Also, the last sentence of the description may be taken to imply a mixing of attributes from work tree and exported tree is done, which is not the case with the patch from series 2 (and shouldn't be). Perhaps: "With this option, .gitattributes files are read from the work tree instead of from the exported tree."

René
Previous: Junio C HamanoNext: Nguyen Thai Ngoc Duy
Message 17 of 24 in “support "in-tree attributes" for git-archive”
  1. 0/8 support "in-tree attributes" for git-archiveNguyễn Thái Ngọc Duy, Apr 8, 2009
  2. 1/8 archive: add shortcuts for --format and --prefixNguyễn Thái Ngọc Duy, Apr 8, 2009
  3. 2/8 move prune_cache() to git libNguyễn Thái Ngọc Duy, Apr 8, 2009
  4. 3/8 archive: add a failure test wrt .gitattributes misreadingNguyễn Thái Ngọc Duy, Apr 8, 2009
  5. 4/8 archive: add tests for directory selectionNguyễn Thái Ngọc Duy, Apr 8, 2009
  6. 5/8 attr: add GIT_ATTR_INDEX "direction"Nguyễn Thái Ngọc Duy, Apr 8, 2009
  7. 6/8 archive: use index instead of parsing tree directlyNguyễn Thái Ngọc Duy, Apr 8, 2009
  8. 7/8 archive: disregard .gitattributes on working directoryNguyễn Thái Ngọc Duy, Apr 8, 2009
  9. 8/8 archive: support creating archives from indexNguyễn Thái Ngọc Duy, Apr 8, 2009
  10. René ScharfeApr 8, 2009
  11. Junio C HamanoApr 8, 2009
  12. Junio C HamanoApr 8, 2009
  13. René ScharfeApr 8, 2009
  14. René ScharfeApr 8, 2009
  15. René ScharfeApr 8, 2009
  16. Junio C HamanoApr 8, 2009
  17. René ScharfeApr 13, 2009
  18. Nguyen Thai Ngoc DuyApr 14, 2009
  19. René ScharfeApr 14, 2009
  20. Junio C HamanoApr 16, 2009
  21. René ScharfeApr 17, 2009
  22. Junio C HamanoApr 18, 2009
  23. Junio C HamanoApr 8, 2009
  24. René ScharfeApr 8, 2009

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.