threads / discuss / 22774

Explicitly adding ignored files in subdirectories not working

Subject: Explicitly adding ignored files in subdirectories not working

## tl;dr

8 messages between Feb 23, 2010 and Feb 27, 2010.

replies: 7people: 4as markdown or json

Sverre Rabbelier· Feb 23, 2010, 21:07 UTC · lore
Heya,

I've been bitten by this before, is this behavior intentional? We don't even warn that the user's action was ignored; at the very least we should do that. The current behavior is just frustrating.

sverre@laptop-sverre:~/code$ git init ignoretest
Initialized empty Git repository in /home/sverre/code/ignoretest/.git/
sverre@laptop-sverre:~/code$ cd ignoretest/
sverre@laptop-sverre:~/code/ignoretest$ mkdir subdir
sverre@laptop-sverre:~/code/ignoretest$ echo "hi" >> subdir/a.txt
sverre@laptop-sverre:~/code/ignoretest$ echo "subdir" >> .gitignore
sverre@laptop-sverre:~/code/ignoretest$ git add .gitignore
sverre@laptop-sverre:~/code/ignoretest$ git commit -m "set up ignore"
[master (root-commit) 5a5a614] set up ignore
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
sverre@laptop-sverre:~/code/ignoretest$ git add subdir/a.txt
sverre@laptop-sverre:~/code/ignoretest$ git status
# On branch master
nothing to commit (working directory clean)
-- 
Cheers,

Sverre Rabbelier
Johannes Schindelin· Feb 23, 2010, 21:50 UTC · re: Sverre Rabbelier · lore

Re: Explicitly adding ignored files in subdirectories not working

Hi,
On Tue, 23 Feb 2010, Sverre Rabbelier wrote:
> I've been bitten by this before, is this behavior intentional? We
> don't even warn that the user's action was ignored; at the very least
> we should do that. The current behavior is just frustrating.
I get something like this:

-- snip -- $ cd Documentation $ touch doc.dep $ git add doc.dep The following paths are ignored by one of your .gitignore files: Documentation/doc.dep Use -f if you really want to add them. fatal: no files added -- snap --

Ciao, Dscho

Sverre Rabbelier· Feb 23, 2010, 21:58 UTC · re: Johannes Schindelin · lore

Re: Explicitly adding ignored files in subdirectories not working

Heya,

On Tue, Feb 23, 2010 at 22:50, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 7 quoted lines
> $ cd Documentation
> $ touch doc.dep
> $ git add doc.dep
> The following paths are ignored by one of your .gitignore files:
> Documentation/doc.dep
> Use -f if you really want to add them.
> fatal: no files added

Do you have Documentation ignored? It works fine for ignored files, files in _ignored directories_ however... :)

-- 
Cheers,

Sverre Rabbelier
Johannes Schindelin· Feb 23, 2010, 22:11 UTC · re: Sverre Rabbelier · lore

Re: Explicitly adding ignored files in subdirectories not working

Hi,
On Tue, 23 Feb 2010, Sverre Rabbelier wrote:
Show 12 quoted lines
> On Tue, Feb 23, 2010 at 22:50, Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
> > $ cd Documentation
> > $ touch doc.dep
> > $ git add doc.dep
> > The following paths are ignored by one of your .gitignore files:
> > Documentation/doc.dep
> > Use -f if you really want to add them.
> > fatal: no files added
> 
> Do you have Documentation ignored? It works fine for ignored files,
> files in _ignored directories_ however... :)
Ah, that's what I missed...

Sorry, Dscho

Jeff King· Feb 24, 2010, 04:59 UTC · re: Sverre Rabbelier · lore

Re: Explicitly adding ignored files in subdirectories not working

On Tue, Feb 23, 2010 at 10:07:52PM +0100, Sverre Rabbelier wrote:
> I've been bitten by this before, is this behavior intentional? We
> don't even warn that the user's action was ignored; at the very least
> we should do that. The current behavior is just frustrating.

It is intentional to consider them ignored (but was broken prior to v1.7.0), but it is a bug not to complain to the user. See:

  http://thread.gmane.org/gmane.comp.version-control.git/140405
-Peff
Sverre Rabbelier· Feb 27, 2010, 12:59 UTC · re: Jeff King · lore

Re: Explicitly adding ignored files in subdirectories not working

Heya,
On Wed, Feb 24, 2010 at 05:59, Jeff King <peff@peff.net> wrote:
>  http://thread.gmane.org/gmane.comp.version-control.git/140405

Peff, IIRC from that thread was left to die with you handing over to Junio? Junio, do you intend to investigate what's going on there?

-- 
Cheers,

Sverre Rabbelier
Junio C Hamano· Feb 27, 2010, 16:58 UTC · re: Sverre Rabbelier · lore

Re: Explicitly adding ignored files in subdirectories not working

Sverre Rabbelier <srabbelier@gmail.com> writes:
>> http://thread.gmane.org/gmane.comp.version-control.git/140405
>
> Peff, IIRC from that thread was left to die with you handing over to
> Junio? Junio, do you intend to investigate what's going on there?

The thread is still in my inbox but haven't had a chance to allocate enough time to look at the issue yet.

Sverre Rabbelier· Feb 27, 2010, 17:03 UTC · re: Junio C Hamano · lore

Re: Explicitly adding ignored files in subdirectories not working

Heya,
On Sat, Feb 27, 2010 at 17:58, Junio C Hamano <gitster@pobox.com> wrote:
> The thread is still in my inbox but haven't had a chance to allocate
> enough time to look at the issue yet.
Understandable, I'll be patient until then :).
-- 
Cheers,

Sverre Rabbelier

← back to recent threads