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

Re: Is there a way to have a local version of a header file?

From
Jakub Narębski <jnareb@gmail.com>
Date
Mar 18, 2017, 18:21 UTC
Message-ID
<35e8ef4e-9a72-28e5-6797-99ad639de591@gmail.com>
In-Reply-To
<CACBZZX7G=C84kz4n26VTnWWUTKRv1rVvms=8AvELtMSCviu1kQ@mail.gmail.com>
W dniu 18.03.2017 o 18:08, Ævar Arnfjörð Bjarmason pisze:
> There might be some way I haven't thought of, in particular maybe you
> can use gitattributes to define a custom diff/merge driver that always
> reports no changes, or some ways to (ab)use the index to make git
> ignore any changes to the file.

There is `git update-index --skip-worktree` (originally meant for sparse checkout), which you can use to kind of ignore changes to tracked file, in a safe way (though sometimes annoying, when it prevents stashing changes).

There is also an existing solution of a hook that prevents commiting files with passwords in them; I forgot the name...

HTH,
-- 
Jakub Narębski
Previous: David Lang
Message 11 of 11 in “Is there a way to have a local version of a header file?”
  1. David LangMar 18, 2017
  2. Ævar Arnfjörð BjarmasonMar 18, 2017
  3. David LangMar 18, 2017
  4. Ævar Arnfjörð BjarmasonMar 18, 2017
  5. Junio C HamanoMar 18, 2017
  6. David LangMar 18, 2017
  7. Junio C HamanoMar 18, 2017
  8. Samuel LijinMar 18, 2017
  9. Johannes SixtMar 19, 2017
  10. David LangMar 19, 2017
  11. Jakub NarębskiMar 18, 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.