git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jade Lovelace <lists@jade.fyi>
To: git@vger.kernel.org
Cc: sebastian.thiel@icloud.com, newren@gmail.com, josh@joshtriplett.org
Subject: Precious files and the .jj directory
Date: Tue, 22 Jul 2025 00:31:11 -0700	[thread overview]
Message-ID: <CAFA9we_yDs9SPL2pJU_WiUz8CqvQ8ZPHwXBfTzHHbt-QGV34qA@mail.gmail.com> (raw)

I'm aware of the many discussions about precious files [1] [2] [3],
but I wanted to highlight a particularly pernicious category of
precious files that are really hard to do the right thing about with
Git: namely, other version control systems. In particular, as I
learned in [4], `git clean -ixd` will of course list `.jj` to delete
and delete it if you have it in gitignore. But yet having it untracked
results in it possibly accidentally getting added and also clutters up
`git status`.

It's my understanding that git has more file deletion edge cases of
gitignored files than of untracked ones so the latter is theoretically
safer. Is that correct?

[1]: https://lore.kernel.org/git/pull.1627.git.1703643931314.gitgitgadget@gmail.com/
[2]: https://lore.kernel.org/git/871s7r4wuv.fsf@evledraar.gmail.com/
[3]: https://lore.kernel.org/git/7v4oepaup7.fsf@alter.siamese.dyndns.org/
[4]: https://maddie.wtf/posts/2025-07-21-jujutsu-for-busy-devs

The part about these that is especially pernicious is that git does
the right thing to `.git`, there are not that many of *these*
particular file patterns, and they generally merit the same treatment
as .git as deleting them results in somewhere between frustrating and
catastrophic loss of work. The one other example of one I've seen
other than .jj is .sl, though that's only colocated with git if you
are up to serious shimming shenanigans with broken tools (nix flakes
etc) as AFAIK it is not supposed to be used colocated normally.

Should these be special cased somehow? Should they be simply caught by
the precious-files work when it eventually gets done?

Regards,
Jade

             reply	other threads:[~2025-07-22  7:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22  7:31 Jade Lovelace [this message]
2025-07-22 15:19 ` Precious files and the .jj directory Elijah Newren
2025-07-24 23:10   ` Martin von Zweigbergk
2025-07-22 17:09 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFA9we_yDs9SPL2pJU_WiUz8CqvQ8ZPHwXBfTzHHbt-QGV34qA@mail.gmail.com \
    --to=lists@jade.fyi \
    --cc=git@vger.kernel.org \
    --cc=josh@joshtriplett.org \
    --cc=newren@gmail.com \
    --cc=sebastian.thiel@icloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).