git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Yubin Ruan <ablacktshirt@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC] Add warning when git discard changes on another branch?
Date: Mon, 08 May 2017 13:19:58 +0900	[thread overview]
Message-ID: <xmqqlgq89dzl.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <xmqqvapc9fsg.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Mon, 08 May 2017 12:41:03 +0900")

Junio C Hamano <gitster@pobox.com> writes:

> But to help "some users are not aware of this" situation, an opt-in
> "feature" would not help all that much.  The same number of lines in
> the documentation to tell end-users how to toggle on such a "safety"
> feature can be spent to teach them that their local changes in the
> working tree do *not* belong to any particular branch, and as soon
> as it is understood, the user would be OK.
>
> So...

It might help if we treat this similarly to how we treat the
"detached HEAD" state.  By default when you do "git checkout HEAD^0"
(not "git checkout --detach HEAD"), you would get a large warning,
which you can silence by the advice.detachedhead configuration.  In
addition to the list of "these paths have local modifications" that
we show as a reminder, perhaps you want to show a warning that tells
the user that the local modifications in these paths are not
recorded anywhere else, or somesuch, and silence it with a new
advice.* variable?

  reply	other threads:[~2017-05-08  4:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-07 23:35 [RFC] Add warning when git discard changes on another branch? Yubin Ruan
2017-05-08  3:05 ` Junio C Hamano
2017-05-08 11:18   ` Yubin Ruan
2017-05-08  3:41     ` Junio C Hamano
2017-05-08  4:19       ` Junio C Hamano [this message]
2017-05-08 12:27         ` Yubin Ruan
2017-05-08  6:07           ` Junio C Hamano
2017-05-08 14:10             ` Yubin Ruan
2017-05-08 12:01       ` Yubin Ruan

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqlgq89dzl.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=ablacktshirt@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).