Giter VIP home page Giter VIP logo

magit-filenotify's Introduction

Refresh status buffer when git tree changes

This extension to Magit provides a minor-mode which, when enabled, automatically updates a repository’s status buffer whenever a file inside that repository’s working tree has changed. It uses the file notification support that was added in Emacs v24.4.

Should I use it?

Note that Magit itself refreshes the appropriate status buffer whenever you run a Magit command. (Before v2.3, Magit did only do so when the major-mode of the current buffer derives from magit-mode, but now it does so whenever you run a Magit command, regardless of context.)

Additionally, also starting with v2.3, Magit can be configured to also refresh a repository’s status buffer whenever you save a buffer which visits a file which is being tracked in that repository. Due to performance concerns that feature is not enabled by default, to enable it add this to your init file:

(add-hook 'after-save-hook 'magit-after-save-refresh-status)

After you have done that and assuming that you mostly interact with Git using Magit, then you don’t need this package. If a status buffer is out-of-date due to outside changes, you can always refresh it by simply pressing g.

You can find more information about how Magit automatically refreshes buffers and about how to do it explicitly in its manual, in the node Automatic refresh and revert.

However if you often use Git on the command line and inside Magit in parallel, then you might want to avoid having to press g when coming back to the status buffer from the command line. Enabling this mode avoids that.

But also note that refreshing the status buffer can still be slow in big repositories. If you are not satisfied with Magit’s performance then you should probably not enable this mode, as that would refresh the status buffer even more often, in many cases needlessly.

How do I use it?

To activate the minor-mode for a repository, open the status buffer for that repository and then call M-x magit-filenotify-mode RET. Repeat the same step to deactivate the mode again. To automatically enable the mode when opening a status buffer, add this to your init file:

(add-hook 'magit-status-mode-hook 'magit-filenotify-mode)

magit-filenotify's People

Contributors

ruediger avatar tsdh avatar tarsius avatar steckerhalter avatar purcell avatar

Watchers

Jürgen Hötzel avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.