8000 [FEATURE] Remember selected options for checkout, create branch and pull actions · Issue #185 · sourcegit-scm/sourcegit · GitHub
[go: up one dir, main page]

Skip to content

[FEATURE] Remember selected options for checkout, create branch and pull actions #185

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
EreMaijala opened this issue Jun 18, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@EreMaijala
Copy link
Contributor

It would be nice if SourceGit would remember the chosen way to deal with local changes if it's "Stash & Reapply" or "Do Nothing" (I almost exclusively use "Do Nothing", and it requires an extra click). "Discard" is destructive, so I would not let it remember that one.
It would also be nice if it would remember the state of "Use rebase instead of merge".

@love-linger love-linger self-assigned this Jun 19, 2024
@love-linger love-linger added the suggestion We are still considering whether it is necessary to add this feature label Jun 19, 2024
@love-linger
Copy link
Collaborator

My idea for these options is to provide only the most conservative default values, rather than keeping the most recent selection status. Because it may lead to completely different results.

Here is an example: For the Force push option in the push operation, once enabled, forgetting to cancel on the next time will cause an unexpected disaster.

The same goes for Local Changes options. By providing secure default values, we can ensure that users do not lose data if they forget to select at least.

@EreMaijala
Copy link
Contributor Author

@love-linger I appreciate that, but "Do nothing" isn't unsafe. It will just fail if there are local changes that prevent the operation, right?

My problem with "Stash & Reapply" is that it stages untracked files and then I have to remember to unstage them. I'd go as far as to say that it could be more unsafe than "Do nothing" since it could lead you to commit files that you were not supposed to commit. And it's not always practical to add everything to .gitignore.

@love-linger
Copy link
Collaborator

@love-linger I appreciate that, but "Do nothing" isn't unsafe. It will just fail if there are local changes that prevent the operation, right?

My problem with "Stash & Reapply" is that it stages untracked files and then I have to remember to unstage them. I'd go as far as to say that it could be more unsafe than "Do nothing" since it could lead you to commit files that you were not supposed to commit. And it's not always practical to add everything to .gitignore.

I'd like to change to default action that deal with local changes to Do Nothing

@love-linger love-linger added enhancement New feature or request and removed suggestion We are still considering whether it is necessary to add this feature labels Jun 19, 2024
love-linger added a commit that referenced this issue Jun 19, 2024
…/checkout/create new branch to `Do Nothing` (#185)
@EreMaijala
Copy link
Contributor Author

That'd work for me!

love-linger added a commit that referenced this issue Jun 19, 2024
@love-linger
Copy link
Collaborator

The implementation for these two features has been pushed to branch develop. You can test it from this build https://github.com/sourcegit-scm/sourcegit/actions/runs/9578049402

@EreMaijala
Copy link
Contributor Author

@love-linger Thanks, works beautifully!

@love-linger
Copy link
Collaborator
6215

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants
0