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

2017-05-07 Thread Yubin Ruan
On Mon, May 08, 2017 at 03:07:02PM +0900, Junio C Hamano wrote: > Yubin Ruan writes: > > > That would be helpful. But, frankly, if a user would be aware of that > > `advice.*' > > variable, he would have enough knowledge of Git to be aware of that > > situation. > > So, I think that 'M lala.txt

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

2017-05-07 Thread Junio C Hamano
Yubin Ruan writes: > That would be helpful. But, frankly, if a user would be aware of that > `advice.*' > variable, he would have enough knowledge of Git to be aware of that situation. > So, I think that 'M lala.txt' in transitions from branch to branch would be > sufficient. Ah, you got the ad

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

2017-05-07 Thread Yubin Ruan
On Mon, May 08, 2017 at 01:19:58PM +0900, Junio C Hamano wrote: > Junio C Hamano 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

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

2017-05-07 Thread Junio C Hamano
Junio C Hamano 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

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

2017-05-07 Thread Yubin Ruan
On Mon, May 08, 2017 at 12:41:03PM +0900, Junio C Hamano wrote: > Yubin Ruan writes: > > > I understand this. I just suggest that git add some warning in case some > > users > > are not aware of this, as it does when , on branch 'issue', changes to > > 'lala.txt' > > are based on a commit diffe

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

2017-05-07 Thread Junio C Hamano
Yubin Ruan writes: > I understand this. I just suggest that git add some warning in case some users > are not aware of this, as it does when , on branch 'issue', changes to > 'lala.txt' > are based on a commit different from where the checkout happened, i.e. > > on branch 'master' >

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

2017-05-07 Thread Yubin Ruan
On Mon, May 08, 2017 at 12:05:31PM +0900, Junio C Hamano wrote: > Yubin Ruan writes: > > > I think it would be better if git can warn use if we switch to another > > branch > > without committing the modification. Git will warn if the modification is > > based > > on a commit different from whe

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

2017-05-07 Thread Junio C Hamano
Yubin Ruan writes: > I think it would be better if git can warn use if we switch to another branch > without committing the modification. Git will warn if the modification is > based > on a commit different from where the checkout happened. > > For example, say I am now on branch 'master' and al

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

2017-05-07 Thread Yubin Ruan
Hi, I think it would be better if git can warn use if we switch to another branch without committing the modification. Git will warn if the modification is based on a commit different from where the checkout happened. For example, say I am now on branch 'master' and all files *clean*. Now if I do: