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

Not respecting .gitignore? #43

Closed
rstacruz opened this Issue Jun 17, 2012 · 10 comments

Comments

Projects
None yet
4 participants
@rstacruz

rstacruz commented Jun 17, 2012

The readme says "It ignores files matched by patterns in your .gitignore and .hgignore." I can't make this work, however.

I tried running ag hello in a Git repo where /logs/*.log is .gitignored. Doing git grep hello works as expected, but ag hello seems to scan logs/development.log for the word.

@ggreer

This comment has been minimized.

Show comment
Hide comment
@ggreer

ggreer Jun 18, 2012

Owner

Thanks for submitting this bug report, but can you give me more info? It'd be handy to see:

  • The line in your .gitignore that ignores the log files.
  • The paths to the .gitignore file and log file.
  • The parameters you're passing to ag and the directory you're running it in.

Without this information, it's really hard for me to reproduce the bug. If I can't reproduce it, I can't fix it.

Owner

ggreer commented Jun 18, 2012

Thanks for submitting this bug report, but can you give me more info? It'd be handy to see:

  • The line in your .gitignore that ignores the log files.
  • The paths to the .gitignore file and log file.
  • The parameters you're passing to ag and the directory you're running it in.

Without this information, it's really hard for me to reproduce the bug. If I can't reproduce it, I can't fix it.

@rstacruz

This comment has been minimized.

Show comment
Hide comment
@rstacruz

rstacruz Jun 18, 2012

In the report above, the ignore line is /logs/*.log. The command was ag hello. It was ran on the git repo. It's easily-reproduceable too:

rstacruz commented Jun 18, 2012

In the report above, the ignore line is /logs/*.log. The command was ag hello. It was ran on the git repo. It's easily-reproduceable too:

@rstacruz

This comment has been minimized.

Show comment
Hide comment
@rstacruz

rstacruz Jun 18, 2012

I deleted my long paste comment and put it in a gist here. I hope this helps. https://gist.github.com/ef4af99306276aa31637

rstacruz commented Jun 18, 2012

I deleted my long paste comment and put it in a gist here. I hope this helps. https://gist.github.com/ef4af99306276aa31637

@ggreer

This comment has been minimized.

Show comment
Hide comment
@ggreer

ggreer Jun 18, 2012

Owner

Thanks for giving me a failure case.

echo "/logs/*.log" > .gitignore

I'm just running fnmatch on the lines, so specifying a path doesn't work. I knew git allowed paths but totally spaced on adding support for it.

Fixing this will probably take me a little while. Be patient.

Owner

ggreer commented Jun 18, 2012

Thanks for giving me a failure case.

echo "/logs/*.log" > .gitignore

I'm just running fnmatch on the lines, so specifying a path doesn't work. I knew git allowed paths but totally spaced on adding support for it.

Fixing this will probably take me a little while. Be patient.

@ghost ghost assigned ggreer Jun 18, 2012

@rstacruz

This comment has been minimized.

Show comment
Hide comment
@rstacruz

rstacruz Jun 18, 2012

These gitignore lines don't work with ag either:

/logs
/logs/
logs/*
/logs/file.log
logs/file.log

These work:

logs
file.log

...all of these will ignore the file in question in Git.

rstacruz commented Jun 18, 2012

These gitignore lines don't work with ag either:

/logs
/logs/
logs/*
/logs/file.log
logs/file.log

These work:

logs
file.log

...all of these will ignore the file in question in Git.

@ggreer

This comment has been minimized.

Show comment
Hide comment
@ggreer

ggreer Jul 13, 2012

Owner

Just FYI, I haven't forgotten about this issue. Fixing it requires quite a few changes, since scandir() doesn't pass the current path to the filter function that it calls on each directory entry. I might start off with a half-assed fix that uses a global, but I'd prefer to make this easier to parallelize. The right solution is to write my own scandir().

But replacing scandir with my own equivalent might cause some problems.

Owner

ggreer commented Jul 13, 2012

Just FYI, I haven't forgotten about this issue. Fixing it requires quite a few changes, since scandir() doesn't pass the current path to the filter function that it calls on each directory entry. I might start off with a half-assed fix that uses a global, but I'd prefer to make this easier to parallelize. The right solution is to write my own scandir().

But replacing scandir with my own equivalent might cause some problems.

@cabello

This comment has been minimized.

Show comment
Hide comment
@cabello

cabello Jul 15, 2012

Contributor

I was having this issue, I sent you a pull request trying to help you to close it.

Contributor

cabello commented Jul 15, 2012

I was having this issue, I sent you a pull request trying to help you to close it.

ggreer added a commit that referenced this issue Jul 16, 2012

Merge pull request #48 from cabello/master
First attempt to close issue #43
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Aug 6, 2012

Same problem here.

ghost commented Aug 6, 2012

Same problem here.

@ggreer

This comment has been minimized.

Show comment
Hide comment
@ggreer

ggreer Aug 29, 2012

Owner

Ok, this should be fixed now.

Owner

ggreer commented Aug 29, 2012

Ok, this should be fixed now.

@ggreer ggreer closed this Aug 29, 2012

@jmuheim

This comment has been minimized.

Show comment
Hide comment
@jmuheim

jmuheim Aug 29, 2012

Thank you!

jmuheim commented Aug 29, 2012

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment