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

Re: the opposite of .gitignore, whitelist

From
JCJason Cooper <jason@lakedaemon.net>
Date
Oct 25, 2018, 14:38 UTC
Message-ID
<c166b421-a228-8349-0815-2ebb9dcab998@lakedaemon.net>
In-Reply-To
<xmqqh8hak2mh.fsf@gitster-ct.c.googlers.com>
Hi all,
On 10/25/18 1:37 AM, Junio C Hamano wrote:
Show 5 quoted lines
> "lhf635@163.com" <lhf635@163.com> writes:
>
>> I have a good idea, add a file to git that is the opposite of .gitignore...,
> Do negative patterns in .gitignore file help without inventing
> anything new?

I did this several years ago in an attempt to track /etc/ (minus ownership, of course) without storing secrets in the git history.  As the system grew and was maintained (read: crap added), the negative patterns grew untenable.  I quickly realized it wasn't the correct way to solve the problem.

Unfortunately, shortly after realizing this, I left that project.  So I never had the chance to develop a proper solution.  However, the concept of a '.gitonly' file was exactly was I was seeking.  So, for what it's worth, I've definitely had at least one legit usecase for this feature.

The usecases tend to center around tracking select files within the rootfs of a full-blown operating system.  Or a subset thereof.

hth,
Jason.
Previous: Junio C HamanoNext: Jeff King
Message 3 of 10 in “the opposite of .gitignore, whitelist”
  1. lhf635@163.comOct 25, 2018
  2. Junio C HamanoOct 25, 2018
  3. Jason CooperOct 25, 2018
  4. Jeff KingOct 26, 2018
  5. Mischa POSLAWSKYOct 26, 2018
  6. Jeff KingOct 26, 2018
  7. Ævar Arnfjörð BjarmasonOct 26, 2018
  8. Rafael AscensãoOct 26, 2018
  9. Jason CooperOct 26, 2018
  10. Jason CooperOct 26, 2018

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.