Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Files added/removed have weird behavior when switching branches #693

Closed

Description

@bhuga

When I switch to a branch where a file I've been editing doesn't exist, Atom marks it as 'changed'. That's not really right: it's gone. I'd expect atom to either figure out that the file I was editing doesn't exist on this branch and close the tab, or to mark it as 'doesn't exist'.

Quitting and restarting doesn't help; the tabs were part of my project session so they just come right back, marked as changed.

Activity

  1. jbarnette commented on Aug 8, 2013

    @jbarnette
    Contributor

    This drives me crazy too.

    On Thu, Aug 8, 2013 at 3:46 PM, Ben Lavender [email protected]:

    When I switch to a branch where a file I've been editing doesn't exist,
    Atom marks it as 'changed'. That's not really right: it's gone. I'd
    expect atom to either figure out that the file I was editing doesn't exist
    on this branch and close the tab, or to mark it as 'doesn't exist'.

    Quitting and restarting doesn't help; the tabs were part of my project
    session so they just come right back, marked as changed.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/693
    .

  2. kevinsawicki commented on Aug 30, 2013

    @kevinsawicki
    Contributor

    Are you guys feeling that the buffer should close when the file is deleted? Either from the git, the tree-view, any place.

  3. benogle commented on Aug 30, 2013

    @benogle
    Contributor

    I'd say no, it should not close. Sublime just marks it as modified, FWIW.

    On Fri, Aug 30, 2013 at 12:01 PM, Kevin Sawicki [email protected]:

    Are you guys feeling that the buffer should close when the file is
    deleted? Either from the git, the tree-view, any place.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/693#issuecomment-23582526
    .

  4. jbarnette commented on Aug 30, 2013

    @jbarnette
    Contributor

    If I change branches, I don't care in the slightest about unmodified buffers pointing at files that don't exist on my destination branch.

  5. bhuga commented on Aug 30, 2013

    @bhuga
    Author

    If I change branches,

    That's the key for me. I appreciate vim's behavior of keeping a buffer around after I delete a file manually; I rather expect that. When I switch branches in git, it is incorrect to call it modified, it's just not there right now.

    So:

    • git branch change: close buffer
    • file removed otherwise: leave it open, mark as modified

    Is that possible?

  6. kevinsawicki commented on Aug 30, 2013

    @kevinsawicki
    Contributor

    @bhuga it is, we have the technology

  7. probablycorey commented on Aug 30, 2013

    @probablycorey

    How can we tell if the file was removed by git vs some other processes?

  8. kevinsawicki commented on Aug 30, 2013

    @kevinsawicki
    Contributor

    @probablycorey Atom can watch .git/HEAD for branch changes

  9. probablycorey commented on Aug 30, 2013

    @probablycorey

    Seems crazy, but so do airplanes and they work great.

  10. reopened this on Aug 30, 2013
  11. tclem commented on Sep 18, 2013

    @tclem

    This is driving me nuts too, especially since I use auto-save so tabbing off the editor saves all the files to my working dir which means you then have to pick apart the new branch you are on vs. the files that were in the old branch. I also noticed that manually closing the buffers and clicking don't save still seems to save the buffers to disk.

  12. probablycorey commented on Dec 5, 2013

    @probablycorey

    I'm not seeing this because (for no good reason) I am vigilant about closing files I'm not using. But I'd like to tackle fixing this issue once and for all! If I had a list of steps to reproduce the problem that would help me out a lot because otherwise I'd just be guessing at what situations cause the problem.

  13. bhuga commented on Dec 5, 2013

    @bhuga
    Author
    • Create a new branch
    • Create a file
    • Commit that file
    • Switch to master

    The new file is open and marked as modified.

  14. jbarnette commented on Dec 5, 2013

    @jbarnette
    Contributor
    • Open a file
    • Delete that file
    • Quit

    You'll be prompted to save changes to the deleted file.

  15. jbarnette commented on Dec 5, 2013

    @jbarnette
    Contributor
    • Open a file
    • Switch to a branch where the file doesn't exist
    • Quit

    You'll be prompted to save changes to the deleted file.

  16. jbarnette commented on Dec 5, 2013

    @jbarnette
    Contributor

    I really don't feel like it's hard to find examples of this.

  17. probablycorey commented on Dec 5, 2013

    @probablycorey

    I just wanted to make sure I was solving your exact problem. And just to clarify, the expected behavior here is the buffer will close when the file is deleted. Or that the file will never prompt for saving.

  18. added a commit that references this issue on Dec 9, 2013
    63e3be8
  19. jbarnette commented on Dec 12, 2013

    @jbarnette
    Contributor

    ❤️❤️❤️❤️❤️

  20. lock commented on Jan 27, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  21. locked as resolved and limited conversation to collaborators on Jan 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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