Skip to content

Please allow disabling of the "Switch branch" dialog that offers to stash changes. #7746

Closed

Description

@NickCraver

In a big port we're doing, very often we're making changes in whatever branch we're in - the delta matters but the parent doesn't, and we'll flip to master or another branch to actually commit those changes. Most often, this is to a new branch, off of master - so that our migration work continually flows, rather than a big bang at the end.

My steps are:

  • Be in a branch (maybe master, maybe some random branch from the last change)
  • Create a new branch for the changes to go in
  • Commit changes to new branch
  • Push new branch

Since 2.x, I get a prompt like this:
image

To not be annoyed by this, it forces a workflow on the user of defining their branch before making their changes. That's not how we work. If we find a problem, we solve the problem, then commit that work in a branch for PR review. We don't know what the problem is ahead of time. This was painless before, but now results in a prompt each time. If I need to change to master first for some reason, it's 2 prompts. I don't want GitHub Desktop to "help" here...it's an annoyance instead. And a mis-click means even more work. It only offers me opportunities to fail and cause more work.

Please allow us to disable this prompt - can we add a preference here?
image

/cc @shiftkey

Activity

  1. shiftkey commented on Jun 10, 2019

    @shiftkey
    Member

    cc @desktop/product and @desktop/engineering for 👀 and 💭

  2. shiftkey commented on Jun 10, 2019

    @shiftkey
    Member

    This is somewhat related to #7720 - we got into a discussion about how Desktop handles untracked changes, but the key comment here feels similar to what's being talked about here:

    Steps to Reproduce

    Try and switch branch with untracked files.

    Expected Behavior

    Ignore untracked files like the previous versions and the command line.

    Actual Behavior

    Annoying dialog every time you switch branches.

  3. shiftkey commented on Jun 10, 2019

    @shiftkey
    Member

    @NickCraver thanks for the feedback and insights.

    I have a couple of questions about this bit:

    To not be annoyed by this, it forces a workflow on the user of defining their branch before making their changes. That's not how we work. If we find a problem, we solve the problem, then commit that work in a branch for PR review.

    So it feels like your normal flow is to always take your changes with you to this other branch.

    • How often would you get blocked by the app when switching branches introduces conflicts? How do you workaround that when it occurs?
    • How often do you or your colleagues use stashing (either out of need or choice) to carry their work around between branches?
  4. NickCraver commented on Jun 10, 2019

    @NickCraver
    ContributorAuthor

    How often would you get blocked by the app when switching branches introduces conflicts? How do you workaround that when it occurs?

    It's almost always a new branch, so I don't know that I've ever hit conflicts in this workflow. Prompting when there are conflicts would certainly be welcomed.

    How often do you or your colleagues use stashing (either out of need or choice) to carry their work around between branches?

    For this migration (many months long) - super rarely AFAIK. I only stash if there's a conflict...so back to the first question I guess. Prompting in that case would be a good idea I guess, since you're going to get some dialog saying it didn't do well.

  5. shiftkey commented on Jun 10, 2019

    @shiftkey
    Member

    The other case that's important to keep in mind here is how often a user might want to stash these changes, to return to the branch later and pick them up again. If that's not a regular scenario for the user I can see why this dialog would get tedious fast.

    Anyway, I'll let others chime in here if they have other questions about this flow.

  6. jmonrove commented on Jun 10, 2019

    @jmonrove

    I just mentioned this same annoyance in 6107

    In short, I travel through branches a lot, with staged changes, specially during hotfix stuff or minor functionality that doesn't warrant a hole feature branch, I get the pop up constantly and it's killing me hahaha.

    For now I think I'm just going to revert to the previous version, and block updates so I can work in peace...

    I really hope an option is added to be able to de/activate magic stashing as it slows down agile workflow.

  7. elliscwc commented on Jun 12, 2019

    @elliscwc

    Same for me, I switch branch often. I work under a supervisor, I have to disable some code to make my code run due to some production circumstances which I don't have. It need to stay untracked for every branch I work on..

  8. billygriffin commented on Jun 13, 2019

    @billygriffin
    Contributor

    Hi folks - I'm really interested in how this is manifesting for others who are experiencing this pain and desire for the stash dialog to be toggle-able, so more detail around your workflow and why you're always wanting it to work how it previously did would be amazing for folks who haven't yet weighed in. We expect to iterate as we learn more about how people are using this, and I'm keeping this issue open not to say that we're definitely going to support turning it off, but to collect feedback so we can understand the varying problems and workflows, and iterate from there. Thanks again for the initial thoughts for everyone who has weighed in so far, they're really helpful.

  9. steffen commented on Jun 19, 2019

    @steffen

    I agree with the original post that this dialog is slowing down my workflow for creating and switching to new branches. I usually start doing changes first and then create a new (topic) branch.
    I expect the default Git behavior here where my changes are taken over to the newly created branch.

    This dialog may make more sense to me when switching to existing branches while having local changes. I haven't had this workflow yet since the new version. Will report back my thoughts on that.

    In general though I would like to see a Stash my changes button with a checkbox option for untracked files.
    I often stash changes to either save experimental snapshots or when I want to redo a change from scratch, but not lose what I've tried already, so that I could get back if I want to.

  10. Listbd commented on Jul 16, 2019

    @Listbd

    As someone mentioned earlier, I often start making changes and then decide to create a branch. I very rarely need to stash changes, and this extra step is very annoying.

    Also, there are some local changes I prefer to leave uncommitted most of the time, just sitting there, like config changes I'm playing with, but don't want to "commit" to yet. (no, I do not want to ignore the file or assume-unchanged.)

    Would very much like to have the ability to turn this new "feature" off. Likely will attempt to go back to a previous version of desktop for now.

  11. daviddoran-stripe commented on Jul 25, 2019

    @daviddoran-stripe

    Agree with the reasoning of the previous commenters, but just to confirm:

    • I generally work on master, branch off, commit, push so having to confirm each time with the mouse is inconvenient
    • As above I often carry untracked changes around in my working copy (a local script or something I'm going to split off into another branch)
  12. billygriffin commented on Jul 31, 2019

    @billygriffin
    Contributor

    Thanks folks for weighing in on this. This feature has been overwhelmingly well-received thus far, but we appreciate this feedback. As before, we don't have immediate plans to provide an option to disable it, but continued feedback from others experiencing this pain is helpful in helping us evaluate whether/how to prioritize something that reduces this pain for y'all. Thanks again.

  13. NickCraver commented on Jul 31, 2019

    @NickCraver
    ContributorAuthor

    Thanks for the update here - though not good news I really do appreciate having the info to make decisions.

    For what it's worth, when it affects people it really affects them. I change branches dozens of times a day and this offers a delay and a chance for failure 10-20 times a day. It introduces thought into the flow that isn't needed (for me) and I'm honestly better off at the command line without the GUI when changing branches. It's just not a good situation.

    As someone who maintains a lot of open source, I don't say this lightly, but: this issue is annoying enough that I'm just going to fork the project and comment out the prompts. It's just a math equation: a fork will cost me less time than this prompt has. It will also cost me far less time fixing misclicks on the prompt has.

    Please consider this for a future release. I'd love to test a beta or anything as soon as an option is added whenever it is. I very much don't like needing to resort to a fork to save time. But that's what a tool is supposed to do, save human time. Without this prompt, I save time. With this prompt, I don't. If this ever changes, please update this issue and I'll be the first to help test it.

  14. cabello commented on Jul 31, 2019

    @cabello

    I was asked to weight in by @billygriffin 👋 Yes, this change did disrupt me flow, these past few days I've been creating new branches using the CLI (git checkout -b new-branch) before I use Github Desktop because the prompt is so disruptive. I wouldn't mind having the option to never be asked to stash changes using the GUI.

  15. jmonrove commented on Jul 31, 2019

    @jmonrove

    As someone who maintains a lot of open source, I don't say this lightly, but: this issue is annoying enough that I'm just going to fork the project and comment out the prompts. It's just a math equation: a fork will cost me less time than this prompt has. It will also cost me far less time fixing misclicks on the prompt has.

    If you do release it I'll be using it for sure!
    Thank you in advance!

  16. 11 remaining items

  17. gothate commented on Oct 30, 2019

    @gothate

    Agree with pretty much all the comments here. I almost never stash changes and switch branches often and this dialog plain sucks.
    Someone above had a good idea about asking only on merge conflict which I think is fair and clever.
    At the very least the default should be settable in the options.

    (*) prompt for stash/keep changes on branch switch
    ( ) stash changes on branch switch
    ( ) keep changes on branch switch

  18. billygriffin commented on Oct 30, 2019

    @billygriffin
    Contributor

    Thanks for the feedback folks, it's really helpful to understand how it's negatively impacting people. We're examining various possibilities and are planning to iterate on this, and the feedback has been helpful in understanding your experiences.

  19. cabello commented on Dec 6, 2019

    @cabello

    @outofambit could you provide some context why this was put as out of scope, if a PR was proposed for this, would it be reviewed/accepted?

  20. outofambit commented on Dec 6, 2019

    @outofambit
    Contributor

    Hi @cabello, yes I'm happy to. This was initially in scope for the 2.2.4 release, but this fell off the list of things reasonably achievable by our team for this release (mostly due to some unforeseen infrastructure work we needed to do to support #8563). As of now, we are not looking for community contributions here because @desktop/engineering plans to do this ourselves soon. If any of that changes, we will be sure to update here.

  21. billygriffin commented on Jan 16, 2020

    @billygriffin
    Contributor

    Hi folks, appreciate all the input here. The beta just shipped yesterday with an option in preferences to always stash or bring changes to your new branch if you'd like to start using it prior to the production release. You can find the beta here: https://github.com/desktop/desktop/#beta-channel

    Screen Shot 2020-01-16 at 9 34 20 AM

    cc: @NickCraver @jmonrove @cabello @elliscwc @steffen @Listbd @Jarrich @grokys @gothate @keitherskine @kaster14 @say25 @j-f1 as y'all all weighed in on this throughout the discussion

  22. NickCraver commented on Jan 16, 2020

    @NickCraver
    ContributorAuthor

    Thank you for the poke on this - much appreciated!

    This is an awesome change and a huge time saver - I've just installed the beta to test it out and have relayed the same to everyone I know frustrated with it as well. I'm very glad people were willing to revisit decisions here and ultimately make some (very good looking) changes, that speaks volumes about the team - even in the face of frustrated users (me included). I'm sure this will cause me to ship something bad today as I can't stop changing branches just to celebrate fewer clicks each time, but oh well - thank you!

  23. gothate commented on Jan 16, 2020

    @gothate

    THANK YOU! I echo what Nick said above.

  24. jmonrove commented on Jan 16, 2020

    @jmonrove

    Hell yeah! Thank you! Thank you!!

  25. elliscwc commented on Jan 17, 2020

    @elliscwc

    Thanks, nice changes to the preferences, and I love it so far~

  26. keitherskine commented on Feb 4, 2020

    @keitherskine

    The new options are certainly a welcome change from before, so many thanks for that. However, I was a bit surprised that the option "Always bring my changes to my new branch" actually means "merge my changes into the new branch even if there are conflicts". I seem to remember way back last summer, if I tried to switch branches when that switch would create conflicts, GitHub Desktop would simply refuse to do the switch (happy to be corrected on that though).

    I just wondered if that new behavior was deliberate? At the risk of being picky, perhaps we need two options:

    1. Always merge my changes into my new branch (which may result in conflicts)
    2. Merge my changes into my new branch (but ask if there are going to be conflicts)

    Generally, my preference would be to use the second of these two options. Perhaps the wording of the existing option in GD could be clarified to indicate that GD will do a merge, regardless of whether there are conflicts.

    Lastly, if it is better to raise this as a separate issue, I'm happy to do so.

  27. outofambit commented on Feb 4, 2020

    @outofambit
    Contributor

    Hi @keitherskine!

    I seem to remember way back last summer, if I tried to switch branches when that switch would create conflicts, GitHub Desktop would simply refuse to do the switch (happy to be corrected on that though).

    Yep, you are correct!

    This was a deliberate change in behavior as part of #7246. Happy to discuss more in a new issue with you @keitherskine. Thank you!

  28. keitherskine commented on Feb 4, 2020

    @keitherskine

    Thank you for the explanation, @outofambit . I have to say, right now I'm not sure I'm a big fan of "surprise" conflicts, but let me work with it for a bit. I'll raise a separate issue if necessary. Thanks again.

  29. kaster14 commented on Feb 20, 2020

    @kaster14

    @billygriffin Thanks for taking a look at this, here is some feedback for you.
    Using Version 2.3.2-beta3

    I set the preferences to "Always stash and leave my changes on the current branch"
    Opened branch 1, which has a bunch of files git ignored
    checkout branch 2, sees the previously ignored files as new changes.
    checkout branch 1, ignored files are now stashed on branch 2 (not really desirable)

    I changed the setting to "always bring changes to my new branch"
    checkout branch 2 and restore stashed changes.
    checkout branch 1
    Now all of the files that are git ignored on this branch now show up as changes even though they are git ignored - expected behavior -> No changes visible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions