Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use magit right now, but one thing about using emacs and the commandline that bugged me when I tried it was that when changing branches, I would be prompted for what to do with each open file that had changed. Is there a good workflow solution for this?


Yes. You create a stash with your changes, or commit them before switching branches.


Well, I mean with files that are open and unmodified. If I change to a different branch to work on something else, emacs will prompt me for what to do with each open file that is different between branches.


Just FYI, space counts as "yes" at all y-or-n-p prompts. Emacs does do what you say, but it is kind of nice to have the warning -- "oh, something unusual is going on". With a push of the spacebar to dismiss the warning, it's something barely worth thinking about.

Also... I think "(defalias 'yes-or-no-p 'y-or-n-p)" is the most useful line of code I have ever written.


Ah, I don't know if magit has that feature. It's relatively easy conceptually though.

You'd write a hook for magit that on branch change would check what buffers were open to files within the repository and refresh their contents.

Maybe something like that exists already. I just press "r" to refresh the file from the filesystem when editing the individual files in this case.


magit does have that feature (automatically reload files etc after changing branches.) What I want is that feature outside of magit (or other VCS integration) somehow.


try enabling the auto-revert-mode minor mode.

http://www.gnu.org/software/emacs/manual/html_node/emacs/Rev...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: