Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
love-linger opened this issue Mar 13, 2025 · 0 comments
Closed

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

love-linger opened this issue Mar 13, 2025 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@love-linger
Copy link
Collaborator

love-linger commented Mar 13, 2025

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

@love-linger love-linger pinned this issue Mar 13, 2025
@love-linger love-linger self-assigned this Mar 13, 2025
@love-linger love-linger added the documentation Improvements or additions to documentation label Mar 13, 2025
@love-linger love-linger changed the title [Q&A] About the way to deal with uncommitted changes when checkout/pull/create branch [Q&A] Please read me first or add your tips to others here Apr 29, 2025
@love-linger love-linger changed the title [Q&A] Please read me first or add your tips to others here [Q&A] Please read this first or add your tips to others here Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant