syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.9k forks source link

Various files (e.g. recentf) pollute git repository and prevent update. #5556

Closed 3rd3 closed 8 years ago

3rd3 commented 8 years ago

Description

I am sometimes getting this error message when updating:

Your Emacs directory is not clean.
git status:
  ?? SessionDesktop.el
  ?? recentf
  ?? srecode-map.el

Reproduction steps unknown.

System Info

((ibuffer :variables ibuffer-group-buffers-by nil)
 (ranger :variables ranger-ignored-extensions
         '("mkv" "iso" "mp4" "avi" "mp4" "mkv" "zip" "rar" "exe" "ps" "webm" "png" "jpg" "jpeg" "tif" "tiff" "ics" "dmg" "swf" "gz" "m4a")
         ranger-max-preview-size 4 ranger-cleanup-eagerly t)
 (latex :variables latex-enable-auto-fill t)
 org git github version-control finance extra-langs markdown emacs-lisp haskell html javascript ipython-notebook shell-scripts java
 (haskell :variables haskell-enable-ghc-mod-support nil haskell-enable-ghci-ng-support t haskell-enable-hindent-style "gibiansky" haskell-enable-shm-support nil)
 (c-c   :variables c-c  -enable-clang-support t)
 gtags
 (python :variables python-test-runner 'pytest)
 (clojure :variables clojure-enable-fancify-symbols t)
 (shell :variables shell-default-height 20 shell-default-position 'bottom shell-enable-smart-eshell t shell-default-shell 'eshell)
 evil-commentary)
calebmeyer commented 8 years ago

What means are you using to update? And I have the same problem with recentf and srecode-map.el polluting my ~/.emacs.d directory

When I'm updating (I'm on develop) I just do a blank git pull. Worth noting that I have git set to automatically set upstreams whenever possible.

3rd3 commented 8 years ago

I click update in the *spacemacs* buffer.

3rd3 commented 8 years ago

Is no one else experiencing this when clicking the update button in the *spacemacs* buffer?

biocyberman commented 8 years ago

Per request on https://github.com/syl20bnr/spacemacs/issues/5704 I put my files here:

Previously I had the following:

recentf
srecode-map.el
org-clock-save.el
custom.el

However, at the time of this writing (April 13, 2016) the only one left is custom.el This file is a built-in file of Emacs. It is generated whenever users customize some variable. And it must be placed under ~/.emacs.d/, not under ~/.emacs.d/.cache. Therefore it is a good candidate to put in.gitignore`.

It would think it is a better practice to put any customization under the control of user-config. However, custom.el is still generated sometimes. So it is still necessary to be in .gitignored

Sardtok commented 8 years ago

I have the same issue with recentf. .gitignore contains .recentf, but on Windows the file is for some unknown reason called recentf instead. Note that Windows supports files starting with a dot, so I don't know why it's not used.

josephDunne commented 8 years ago

after recent reinstall form scratch I get this one often:

srecode-map.el
schfkt commented 8 years ago

I got the same problem with this file: .mc-lists.el

toupeira commented 8 years ago

Also getting this with recentf.

Maybe it would make sense to have a white-listing .gitignore for all known paths, something like this:

/*
!/.github
!/assets
!/core
!/doc
!/layers
!/private
!/tests
!/.gitignore
!/.projectile
!/.travis-build.sh
!/.travis.yml
!/*.el
!/*.md
!/*.mk
!/*.org
mcfilib commented 8 years ago

Also getting this:

Your Emacs directory is not clean.
git status:
?? auto-save-list
?? recentf
lukertty commented 8 years ago

Also getting srecode-map.el

SG60 commented 8 years ago

I'm getting this as well with recentf

asalt commented 8 years ago

@SG60 removing recentf fixed the problem for me

SG60 commented 8 years ago

@asalt I've done that in the past, but it sometimes comes back after a month or so which is a bit annoying.

shakerlxxv commented 8 years ago

I've got the same issue with recentf file in my .emacs.d/ directory. I'm on Mac OSX 10.10.5 running spacemacs 0.105.20.

I'd suggest adding recentf without the . to the .gitignore file.

I typically do the upgrades by clicking the green arrow in the status bar. As far as I could tell it was giving no indication of why the upgrade was not working. It was not until I tried the Update spacemacs on the startup screen that I could see this was happening.

Here's the contents of my recentf file.

;;; Automatically generated by `recentf' on Sun Jun  5 01:02:58 2016.

