sourcegit-scm / sourcegit

Windows/macOS/Linux GUI client for GIT users
MIT License
1.4k stars 140 forks source link

[Enhancement] Optimize fetch `prune` behavior #590

Closed gadfly3173 closed 4 weeks ago

gadfly3173 commented 4 weeks ago

Current behavior of Fetch operation:

After I delete a branch at remote, Pull will never remove the deleted remote branch. I need to click Fetch popup or wait for AutoFetch again. I suggest to unify the prune settings and behavior in SourceGit.

love-linger commented 4 weeks ago

There are two ways to do this:

  1. Removes all --prune parameter from git fetch command. And users can only do this job from the context menu of remote: image

  2. Unify all fetch-related features:

    • Fetch will keep current design
    • Auto-Fetch should not using --prune because it is not controlled by user. For example, if a remote branch is deleted by accident, we can still re-push it from our local repository.
    • Add Remote should not using --prune since it is a new remote
    • Add a toggle to Push popup that controls whether the --prune parameter is enabled

Currently, I prefer the first solution

love-linger commented 4 weeks ago

Done.

gadfly3173 commented 4 weeks ago

LGTM

Gama11 commented 3 weeks ago

Hm, I'm not a fan of needing to perform one additional manual action every time I want to get rid of old merged pull request branches. :/

gadfly3173 commented 3 weeks ago

Hm, I'm not a fan of needing to perform one additional manual action every time I want to get rid of old merged pull request branches.

You can do that through git itself.

Gama11 commented 2 weeks ago

Thanks, that's good to know! :+1:

gadfly3173 commented 2 weeks ago

How about adding this configuration to the preferences, or adding an option just for SourceGit? @love-linger

Here are some other tools that handle this functionality.

GitKraken (default enabled) : image

https://github.com/mhutchie/vscode-git-graph (default disabled) : image

https://github.com/zielu/GitToolBox (default enabled with delay) : image

love-linger commented 2 weeks ago

Done. You can download the latest CI build from Github Action.

image