Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

~/.gitignore with 'tags' does not work #191

Closed
sumonto opened this issue Oct 21, 2016 · 5 comments
Closed

~/.gitignore with 'tags' does not work #191

sumonto opened this issue Oct 21, 2016 · 5 comments
Labels
question An issue that is lacking clarity on one or more points.

Comments

@sumonto
Copy link

sumonto commented Oct 21, 2016

~/.gitignore with 'tags' does not work

@BurntSushi
Copy link
Owner

This ticket doesn't have enough detail for me to reproduce your problem. Could you please provide a minimal reproducible example?

For example, this works:

[andrew@Cheetah 191] echo foo > tags
[andrew@Cheetah 191] rg foo
tags
1:foo
[andrew@Cheetah 191] echo tags > .gitignore
[andrew@Cheetah 191] rg foo
No files were searched, which means ripgrep probably applied a filter you didn't expect. Try running again with --debug.

@BurntSushi BurntSushi added the question An issue that is lacking clarity on one or more points. label Oct 21, 2016
@sumonto
Copy link
Author

sumonto commented Oct 21, 2016

OS: Mac OSx

rg --version
0.2.1

$ cat ~/createtags.sh
#!/bin/bash
echo "Creating ctags files ..."
ctags -R .

------------------------------------------------------
cat ~/.gitconfig
....
[core]
    excludesfile = /Users/Sumonto/.gitignore_global
    excludesfile = /Users/Sumonto/.gitignore
....

------------------------------------------------------
$ cat ~/.gitignore
# List of excluded files
tags
------------------------------------------------------

Search for any function name
rg -p getPath

The tags file is listed and one the files.



..

@BurntSushi
Copy link
Owner

It's really hard for me to understand your reproduction. It sounds like what you're telling me is that your global .gitignore file (as specified in your ~/.gitconfig, namely, ~/.gitignore isn't intrinsically meaningful) isn't being respected, but without more information about which directories you're running rg in, it's impossible to tell what your actual problem is.

If you're saying that your global .gitignore isn't respected, then that's because ripgrep doesn't support it yet, which would make this a dupe of #9. (I'm in the process of working on ironing out a variety of ignore related problems/features, and this is one of them.)

@sumonto
Copy link
Author

sumonto commented Oct 21, 2016

Ok, I thought ~/.gitignore is supported? (.gitignore is in the home directory)
The tags file is on the root folder of a git clone.
So how do I ignore the 'tags' file?

thanks.

@BurntSushi
Copy link
Owner

Ok, I thought ~/.gitignore is supported?

Please see #9, which is about adding support for global gitignore configuration. Your ~/.gitignore isn't automatically used by git. You had to tell it to use it in your ~/.gitconfig. Please see man gitignore for the details.

So how do I ignore the 'tags' file?

Put it in an .ignore file that is in a parent directory of your clones (presumably, ~/.ignore would work).

When #9 is done, then your current setup should work out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question An issue that is lacking clarity on one or more points.
Projects
None yet
Development

No branches or pull requests

2 participants