(setq recentf-list 'nil)

(setq recentf-filter-changer-current 'nil)

;; Local Variables:
;; coding: utf-8-emacs
;; End:
a13ph commented 8 years ago

i'm not sure whitelisting won't affect performance of ag and the like negatively, but apart from that it's a nice idea though somehow (because i'm on develop?), this stuff doesn't bother my update through magit at all

bdarcus commented 8 years ago

I'm getting this problem with "session" files. Could you possibly add session.* to the .gitignore?

TheBB commented 8 years ago

https://github.com/syl20bnr/spacemacs/pull/6877

TheBB commented 8 years ago

This should be fixed now in develop for most files that are not due to user config at least (session files, recentf, srecode-map).

yilihong commented 8 years ago

@TheBB

I changed the core/banner folder to have some personalized banner txt files, now I'm not able to upgrade spacemacs due to directory not clean, and could not ignore them in .gitignore, any suggestions?

d12frosted commented 8 years ago

@yilihong Don't make any changes in Spacemacs directly if you want to cleanly update. I have custom banner as well. Since it's png file, I am tweaking dotspacemacs-startup-banner variable.

dotspacemacs-startup-banner is a variable defined in ‘core-dotspacemacs.el’.
Its value is
"/Users/d12frosted/Dropbox/Apps/Emacs/animacs-banner.png"

Documentation:
Specify the startup banner. Default value is ‘official’, it displays
the official spacemacs logo. An integer value is the index of text
banner, ‘random’ chooses a random text banner in ‘core/banners’
directory. A string value must be a path to a .PNG file.
If the value is nil then no banner is displayed.

If you are using txt banners you could just tune spacemacs-banner-directory variable.

spacemacs-banner-directory is a variable defined in ‘core-load-paths.el’.
Its value is "/Users/d12frosted/.spacemacs/core/banners/"

  This variable may be risky if used as a file-local variable.

Documentation:
Spacemacs banners directory.
yilihong commented 8 years ago

@d12frosted

wonder how that could be done? I tried following but doesn't seem to work:

(setq spacemacs-banner-directory "/Users/Kevin/Google Drive/_spacemacs/banners/")

TheBB commented 8 years ago

Where did you set it? It has to be changed very early in the loading process.

yilihong commented 8 years ago

@TheBB Thanks for the hint... I originally put in user config and it didn't work, changed to user init and now works perfectly.

d12frosted commented 8 years ago

Fixed with released of Spacemacs v0.200. Let us know if you still have any problems with this issue.

cjpoor commented 8 years ago

I got this message after clicking update spacemacs in the spacemacs buffer:

"Your emacs directory is not clean git status: ?? plugin-ins"

It might be related to evil-org-mode which installed in ~/.emacs.d/plugins

I am on Mac OS X using the GUI of Spacemacs 0.200.2, emacs 24.5.1

Haven't really taken the time to learn Git yet, so I have no idea what's happening here.

cjpoor commented 8 years ago

FYI Managed to do the update with git pull --rebase in .emacs.d but still get the same message if I try updating from Spacemacs buffer.

mcfilib commented 7 years ago

Recent magit update and now getting the same message for url/ which contains things like Gravatar data.

Your Emacs directory is not clean.
git status:
?? url/

Worth adding to .gitignore?

LeartS commented 7 years ago

Agreed for url/, getting the same problem now. I would also add:

@TheBB

d12frosted commented 7 years ago

Ideally they should not be added to .gitignore, but rather be stored under cache directory. Leaving this commit just for reference.

Note that .mc-lists.el is [added][2] to .gitignore in develop.

As per "url" folder, I can't find in magit sources code that writes to this folder. Are you sure that it's magit and not something else? Would be really helpful if you point me to the variable or the place where "url" is used. If it's really magit, then we should just change the variable to point to the cache.

LeartS commented 7 years ago

I have url/cache/learts/http/com/gravatar/www/<id> with my gravatar. I see my gravatar in magit when showing commits; and nowhere else that I remember, so I assume it must be magit.

cjpoor commented 7 years ago

FYI I still get this problem on Mac OS X 10.10.5; Emacs 24.5 (9.0); Spacemacs 0.200.7 (app and Terminal give same message) when I try to update Spacemacs by clicking Update Spacemacs and pressing Enter when given the prompt Version (default 0.200.7 [latest]):

Your emacs directory is not clean. git status: ?? .#recentf ?? plugins/

I have the git layer in my dotspacemacs. Commenting out git and restarting does not prevent the error.

Note: On my linux box running Uberstudent 4.3 with 3.13.0-37 kernel Emacs 24.5.1; Spacemacs 0.200.5 (and then 0.200.7) I do not have the git layer enabled (although I do have a .git directory in my .emacs.d folder) and I do not get this problem.

Uncommenting git (installing the package) still does not give the "unclean" error on linux (though I am initially told that magic requires a newer version of git - but it seems to be working - giving status message for .emacs.d).

Upgraded git to 2.11.0 - still did not get the "unclean" error in linux.

The .gitignore files on both machines appear to be the same and contain, for example, .recentf and #*

braham-snyder commented 7 years ago

Regarding url/:

SPC s f > ~/.emacs.d/ > gravatar pointed me to:

(defun spacemacs-base/init-url ()
  ;; gravatars from magit use this to store their cache
  (setq url-configuration-directory (concat spacemacs-cache-directory "url/")))
url-configuration-directory is a variable defined in ‘url.el’.
Its value is "~/.emacs.d/.cache/url/"
Original value was "~/.emacs.d/url/"

Documentation:
Directory used by the URL package for cookies, history, etc.
(defcustom url-configuration-directory
  (locate-user-emacs-file "url/" ".url/")
  "Directory used by the URL package for cookies, history, etc."
  :type 'directory
  :group 'url)

So perhaps spacemacs-base/init-url is just not called early enough (spacemacs-cache-directory is ~/.emacs.d/cache, as expected)?

MilooHub commented 7 years ago

similar but Not identical problem happened here.

When I click Update Spacemacs, I was promped as follows

Your Emacs directory is not clean. git status M init.el ?? kite.el

abovementioned two .el files are not temporary generation. (kite.el appears after I installed the popular AI based python completion plugin Kite - https://kite.com/ )

Should I just add them to .gitignore or do I need to solve it otherwise?

Please provide assistance on it. Thanks in advance.

hyiltiz commented 6 years ago

Shouldn't spacemacs put those files automatically under .gitignore? Or maybe open up a minibuffer and ask which ones to put under .gitignore? Or maybe even hint that we could simply do a manual 'git pull'? Having to visit this issue to find out these solutions isn't the best way to address it.

eduardgrebe commented 5 years ago

I repeatedly get the "Your Emacs directory is not clean." error when trying to update from within Emacs. In my case it is usually the /transient/ directory that pollutes the repo.

I am not sure what is creating the directory, but I only have standard layers enabled. If this is happening to others – can transient be added to .gitignore? I can do so myself, but I then again have local changes that I can't commit to master.

duianto commented 5 years ago

@eduardgrebe Unexpected transient directory blocking spacemacs update #12128

It's been fixed on the develop branch by moving the transient dir/files to the cache directory https://github.com/syl20bnr/spacemacs/commit/b364cd3c61f1221ca7433e1f4951052205852b04

The last comment suggests this workaround:

As a temporary workaround for the stable release I added transient to my .git/info/exclude.

source: https://github.com/syl20bnr/spacemacs/issues/12128#issuecomment-485786045