Skip to content

[Q&A] Please read this first or add your tips to others here #1089

Closed
@love-linger

Description

@love-linger

Why Do Nothing is removed

The Do Nothing was introduced by issue #143, which pointed out that it is unnecessary to use Stash & Re-apply when there are only untracked files.

Currently, SourceGit will check this automatically. For example, before running git checkout:

var changes = new Commands.CountLocalChangesWithoutUntracked(_repo.FullPath).Result();
var needPopStash = false;
if (changes > 0)
{
if (DiscardLocalChanges)
{
SetProgressDescription("Discard local changes ...");
Commands.Discard.All(_repo.FullPath, false);
}
else
{
SetProgressDescription("Stash local changes ...");
var succ = new Commands.Stash(_repo.FullPath).Push("CHECKOUT_AUTO_STASH");
if (!succ)
{
CallUIThread(() => _repo.SetWatcherEnabled(true));
return false;
}
needPopStash = true;
}
}

Why SourceGit stops to remember the last selected handling method of uncommitted local changes

Since the situation I was worried about still occurred, I decided to roll back this feature.

  • Applying the same operation to local change each time is not the correct way.
  • Users are likely to mis-operate without noticing.
  • After local unstaged and unstashed changes are wrongly deleted, there is no way to recover them. This is a very serious matter.

See #977

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions