git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Daniele Segato <daniele.bilug@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: ignored file can be deleted silently
Date: Thu, 05 May 2011 09:49:23 -0700	[thread overview]
Message-ID: <7viptp9jos.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <BANLkTi=C4pO83mT3pO0B_AMaK3RMOC4V8g@mail.gmail.com> (Nguyen Thai Ngoc Duy's message of "Thu, 5 May 2011 21:18:15 +0700")

Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

> This is on purpose. Commit f8a9d42 (read-tree: further loosen "working
> file will be lost" check. - 2006-12-04) allowed ignored files to be
> overwritten. Perhaps we can have a config to tighten the check again?

No.  The real issue is that we have only two classes of paths.  Either
ignored or unignored.

If we see an unignored path not yet tracked, we notice and suggest "that
file might be something valuable and you may forgot to add" in "status"
output.  In that sense, "unignored" is a synonym of "worth keeping".

Most of the time, "ignored" is also the same as "can be safely discarded"
(think: *.o files that can be recreated).  If you do not allow them to be
discarded, switching from a branch that has "builtin/hello.c" and leaves
an ignored compilation artifact "builtin/hello.o" to another branch that
did not have "builtin/" directory (probably it is "builtin-hello.c" on
that branch), or even worse, a plain text file "builtin", would stop and
get you into a horrible habit of constantly saying "checkout -f".  Even
though there may be cases where there are some files that are not tracked,
that you may not want to add, but you may still want to keep, because we
have only two ignored/unignored classes, that is how we have done things.

If you really want to fix this to everybody's satisfaction, you need to
introduce the third class, ignored-but-precious (IIRC, tla had such a
concept), and treat them as "not worth nagging about potentially forgotten
as an add target" but still "not automatically nukeable".

  reply	other threads:[~2011-05-05 16:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05  8:40 ignored file can be deleted silently Daniele Segato
2011-05-05 14:18 ` Nguyen Thai Ngoc Duy
2011-05-05 16:49   ` Junio C Hamano [this message]
2011-05-05 19:51     ` Daniele Segato

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=7viptp9jos.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=daniele.bilug@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.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).