public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox•net>
To: Linus Torvalds <torvalds@linux-foundation•org>
Cc: "Karl Hasselström" <kha@treskal•com>,
	"Shawn O. Pearce" <spearce@spearce•org>,
	"Julian Phillips" <julian@quantumfyre•co.uk>,
	"Bruno Cesar Ribas" <ribas@c3sl•ufpr.br>,
	git@vger•kernel.org
Subject: Re: Git / Subversion Interoperability
Date: Sat, 24 Mar 2007 13:37:40 -0700	[thread overview]
Message-ID: <7vfy7ufkdn.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0703241258560.6730@woody.linux-foundation.org> (Linus Torvalds's message of "Sat, 24 Mar 2007 13:13:06 -0700 (PDT)")

Linus Torvalds <torvalds@linux-foundation•org> writes:

> So if your .gitignore looks like
>
> 	*.o
>
> it means that it recursively ignores all *.o files starting at that level.
>
> HOWEVER, if you write it as
>
> 	/*.o
>
> it means that it ignores *.o files only *within* that level (so it's 
> "absolute" wrt the particular .gitignore file, not globally).
>
> So you can have both behaviours.
>
> [ I think the exact behaviour is: if there is a '/' anywhere in the name, 
>   it's not a recursive match and has to match the file exactly, but 
>   somebody like Junio should probably back me up on that ]
> 		Linus

Yes, that is what dir.c::excluded_1() says.  If it does not have
'/' then fnmatch the basename, otherwise fnmatch with
FNM_PATHNAME.  So I think if you write

               /obj/*.o

you can ignore *.o files in obj/ directory (but won't ignore a/obj/b.o).

  reply	other threads:[~2007-03-24 20:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22 22:48 Git / Subversion Interoperability Bruno Cesar Ribas
2007-03-23  0:43 ` Shawn O. Pearce
2007-03-23  1:03   ` Julian Phillips
2007-03-23  1:24     ` Shawn O. Pearce
2007-03-23  1:36       ` Julian Phillips
2007-03-23 10:34         ` Karl Hasselström
2007-03-23 15:21           ` Bruno Cesar Ribas
2007-03-23 15:48             ` Karl Hasselström
2007-03-23 18:13             ` Julian Phillips
2007-03-23 19:34               ` Bruno Cesar Ribas
2007-03-23 22:05                 ` David Lang
2007-03-23 22:11                 ` Daniel Barkalow
2007-03-24  6:41           ` Shawn O. Pearce
2007-03-24 18:55             ` Karl Hasselström
2007-03-24 20:13               ` Linus Torvalds
2007-03-24 20:37                 ` Junio C Hamano [this message]
2007-03-26  3:06             ` Sam Vilain
2007-03-23 21:30     ` Christian Wiese
2007-03-23 22:00       ` Steven Grimm
2007-03-24  6:56         ` Shawn O. Pearce
2007-03-26  3:04           ` Sam Vilain
2007-03-23 14:21   ` Jakub Narebski
2007-03-24  6:45     ` Shawn O. Pearce
2007-03-24 20:38       ` Eric Wong
2007-03-24 20:31 ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vfy7ufkdn.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox$(echo .)net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=julian@quantumfyre$(echo .)co.uk \
    --cc=kha@treskal$(echo .)com \
    --cc=ribas@c3sl$(echo .)ufpr.br \
    --cc=spearce@spearce$(echo .)org \
    --cc=torvalds@linux-foundation$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox