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

Re: General questions - git archive a .j2 file with keyword expansion in the header section

From
Jeff King <peff@peff.net>
Date
Aug 19, 2021, 22:28 UTC
Message-ID
<YR7a8vKrYgFJof0D@coredump.intra.peff.net>
In-Reply-To
<DF4PR8401MB0795EE7D2828A45289295D3892C09@DF4PR8401MB0795.NAMPRD84.PROD.OUTLOOK.COM>
On Thu, Aug 19, 2021 at 09:28:11PM +0000, Lin, Nathan (GSE) wrote:
Show 7 quoted lines
> Got a question on using git keyword expansion on a .j2 template file.
> Keyword expansion does not seem to work with .j2 file. Please see
> below a snippet of my attempt to archive test.cfg.j2 containing git
> keyword expansions in the header. It works if I changes the .j2 file
> extension to something else, say .yaml. I have not been able to find
> any information about issue. Can you please review and advise? Thank
> you.

Do you have .gitattributes entries that tell Git it should apply the "export-subst" attribute to any files? If so, does it cover .yaml files, but not .j2?

-Peff
Previous: Lin, Nathan (GSE)
Message 2 of 2 in “General questions - git archive a .j2 file with keyword expansion in the header section”
  1. Lin, Nathan (GSE)Aug 19, 2021
  2. Jeff KingAug 19, 2021

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.