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.

Touch files on save? #1690

Closed
Closed

Description

@thedaniel

support/2347f9369fef11e3946f08ae2636949d?page=1

Not sure if this is something we want to do, but interesting feedback nonetheless. The user wants to run his guardfile whether his contents changed or not on core:save

Activity

  1. probablycorey commented on Mar 4, 2014

    @probablycorey

    We've heard this complaint a few times. I think maybe we were overly cautious about not saving a file. I can't think of any major downsides if we let Atom always save a file, even if it's contents are unchanged.

  2. kevinsawicki commented on May 5, 2014

    @kevinsawicki
    Contributor

    This was added in atom/text-buffer#5

  3. Zequez commented on Jul 9, 2014

    @Zequez

    I know of a major issue: window:save-all.

    I have ctrl+s binded to window:save-all. And every time I press ctrl+s every file I have open gets touched by Atom, and triggers all kinds of nasty stuff, because I have Guard watching the filesystem. It makes Guard reload the Guardfile if I have the Guardfile open, it runs all the tests again for files that didn't change, and it triggers unnecessary IO operations!

    This should be optional, it completely breaks files watchers and hinders performance. Or at least it should be disabled for window:save-all.

  4. thecotne commented on Jul 9, 2014

    @thecotne

    it must be optional and disabled by default

  5. probablycorey commented on Jul 10, 2014

    @probablycorey

    @thecotne, I would be great if you give some details on why you think it should be disabled by default. There are people that have the opposite view and that is why we adopted this behavior. Understanding the arguments for both sides would be helpful for us.

  6. thecotne commented on Jul 10, 2014

    @thecotne

    @probablycorey it must be disabled by default because all editors i have used before have save option available when file has changed
    if i discovered this behavior by my self i would open issue about bug
    this behavior looks like a bug
    so it must be disabled by default

  7. costa commented on Nov 5, 2014

    @costa

    +1 on seeing this as a bug, please fix it up.

  8. thomasjo commented on Nov 5, 2014

    @thomasjo
    Contributor

    @costa It's not a bug. This behavior is by design. See atom/text-buffer#5.

  9. mark-hahn commented on Nov 5, 2014

    @mark-hahn
    Contributor

    I use it to touch. I hated intelliJ's lack of touching. I would want to
    trigger some script like compiling or pushing to a server.

    Having said that, maybe it should be an option?

    On Wed, Nov 5, 2014 at 6:22 AM, Thomas Johansen [email protected]
    wrote:

    @costa https://github.com/costa It's not a bug. This behavior is by
    design. See atom/text-buffer#5
    atom/text-buffer#5.

    —
    Reply to this email directly or view it on GitHub
    #1690 (comment).

  10. thecotne commented on Nov 6, 2014

    @thecotne

    why it's not optional?

    i think it must be optional

  11. costa commented on Nov 9, 2014

    @costa

    I say I have had some experience with all kind of editors and I don't expect an editor to touch unchanged open files when I hit Save All. Whether an editor should save an unchanged file when hitting Save (this file only) — I have no opinion.

  12. costa commented on Nov 9, 2014

    @costa

    Come to think of this, I would be perfectly happy with 'Save All' meaning "Save all changed" and 'Save' meaning "Save this file regardless" — a user has indication of changes in this file and so can decide whether to touch this file or not.

  13. bfreis commented on Feb 3, 2015

    @bfreis

    A huge issue related to this is when building Docker containers. By "touching" an unchanged file, Docker will see that mtime has changed and will assume the file has changed, and will not reuse it's image cache, but will build a new image instead. This will lead to a much longer build time, upload time, deploy time, and all sorts of nastiness.

    Let's assume it was a perfectly reasonable reason to make the default "touch on save" -- which I disagree, but let's assume it. What is the huge problem about making this "feature" optional? It would satisfy both whoever thinks it's a good idea, and whoever has a very good reason -- such as above -- not to touch unchanged files.

    Thanks

  14. thedaniel commented on Feb 3, 2015

    @thedaniel
    ContributorAuthor

    Requests like this make me wonder if we should have a set of configuration items that are officially supported (i.e. not going to disappear in a minor update) but are not exposed in the UI (only set in init.coffee) - kind of like chrome's advanced flags.

  15. bfreis commented on Feb 3, 2015

    @bfreis

    That would be totally awesome.

  16. levity commented on Jul 3, 2015

    @levity

    I also would like this behavior to stop for Save All. Touching when saving an individual file makes sense though.

    I have the same issue that @Zequez and @bfreis mentioned, which is that saving unchanged files triggers unnecessary activity.

    This also breaks the Tidy Tabs package, which uses the modification time of tabs to determine which old tabs to automatically close.

  17. isaachess commented on Aug 7, 2015

    @isaachess

    I also hate that atom touches all files on a save-all -- not at all what I expect. I'm coming from vim, where a :wa command only saves files with changes, and does not affect unchanged files.

    I also have projects with watchers tracking file changes to run a build process, and touching every open file results in many unnecessary builds, slowing me down greatly.

  18. thomasjo commented on Nov 4, 2015

    @thomasjo
    Contributor

    @isaachess The save all aspect was resolved in #9249, and will likely be released in the next stable version of Atom. I haven't checked, but it miiiiight have been released in the current beta.

  19. jasonrudolph commented on Nov 11, 2015

    @jasonrudolph
    Contributor

    The save all aspect was resolved in #9249, and will likely be released in the next stable version of Atom. I haven't checked, but it miiiiight have been released in the current beta.

    It is indeed present in the current beta (1.2.0-beta2).

    For anyone wanting a way to opt into the previous behavior (i.e., save all buffers even when they haven't been modified), you can add a command to your init.coffee script and bind that command to your desired keyboard shortcut to restore the previous behavior. Example: jasonrudolph/dotfiles@0ecb3db

  20. lock commented on Jan 19, 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 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions