I am using ember-cli v0.0.47 and I would like to be able to make brocolli ignore some files' changes when it triggers a build.
I'm using vim as authoring tool and I have it configured to save all my open files whenever the editor looses focus (this includes swap and undo files). This has the unfortunate side effect of causing a lot of unnecessary rebuilds of my ember-cli project because brocolli detects that the files have been changed and proceeds to rebuild.
As such I'd like to be able to somehow tell brocolli not to trigger a rebuild of the project when some files have been changed. Is there some way to achieve this?
I don't know of a way to exclude files from Broccoli, but generally this is indeed a problem and it helps to write vim's temporary files elsewhere to prevent frequent rebuilds, so in your .vimrc:
set backupdir=~/.vim/backup//
set directory=~/.vim/swp//
You have to create the directories manually as well.
The extra slash is needed so it preserves the file structure within that directory. From :help directory in vim:
- For Unix and Win32, if a directory ends in two path separators "//"
or "\\", the swap file name will be built from the complete path to
the file with all path separators substituted to percent '%' signs.
This will ensure file name uniqueness in the preserve directory.
On Win32, when a separating comma is following, you must use "//",
since "\\" will include the comma in the file name.
Related
With more and more programs installed on my computer, I am tired of seeing lots of dotfiles while I have to access them often. For some reason I won't hide dotfiles when browsing files. Is there a way to move them to a better place I want them to stay (e.g. ~/.config/$PROGCONF) without affecting programs while running?
Symlinks still leave file symbols, which is far from my expectation. I expect that operations like listdirs() won't show the files while opening them uses a redirection.
"For some reason it won't hide dotfiles when browsing files.":
That depends on the file manager you use. nautilus hides it by default and most file managers have an option to "show/hide hidden files". The ls command by default omits out hidden files (files starting with a dot). It lists all files with the option -a.
"Is there a way to move them to a better place":
Programs which have support for "XDG user directories" can store their config files in `~/.config/$PROGRAM_NAME/. If the program doesn't support that and expects the config file to be present in the home directory, there is little you can do (Maybe you can give us a list of what programs' config files you want to move). The process differs for each program.
Let me give an example with vim. Its config file is ~/.vimrc. Lets say you move the file to ~/.config/vim/.vimrc. You can make vim read the file by launching vim using the following command.
vim -u ~/.config/vim/.vimrc
You can modify the .desktop entry or create a new shell script to launch vim using the above command and put it inside /usr/local/bin/ or create shell functions / aliases. You can read more about changing vim's config file location in this SO question.
This arch wiki article has application specific information.
"without affecting programs while running":
It depends on a few factors namely the file system used, the program we are dealing with and so on.
Generally, deleting / moving files only unlinks the file name from an inode and programs read / write files using inodes. Read more here. And most programs read the config file at the start, load the values into memory. They rarely read the config files again. So, if you move your config file while the program is running (assuming the program supports config in both places), you won't see a difference until the program is restarted.
"I expect that operations like listdirs() won't show the files"
I am assuming you are talking about os.listdir() in python. If files are present, os.listdir() will list them, there is little you can change about that. But you can write custom functions to omit out the hidden files from being listed.
This SO question can help with that.
To let you understand my problem, i must give some brief explanation about the way my client application works.
First, we create workspaces with allwrite set, this is because our programming language (PowerBuilder) does not writes directly to txt files, it writes to 'pbl' files, which are binary.
However we dont version pbl files and to be able to version each object inside a pbl we need to run some cmdcommand, which will output the classes within the pbl file to text files (one file per class), these text files is what Perforce must version.
The problem now is that the pbls are being listed as modified files (in fact they are), but we dont want them to be marked as modified.
I could put them in a ignore file, but there are some Pbls in the repository which must be synced.
I know i could specify in the ignore file to ignore Pbls except the Pbls which are in the repository, but then these specific pbls would keep showing up as modified files when i run a reconcile..
What i want is to have the PBL file exactly the way it was before running the reconcile, unopened by perforce but modified.
Its would be ok, if i could revert them without undoing its modifications...
Or if i could run a reconcilefor all the files, except the pbls.
Does anyone knows a way to do that? Thank you.
You can revert files without refreshing their content from the repository by running 'revert -k': http://perforce.com/perforce/doc.current/manuals/cmdref/p4_revert.html
I have a folder called Text/, and I applied "chattr +a" on that folder as root to prevent deleting files, while allowing creation of new files inside the folder.
I created a new file inside this folder, but every time I changed the content of the file, it automatically generate a numbered file in the same directory, like 5036, 5159
should anyone know what's up? I tried to change the backupdir and dir(for swap file) in vimrc, but still not work.
If you have any idea on this issue, please help me, thanks!
By default Vim makes a backup before overwriting a file, which is deleted after the file is successfully written. As you mentioned on the comments, chattr +a prevents the removal of those bakcup files.
The generation of backup files can be disabled with :set nowritebackup for all files; backupskip option can be used to disable the backup only for folders with restrict attributes. Additional information on :h backup-table.
I have a set of files which are text files, but contain the ASCII 0 SOH character.
Perforce sees these files as binary. Now, being honest, I don't care what it sees them as, however, recently we have had several occurrences of Perforce giving different people different versions after a new branch is integrated.
The GUI shows version say #2/#2 (two of two) on two peoples workspaces, but they have different versions. When these files are right clicked and diffed against the latest (having selected the character set in the popup to treat them as text), it shows the file as having differences. However, choosing "Get latest revision" or doing a "p4 sync ..." does not update the file.
I have tried setting the file type to "text" and committing and they remain text up until they get branched when they revert to binary.
Has anyone seen this behaviour?
I have tried setting the file type to "text" and committing and they
remain text up until they get branched when they revert to binary.
If the target of an integrate/branch does not yet exist it gets the filetype of the original (in your case text).
If it already exists (in your case probably binary) then the filetype change of the source file does not get integrated - in your case the target still has filetype "binary".
In order to integrate the filetype change from the source file to the target you need the "-t" option when calling "p4 integrate".
It's good practice to always call "p4 integrate" with option "-t".
I am using Tortoise SVN 1.6.16 in Windows 7. If I have a certain file type I want to exclude from future commits, I thought I could just go find a file of that type within my working folder, then right click it, and select "TortoiseSVN->Delete and Add to Ignore List->*.ext" where ext is the file extension of the file I clicked, as shown in the image below.
However, when I do this, it only excludes that specific file, and the next time I commit, all other files of that type still come up in the list to commit.
Am I doing something wrong? How can I just tell Tortoise or SVN to ignore all files of a certain type from future commits?
I had the same hunch as #Stefan: that you were probably seeing files in subdirectories and thinking those should have also been ignored even though you only applied the ignore to a single folder.
So if that is in fact the case, here is the recipe:
When you want to ignore files or patterns from a single directory:
Use the convenience menu command to add to the ignore list.
When you want to ignore files or patterns from a subtree:
Open the subversion properties (TortoiseSVN >> Properties) of the root of the subtree. Add or edit an entry for the svn:ignore keyword. The illustration shows an example where I have specified to ignore an obj subfolder as well as all files with a .user or .bak extension.
The secret, though, is in the specification--when you define the patterns to ignore, select the recursive choice as indicated here:
Unfortunately, there is one catch to this method: In my example, I had previously specified to ignore obj and *.user and I was adding just the *.bak pattern. When I apply recursively, it does not apply just the change (*.bak) but everything in the svn:ignore keyword (obj, *.user, and *.bak) to all subfolders. That may or may not be what you want, so be aware of it.
It ignores all bat files right, but not recursively! It only ignores them in the folder you added it to the ignore list.
You could also use Tortoise's global ignore pattern (if it's applicable to all your working copies):
TortoiseSVN -> Settings
General
Fill out the "Global ignore pattern" field, such as adding "*.ext" at the end of it, separating entries with a space.