Re: [RFC] Add warning when git discard changes on another branch?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> 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?



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]