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

Re: [PATCH 0/2] diff: support bare repositories when reading gitattributes for diff algorithm

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 14, 2023, 20:44 UTC
Message-ID
<xmqqttynoyg4.fsf@gitster.g>
In-Reply-To
<20230314191833.qmiisyvsu2ppu4sh@pop-os>
John Cai <johncai86@gmail.com> writes:
Show 8 quoted lines
> I wasn't aware of those config options. Indeed that's a good option! My only
> concern with that is that there is already some precedence for passing a
> <tree-ish> as a source for attributes in [1], so I thought adding a command line
> option would be somewhat consistent.
>
> But I can also see the benefit of using a config value since there is also
> precedence because of mailmap.file and mailmap.blob. Not sure what others think,
> but this may be the less invasive way to go.

I actually hate these one-off variables, and I wish we didn't do mailmap.file or mailmap.blob at all. Instead we could have taught the machinery to read from $GIT_DIR/info/mailmap just like the exclude and the attribute machinery already knows to read excludea and attributes files in the directory.

As your "per filetype (determined by the attribute) diff algorithm in a bare repository" feature already depends on being able to use config (as the look-up is "attributes determines the diff filetype name, and then diff.<filetype>.algo is looked up in the config") to configure, it does not sound too bad to add the attribute info in the $GIT_DIR/info/attributes file in your bare repository (and you'd set the algorithm in $GIT_DIR/config file there), and it would just work without any new "read from HEAD" feature, I would presume?

Thanks.
Previous: John CaiNext: Jeff King
Message 13 of 15 in “diff: support bare repositories when reading gitattributes for diff algorithm”
  1. 0/2 diff: support bare repositories when reading gitattributes for diff algorithmJohn Cai via GitGitGadget, Mar 14, 2023
  2. 2/2 diff: add --attr-source to read gitattributes from a commitJohn Cai via GitGitGadget, Mar 14, 2023
  3. 1/2 diff: use HEAD for attributes when using bare repositoryJohn Cai via GitGitGadget, Mar 14, 2023
  4. Junio C HamanoMar 14, 2023
  5. Junio C HamanoMar 14, 2023
  6. John CaiMar 14, 2023
  7. Junio C HamanoMar 14, 2023
  8. John CaiMar 16, 2023
  9. Junio C HamanoMar 16, 2023
  10. John CaiMar 17, 2023
  11. Philippe BlainMar 14, 2023
  12. John CaiMar 14, 2023
  13. Junio C HamanoMar 14, 2023
  14. Jeff KingMar 16, 2023
  15. Junio C HamanoMar 16, 2023

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.