Re: /* in .gitignore

2012-09-25 Thread Junio C Hamano
Hilco Wijbenga writes: > Naturally, this behaviour makes perfect sense: "/*" means everything. > Still, I was wondering whether it might be a good idea to make an > exception for '.gitignore' itself? Then if somebody *really* wanted to > ignore '.gitignore' they could add "/.gitignore" to '.gitig

Re: /* in .gitignore

2012-09-25 Thread Hilco Wijbenga
On 25 September 2012 16:13, Junio C Hamano wrote: > Hilco Wijbenga writes: > >> Naturally, this behaviour makes perfect sense: "/*" means everything. >> Still, I was wondering whether it might be a good idea to make an >> exception for '.gitignore' itself? Then if somebody *really* wanted to >> i

Expanding Includes in .gitignore

2016-10-26 Thread Aaron Pelly
I want a feature. It may be a bad-idea(tm). Advice appreciated. I want git to be able to include, in its gitignore files, sub-files of ignores or have it understand a directory of ignore files. Or both. The use case for this is where I did not write my own rules, but I want to keep them updated.

Re: Expanding Includes in .gitignore

2016-10-26 Thread Stefan Beller
> The use case for this is where I did not write my own rules, but I want > to keep them updated. https://github.com/github/gitignore is a damn good > resource, but I want to pull it and include relevant bits project by > project and/or system wide. I don't want to have to update many projects > ma

Re: Expanding Includes in .gitignore

2016-10-27 Thread Alexei Lozovsky
> I'm thinking something like ". path/to/include/file" in an ignore file, > and/or creating .gitignore.d and/or allowing $HOME/.config/git/ignore > and $GIT_DIR/info/exclude to be directories. Or some sane and consistent > mixture of these things. I think the rc.d-like approach with directories is

Re: Expanding Includes in .gitignore

2016-10-27 Thread Aaron Pelly
On 27/10/16 15:22, Stefan Beller wrote: >> The use case for this is where I did not write my own rules, but I want >> to keep them updated. https://github.com/github/gitignore is a damn good >> resource, but I want to pull it and include relevant bits project by >> project and/or system wide. I don

Re: Expanding Includes in .gitignore

2016-10-27 Thread Aaron Pelly
On 27/10/16 21:19, Alexei Lozovsky wrote: >> I'm thinking something like ". path/to/include/file" in an ignore file, >> and/or creating .gitignore.d and/or allowing $HOME/.config/git/ignore >> and $GIT_DIR/info/exclude to be directories. Or some sane and consistent >> mixture of these things. > > I

Re: Expanding Includes in .gitignore

2016-10-27 Thread Jeff King
On Thu, Oct 27, 2016 at 01:22:43PM +1300, Aaron Pelly wrote: > The use case for this is where I did not write my own rules, but I want > to keep them updated. https://github.com/github/gitignore is a damn good > resource, but I want to pull it and include relevant bits project by > project and/or

Re: Expanding Includes in .gitignore

2016-10-27 Thread Jacob Keller
uot; or even "add support for .gitignore.d as well as .gitignore" One thing to keep in mind would be that we should make sure we can handle the .gitignore being a submodule or a git repository, so that users could just do something like "git submodule add .gitignore and then track git ignore contents from a repository in a nice way. By this I mean that the reading of files in .gitignore directory should exclude reading .git or other hidden files in some documented manor so as to avoid problems when linking to a git directory for its contents. Thanks, Jake > -Peff

Re: Expanding Includes in .gitignore

2016-10-27 Thread Aaron Pelly
On 27/10/16 23:50, Jeff King wrote: > I'd shy away from an actual include directive, as it raises a lot of > complications: I'm leaning that way now too. > - we parse possibly-hostile .gitignore files from cloned repositories. > What happens when I include ask to include /etc/passwd? Probab

Re: Expanding Includes in .gitignore

2016-10-27 Thread Jeff King
On Fri, Oct 28, 2016 at 09:28:23AM +1300, Aaron Pelly wrote: > > - we parse possibly-hostile .gitignore files from cloned repositories. > > What happens when I include ask to include /etc/passwd? Probably > > nothing, but there are setups where it might matter (e.g., something > > li

Re: Expanding Includes in .gitignore

2016-10-27 Thread Aaron Pelly
epository, so that > users could just do something like > > "git submodule add .gitignore and then track git ignore > contents from a repository in a nice way. > > By this I mean that the reading of files in .gitignore directory > should exclude reading .git or other hidd

Re: Expanding Includes in .gitignore

2016-10-27 Thread Jeff King
On Thu, Oct 27, 2016 at 12:48:34PM -0700, Jacob Keller wrote: > > I think the normal behavior in such "foo.d" directory is to just sort > > the contents lexically and read them in order, as if they were all > > concatenated together, and with no recursion. I.e., behave "as if" the > > user had run

Re: Expanding Includes in .gitignore

2016-10-27 Thread Jeff King
On Thu, Oct 27, 2016 at 04:55:08PM -0400, Jeff King wrote: > On Fri, Oct 28, 2016 at 09:28:23AM +1300, Aaron Pelly wrote: > > > > - we parse possibly-hostile .gitignore files from cloned repositories. > > > What happens when I include ask to include /etc/passwd? Probably > > > nothing,

Re: Expanding Includes in .gitignore

2016-10-27 Thread Aaron Pelly
On 28/10/16 10:04, Jeff King wrote: > On Thu, Oct 27, 2016 at 12:48:34PM -0700, Jacob Keller wrote: > >>> I think the normal behavior in such "foo.d" directory is to just sort >>> the contents lexically and read them in order, as if they were all >>> concatenated together, and with no recursion. I

Re: Expanding Includes in .gitignore

2016-10-27 Thread Jacob Keller
On Thu, Oct 27, 2016 at 2:04 PM, Jeff King wrote: > I'm not convinced this is needed for in-repo .gitignore files. The point > is that you are pulling together separate files that may be administered > independently. But git repositories inherently have a whole-project > view. I'm not sure that se

Re: Expanding Includes in .gitignore

2016-10-27 Thread Aaron Pelly
On 28/10/16 09:55, Jeff King wrote: > On Fri, Oct 28, 2016 at 09:28:23AM +1300, Aaron Pelly wrote: > >>> - we parse possibly-hostile .gitignore files from cloned repositories. >>> What happens when I include ask to include /etc/passwd? Probably >>> nothing, but there are setups where it

Re: Expanding Includes in .gitignore

2016-10-27 Thread Aaron Pelly
On 28/10/16 10:55, Aaron Pelly wrote: > 2) I fetch a repo with a hostile ignore file. It includes files from > $GIT_DIR/test-data/ssl/private or some such. Change. Don't pay > attention. Commit. Push. Problems if my test data comes from production. > > Is this mitigated currently? > > Not that gi

Re: Expanding Includes in .gitignore

2016-10-27 Thread Aaron Pelly
On 28/10/16 10:07, Jeff King wrote: > I think it does > introduce compatibility complications. People with older git will not > respect your .gitignore.d files. Whereas $GIT_DIR/info is purely a local > matter. I know. I don't think it's a serious compatibility issue, but more important people may

Re: Expanding Includes in .gitignore

2016-10-27 Thread Aaron Pelly
On 28/10/16 10:07, Jeff King wrote: > I think it does > introduce compatibility complications. If this is not a show stopper, I am happy to knock out a short functional spec. I'll give it some hours before I begin.

Re: Expanding Includes in .gitignore

2016-10-27 Thread Junio C Hamano
Jeff King writes: > However, as I said elsewhere, I'm not convinced this feature is all that > helpful for in-repository .gitignore files, and I think it does > introduce compatibility complications. People with older git will not > respect your .gitignore.d files. Whereas $GIT_DIR/info is purely

Re: Expanding Includes in .gitignore

2016-10-28 Thread Jeff King
On Fri, Oct 28, 2016 at 11:17:26AM +1300, Aaron Pelly wrote: > On 28/10/16 10:55, Aaron Pelly wrote: > > 2) I fetch a repo with a hostile ignore file. It includes files from > > $GIT_DIR/test-data/ssl/private or some such. Change. Don't pay > > attention. Commit. Push. Problems if my test data com

Re: Expanding Includes in .gitignore

2016-10-28 Thread Aaron Pelly
On 28/10/16 15:54, Junio C Hamano wrote: > Jeff King writes: > >> However, as I said elsewhere, I'm not convinced this feature is all that >> helpful for in-repository .gitignore files, and I think it does >> introduce compatibility complications. People with older git will not >> respect your .g

Re: Expanding Includes in .gitignore

2016-10-29 Thread Duy Nguyen
On Fri, Oct 28, 2016 at 4:04 AM, Jeff King wrote: > On Thu, Oct 27, 2016 at 12:48:34PM -0700, Jacob Keller wrote: > >> > I think the normal behavior in such "foo.d" directory is to just sort >> > the contents lexically and read them in order, as if they were all >> > concatenated together, and wit

Re: Expanding Includes in .gitignore

2016-10-29 Thread Duy Nguyen
On Fri, Oct 28, 2016 at 4:32 PM, Aaron Pelly wrote: > Or how about a new githook that can intelligently create or return the > details? This would be my least favourite option unless it was > configured in an obvious place. I wonder if smudge/clean filters can be used to recreate in-tree .gitigno

Re: Expanding Includes in .gitignore

2016-10-30 Thread Jeff King
On Fri, Oct 28, 2016 at 10:32:07PM +1300, Aaron Pelly wrote: > On 28/10/16 15:54, Junio C Hamano wrote: > > Jeff King writes: > > > >> However, as I said elsewhere, I'm not convinced this feature is all that > >> helpful for in-repository .gitignore files, and I think it does > >> introduce comp

Missing ? wildcard character in gitignore documentation

2018-01-29 Thread Jack F
Hello, I have just noticed that the documentation for gitignore is missing documentation on using the ? to match any single character. I have included a example below with git version 2.14.1. |11:05:09 j ~/Development/ls-ignore [master] $ git status On branch master Your branch is up-to-date with

Single brackets matching in .gitignore rules

2015-09-26 Thread Andrey Loskutov
Hi, I'm trying to make JGit .gitignore parser compatible to Git behavior and need help to understand some corner cases. Git seem to fail to match file names if the ignore rule contain a single bracket '[' and seem to have inconsistent behavior for a single ']'. For all experiments below I was u

submodule: allow submodule directory in gitignore

2015-10-11 Thread Aleksey Komarov
Hi all! I'm sorry if the letter came twice. I have troubles with my post client. I want to organize my repository so its submodules would be located at the root of repository. I'm trying to create .gitignore to ignore all files and don't ignore directories at the same time: $ cat .gitignore * !*

Re: [ENHANCEMENT] Allow '**' pattern in .gitignore

2012-10-02 Thread Stefano Lattarini
On 10/02/2012 09:21 AM, Ramkumar Ramachandra wrote: > Hi, > > I've often found the '**' (extended) shell glob useful for matching > any string crossing directory boundaries: it's especially useful if > you only have a toplevel .gitignore, as opposed to a per-directory > .gitignore. Unfortunately,

Re: [ENHANCEMENT] Allow '**' pattern in .gitignore

2012-10-02 Thread Ramkumar Ramachandra
Stefano Lattarini wrote: > On 10/02/2012 09:21 AM, Ramkumar Ramachandra wrote: >> Hi, >> >> I've often found the '**' (extended) shell glob useful for matching >> any string crossing directory boundaries: it's especially useful if >> you only have a toplevel .gitignore, as opposed to a per-director

Re: [ENHANCEMENT] Allow '**' pattern in .gitignore

2012-10-03 Thread Nguyen Thai Ngoc Duy
On Tue, Oct 2, 2012 at 3:24 PM, Ramkumar Ramachandra wrote: > Stefano Lattarini wrote: >> On 10/02/2012 09:21 AM, Ramkumar Ramachandra wrote: >>> Hi, >>> >>> I've often found the '**' (extended) shell glob useful for matching >>> any string crossing directory boundaries: it's especially useful if

Re: [ENHANCEMENT] Allow '**' pattern in .gitignore

2012-10-03 Thread Jens Lehmann
Am 03.10.2012 13:35, schrieb Nguyen Thai Ngoc Duy: > On Tue, Oct 2, 2012 at 3:24 PM, Ramkumar Ramachandra > wrote: >> Stefano Lattarini wrote: >>> On 10/02/2012 09:21 AM, Ramkumar Ramachandra wrote: Hi, I've often found the '**' (extended) shell glob useful for matching any st

Re: [ENHANCEMENT] Allow '**' pattern in .gitignore

2012-10-03 Thread Nguyen Thai Ngoc Duy
On Wed, Oct 3, 2012 at 8:35 PM, Jens Lehmann wrote: > */foo/bar > */*/foo/bar > */*/*/foo/bar > > Using "**/foo/bar" instead would be a great improvement If this "**/foo/bar" (i.e. no wildcards except one ** at the beginning) is popular, we could optimize this case, turning fmatch() into strncmp(

Re: [ENHANCEMENT] Allow '**' pattern in .gitignore

2012-10-03 Thread Jens Lehmann
Am 03.10.2012 15:42, schrieb Nguyen Thai Ngoc Duy: > On Wed, Oct 3, 2012 at 8:35 PM, Jens Lehmann wrote: >> */foo/bar >> */*/foo/bar >> */*/*/foo/bar >> >> Using "**/foo/bar" instead would be a great improvement > > If this "**/foo/bar" (i.e. no wildcards except one ** at the > beginning) is popu

Re: [ENHANCEMENT] Allow '**' pattern in .gitignore

2012-10-03 Thread Joshua Jensen
- Original Message - From: Nguyen Thai Ngoc Duy Date: 10/3/2012 7:42 AM On Wed, Oct 3, 2012 at 8:35 PM, Jens Lehmann wrote: */foo/bar */*/foo/bar */*/*/foo/bar Using "**/foo/bar" instead would be a great improvement If this "**/foo/bar" (i.e. no wildcards except one ** at the beginnin

RE: Missing ? wildcard character in gitignore documentation

2018-01-29 Thread Randall S. Becker
On January 29, 2018 6:30 AM, Jack F wrote: > I have just noticed that the documentation for gitignore is missing > documentation on using the ? to match any single character. I have included > a example below with git version 2.14.1. > > |11:05:09 j ~/Development/ls-ignore [master] $ git status On

Re: Missing ? wildcard character in gitignore documentation

2018-01-29 Thread Jack F
Ah. Yes it does. Apologies. Maybe a "See glob(7) for more pattern matching options, including ! ? [] *" Thank you very much. Cheers. From, Jack On 29/01/18 15:47, Randall S. Becker wrote: > On January 29, 2018 6:30 AM, Jack F wrote: >> I have just noticed that the documentation for gitignore is

Re: Missing ? wildcard character in gitignore documentation

2018-01-30 Thread Duy Nguyen
On Mon, Jan 29, 2018 at 10:47:10AM -0500, Randall S. Becker wrote: > The implication of support for ? is there through the following paragraph > from the gitignore documentation: > > "Otherwise, Git treats the pattern as a shell glob suitable for > consumption by fnmatch(3) with the FNM_P

Re: Missing ? wildcard character in gitignore documentation

2018-01-30 Thread Ævar Arnfjörð Bjarmason
On Tue, Jan 30 2018, Duy Nguyen jotted: > On Mon, Jan 29, 2018 at 10:47:10AM -0500, Randall S. Becker wrote: >> The implication of support for ? is there through the following paragraph >> from the gitignore documentation: >> >> "Otherwise, Git treats the pattern as a shell glob suitable for

Re: Missing ? wildcard character in gitignore documentation

2018-01-30 Thread Duy Nguyen
On Tue, Jan 30, 2018 at 6:07 PM, Ævar Arnfjörð Bjarmason wrote: > > On Tue, Jan 30 2018, Duy Nguyen jotted: > >> On Mon, Jan 29, 2018 at 10:47:10AM -0500, Randall S. Becker wrote: >>> The implication of support for ? is there through the following paragraph >>> from the gitignore documentation: >

Re: Single brackets matching in .gitignore rules

2015-09-27 Thread Andreas Schwab
Andrey Loskutov writes: > Next, the surprising table for ']': > -- > rule | file | match? > -- > ] ] true > ]* ] true > *] ] true > *] a]true > -- > > Here Git does no

Re: Single brackets matching in .gitignore rules

2015-09-27 Thread Andrey Loskutov
On Sunday 27 September 2015 10:58 Andreas Schwab wrote: > > ] by itself is not special in a glob. > > Andreas. > OK, this would explain the current state: once Git sees opened bracket, it always tries to parse the glob pattern and if this fails (if the bracket is not closed), the ignore rule

Re: Single brackets matching in .gitignore rules

2015-09-28 Thread Duy Nguyen
On Sun, Sep 27, 2015 at 5:01 AM, Andrey Loskutov wrote: > ... > Anyway, it would be nice to hear what should be the "right" way to interpret > the tables above. > > BTW the only official documentation I found about ignore rules: > > https://www.kernel.org/pub/software/scm/git/docs/gitignore.html

Re: Single brackets matching in .gitignore rules

2015-09-28 Thread Junio C Hamano
Duy Nguyen writes: > This is already answered. I just want to add that C Git has stopped > using system fnmatch for some time (part of the reason is system > fnmatch behaves differently in corner cases). If you don't mind C, > have a look at dowild() in wildmatch.c, or t/t3070-wildmatch.sh for >

Re: Single brackets matching in .gitignore rules

2015-09-28 Thread Andrey Loskutov
On Monday 28 September 2015 10:40 Junio C Hamano wrote: > Duy Nguyen writes: > > > This is already answered. I just want to add that C Git has stopped > > using system fnmatch for some time (part of the reason is system > > fnmatch behaves differently in corner cases). If you don't mind C, > > ha

Re: Single brackets matching in .gitignore rules

2015-09-28 Thread Junio C Hamano
Andrey Loskutov writes: > On Monday 28 September 2015 10:40 Junio C Hamano wrote: >> Duy Nguyen writes: >> >> > This is already answered. I just want to add that C Git has stopped >> > using system fnmatch for some time (part of the reason is system >> > fnmatch behaves differently in corner ca

Change in .gitignore handling: intended or bug?

2016-03-03 Thread Charles Strahan
Hello, I've found a change in the way .gitignore works, and I'm not sure if it's a bug or intended. Previously, one could use the following .gitignore: * !/foo !/foo/bar.txt !/baz !/baz/quux !/baz/quux/**/* And these files would be seen by git: foo/bar.txt baz/q

Re: submodule: allow submodule directory in gitignore

2015-10-16 Thread Aleksey Komarov
On 12.10.2015 13:30, Aleksey Komarov wrote: > Now, I'm trying to add a submodule to my repository, but fail to understand > why > my .gitignore prevents it from being added. I use the following command to > check > if my submodule will be ignored or not: > > $ git add --dry-run --ignore-missing

Re: submodule: allow submodule directory in gitignore

2015-10-17 Thread Jiang Xin
2015-10-12 14:30 GMT+08:00 Aleksey Komarov : > Hi all! > > I'm sorry if the letter came twice. I have troubles with my post client. > > I want to organize my repository so its submodules would be located at the > root > of repository. I'm trying to create .gitignore to ignore all files and don't >

Re: submodule: allow submodule directory in gitignore

2015-10-18 Thread Aleksey Komarov
On 17.10.2015 19:46, Jiang Xin wrote: > 2015-10-12 14:30 GMT+08:00 Aleksey Komarov : >> Hi all! >> >> I'm sorry if the letter came twice. I have troubles with my post client. >> >> I want to organize my repository so its submodules would be located at the >> root >> of repository. I'm trying to

git glob pattern in .gitignore and git command

2018-06-02 Thread Yubin Ruan
To ignore all .js file under a directory `lib', I can use "lib/**/js" to match them. But when using git command such as "git add", using "git add lib/\*.js" is sufficient. Why is this difference in glob mode? I have heard that there are many different glob mode out there (e.g., bash has many diffe

Re: Change in .gitignore handling: intended or bug?

2016-03-03 Thread Duy Nguyen
On Fri, Mar 4, 2016 at 9:11 AM, Charles Strahan wrote: > Hello, > > I've found a change in the way .gitignore works, and I'm not sure if > it's a bug > or intended. Can't look into this just yet. Quick question, what's the git version you're currently running? -- Duy -- To unsubscribe from this

Re: Change in .gitignore handling: intended or bug?

2016-03-03 Thread Kevin Daudt
On Thu, Mar 03, 2016 at 09:11:56PM -0500, Charles Strahan wrote: > Hello, > > I've found a change in the way .gitignore works, and I'm not sure if > it's a bug > or intended. > > Previously, one could use the following .gitignore: > > * > !/foo > !/foo/bar.txt > !/baz > !/baz

Re: Change in .gitignore handling: intended or bug?

2016-03-03 Thread Charles Strahan
I'm on 2.7.0. Here's a quick sanity check: ├── baz │   ├── quux │   │   ├── corge │   │   │   └── wibble.txt │   │   └── grault.txt │   └── waldo.txt └── foo ├── bar.txt └── garply.txt $ git --version git version 2.7.0 $ git status -sb -uall ## Initial commit on master ?? baz/quux/corge

Re: Change in .gitignore handling: intended or bug?

2016-03-04 Thread Kevin Daudt
On Fri, Mar 04, 2016 at 01:12:37AM -0500, Charles Strahan wrote: > I'm on 2.7.0. > > Here's a quick sanity check: > > ├── baz > │   ├── quux > │   │   ├── corge > │   │   │   └── wibble.txt > │   │   └── grault.txt > │   └── waldo.txt > └── foo > ├── bar.txt > └── garply.txt > > $ git --

Re: Change in .gitignore handling: intended or bug?

2016-03-04 Thread Duy Nguyen
On Fri, Mar 4, 2016 at 6:56 PM, Kevin Daudt wrote: > Verified that it's different in 2.7.0, but 2.7.2 gives expected output. Thanks. 2.7.1 reverts the faulty commit from 2.7.0 that generated two other regression reports before this one. I guess it's all good then (except for the people still on 2

Re: Change in .gitignore handling: intended or bug?

2016-03-04 Thread Junio C Hamano
Duy Nguyen writes: > On Fri, Mar 4, 2016 at 6:56 PM, Kevin Daudt wrote: >> Verified that it's different in 2.7.0, but 2.7.2 gives expected output. > > Thanks. 2.7.1 reverts the faulty commit from 2.7.0 that generated two > other regression reports before this one. I guess it's all good then > (e

Re: Change in .gitignore handling: intended or bug?

2016-03-04 Thread Junio C Hamano
Junio C Hamano writes: > Duy Nguyen writes: > >> On Fri, Mar 4, 2016 at 6:56 PM, Kevin Daudt wrote: >>> Verified that it's different in 2.7.0, but 2.7.2 gives expected output. >> >> Thanks. 2.7.1 reverts the faulty commit from 2.7.0 that generated two >> other regression reports before this one

Re: Change in .gitignore handling: intended or bug?

2016-03-04 Thread Duy Nguyen
On Sat, Mar 5, 2016 at 12:28 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Fri, Mar 4, 2016 at 6:56 PM, Kevin Daudt wrote: >>> Verified that it's different in 2.7.0, but 2.7.2 gives expected output. >> >> Thanks. 2.7.1 reverts the faulty commit from 2.7.0 that generated two >> other reg

Re: Change in .gitignore handling: intended or bug?

2016-03-04 Thread Duy Nguyen
typo fixes On Sat, Mar 5, 2016 at 7:43 AM, Duy Nguyen wrote: > On Sat, Mar 5, 2016 at 12:28 AM, Junio C Hamano wrote: >> Duy Nguyen writes: >> >>> On Fri, Mar 4, 2016 at 6:56 PM, Kevin Daudt wrote: Verified that it's different in 2.7.0, but 2.7.2 gives expected output. >>> >>> Thanks. 2.7

Re: Change in .gitignore handling: intended or bug?

2016-03-04 Thread Charles Strahan
The fix on my side was quite easy (and my .gitignore is probably a _lot_ hairier than most), and as Duy suggests, I think the new behavior makes a bit more sense. Personally, I would be pleased with keeping the new behavior, and chalking it up to an unintentional bug fix (the best kind). Either wa

Re: Change in .gitignore handling: intended or bug?

2016-03-04 Thread Junio C Hamano
Charles Strahan writes: > ...as Duy suggests, I think the new behavior makes a bit > more sense. After re-reading your original example, I am inclined to agree with this. > Either way, of course, I'd like for it to not change back and > forth between releases :). > > Perhaps just an announcemen

Re: Change in .gitignore handling: intended or bug?

2016-03-07 Thread Junio C Hamano
xcluded, the following conditions must be met: - The directory part in the re-include rules must be literal (i.e. no wildcards) +A re-inclusion of a directory makes all files in the directory +unignored. For example, suppose you have files `.gitignore`, +`dir/file1`, `dir/file2`, and `dir

Re: Change in .gitignore handling: intended or bug?

2016-03-07 Thread Junio C Hamano
gnore`, > +`dir/file1`, `dir/file2`, and `dir/file3`, and have the following in > +your `.gitignore`: > + > + > +* > +!dir > +# dir/file1 is not mentioned in .gitignore > +dir/file2 > +!dir/file3 > + > + > +Then: > + > + - `

Re: Change in .gitignore handling: intended or bug?

2016-03-08 Thread Duy Nguyen
On Tue, Mar 8, 2016 at 1:14 PM, Junio C Hamano wrote: > Junio C Hamano writes: > >> We need documentation update to settle this one before 2.8 final >> ships, as we seem to be seeing more and more end-user confusion on >> the list. I tried to come up with a trimmed-down example, which is >> show

Re: Change in .gitignore handling: intended or bug?

2016-03-08 Thread Junio C Hamano
-148,7 +148,43 @@ excluded, the following conditions must be met: be in the same .gitignore file. - The directory part in the re-include rules must be literal (i.e. no - wildcards) + wildcards and has to start with a `/`). + +A re-inclusion of a directory makes all files in the directo

Re: Change in .gitignore handling: intended or bug?

2016-03-08 Thread Duy Nguyen
On Wed, Mar 9, 2016 at 1:10 AM, Junio C Hamano wrote: > So what do we want to do for the upcoming release? I don't know. Befoire 2.8.0, all three matching cases are broken. With the current changes on 2.8.0, one case is fixed with the other cases broken. I guess it can create even more confusion.

Re: Change in .gitignore handling: intended or bug?

2016-03-08 Thread Junio C Hamano
Junio C Hamano writes: > It is between (1) the current code is good enough ... > or (2) the half-way implementation we > have does not give enough advancement ... and we > are better off reverting the whole thing to go back to 2.7.2 > behaviour, planning to do a better job in the next cycle. > >

Re: Change in .gitignore handling: intended or bug?

2016-03-08 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Mar 9, 2016 at 1:10 AM, Junio C Hamano wrote: >> So what do we want to do for the upcoming release? > > I don't know. Befoire 2.8.0, all three matching cases are broken. With > the current changes on 2.8.0, one case is fixed with the other cases > broken. I guess it

Re: Change in .gitignore handling: intended or bug?

2016-03-09 Thread Duy Nguyen
e directory > +unignored. For example, suppose you have files `.gitignore`, > +`dir/file1`, `dir/file2`, and `dir/file3`, and have the following in > +your `.gitignore`: > + > + > +# .gitignore is not mentioned in .gitignore > +* > +!/dir > +# dir/file1 is not

Re: Change in .gitignore handling: intended or bug?

2016-03-09 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Mar 9, 2016 at 1:10 AM, Junio C Hamano wrote: >> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt >> index 3ded6fd..91d1ce2 100644 >> --- a/Documentation/gitignore.txt >> +++ b/Documentation/gitignore.txt >> @@ -148,7 +148,43 @@ excluded, the fo

Re: Change in .gitignore handling: intended or bug?

2016-03-09 Thread Duy Nguyen
On Thu, Mar 10, 2016 at 1:02 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Wed, Mar 9, 2016 at 1:10 AM, Junio C Hamano wrote: >>> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt >>> index 3ded6fd..91d1ce2 100644 >>> --- a/Documentation/gitignore.txt >>> +++ b/Docu

Re: Change in .gitignore handling: intended or bug?

2016-03-09 Thread Junio C Hamano
Duy Nguyen writes: > A bit off topic, but these two paragraphs may need rephrasing, I don't > really understand what it's trying to say > > - If the pattern does not contain a slash '/', Git treats it as >a shell glob pattern and checks for a match against the >pathname relative to the l

Re: Change in .gitignore handling: intended or bug?

2016-03-09 Thread Junio C Hamano
Junio C Hamano writes: > Duy Nguyen writes: > >> A bit off topic, but these two paragraphs may need rephrasing, I don't >> really understand what it's trying to say >> >> - If the pattern does not contain a slash '/', Git treats it as >>a shell glob pattern and checks for a match against th

Re: Change in .gitignore handling: intended or bug?

2016-03-10 Thread Duy Nguyen
On Thu, Mar 10, 2016 at 7:59 AM, Junio C Hamano wrote: > In any case, back to "on topic" part again; I couldn't come up with > a better rewrite using named rules (partly because you need to > clearly define each rule before referring them, and some of the > rules are temporary workarounds for the

[PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-08 Thread Nguyễn Thái Ngọc Duy
Trailing spaces are invisible in most standard editors (*). "git diff" does show trailing spaces by default. But that does not help newly written .gitignore files. And trailing spaces are the source of frustration when writing .gitignore. So let's ignore them. Nobody sane would put a trailing spac

clarify documentation of leading "**" in gitignore(5) man page

2017-10-27 Thread David Prager Branner
I've long been confused by something in the man page for gitignore. I think it's unclear and I'd like to propose a change. The passage is this (source at https://git.kernel.org/pub/scm/git/git-manpages.git/tree/man5/gitignore.5): Two consecutive asterisks ("**") in patterns matched against ful

Re: git glob pattern in .gitignore and git command

2018-06-03 Thread Philip Oakley
Hi Yubun, From: "Yubin Ruan" To ignore all .js file under a directory `lib', I can use "lib/**/js" to match them. But when using git command such as "git add", using "git add lib/\*.js" is sufficient. Why is this difference in glob mode? I have heard that there are many different glob mode out

Re: git glob pattern in .gitignore and git command

2018-06-03 Thread Duy Nguyen
On Sun, Jun 3, 2018 at 2:58 AM, Yubin Ruan wrote: > To ignore all .js file under a directory `lib', I can use "lib/**/js" to match > them. But when using git command such as "git add", using "git add lib/\*.js" > is sufficient. Why is this difference in glob mode? Historical reasons mostly. '**'

[PATCH 8/8] Support "**" wildcard in .gitignore and .gitattributes

2012-10-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/gitignore.txt| 19 +++ attr.c | 4 +++- dir.c | 4 +++- t/t0003-attributes.sh | 38 ++ t/t3001-ls-files-others

[PATCH 13/13] Support "**" wildcard in .gitignore and .gitattributes

2012-10-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/gitignore.txt| 19 +++ dir.c | 4 +++- t/t0003-attributes.sh | 37 + t/t3001-ls-files-others-exclude.sh | 18 ++ 4 files ch

Re: [PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-08 Thread Jeff King
On Sat, Feb 08, 2014 at 03:10:02PM +0700, Nguyễn Thái Ngọc Duy wrote: > Trailing spaces are invisible in most standard editors (*). "git diff" > does show trailing spaces by default. But that does not help newly > written .gitignore files. And trailing spaces are the source of > frustration when w

Re: [PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-08 Thread Duy Nguyen
On Sat, Feb 8, 2014 at 11:45 PM, Jeff King wrote: > On Sat, Feb 08, 2014 at 03:10:02PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> Trailing spaces are invisible in most standard editors (*). "git diff" >> does show trailing spaces by default. But that does not help newly >> written .gitignore files. A

[PATCH v2 0/2] Ignore trailing spaces in .gitignore

2014-02-08 Thread Nguyễn Thái Ngọc Duy
This reroll now respects backslash quoting. Thanks Jeff and Torsten for the comments. Nguyễn Thái Ngọc Duy (2): dir: warn about trailing spaces in exclude patterns dir: ignore trailing spaces in exclude patterns Documentation/gitignore.txt | 3 +++ dir.c | 20 +

Re: [PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-09 Thread Jeff King
On Sun, Feb 09, 2014 at 06:48:18AM +0700, Duy Nguyen wrote: > > I guess by quoting you meant: > > > > echo '"trailing "' >.gitignore > > This makes " special. If we follow shell convention then things > between ".." should be literal (e.g. "*" is no longer a wildcard). We > don't support it ye

Re: [PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-09 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Trailing spaces are invisible in most standard editors (*). "git diff" > does show trailing spaces by default. But that does not help newly > written .gitignore files. And trailing spaces are the source of > frustration when writing .gitignore. > > So let's ignore

Re: [PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-09 Thread Duy Nguyen
On Mon, Feb 10, 2014 at 11:07 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> Trailing spaces are invisible in most standard editors (*). "git diff" >> does show trailing spaces by default. But that does not help newly >> written .gitignore files. And trailing spaces are the source

Re: [PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-09 Thread Junio C Hamano
Junio C Hamano writes: > Nguyễn Thái Ngọc Duy writes: > >> Trailing spaces are invisible in most standard editors (*). "git diff" >> does show trailing spaces by default. But that does not help newly >> written .gitignore files. And trailing spaces are the source of >> frustration when writing

Re: [PATCH 8/8] Support "**" wildcard in .gitignore and .gitattributes

2012-10-09 Thread Michael Haggerty
ent to "`abc/`" (which is also equivalent to "`/abc/`"). > + > + - A slash followed by two consecutive asterisks then a slash > + matches zero or more directories. For example, "`a/**/b`" > + matches "`a/b`", "`a/x/b`", "`a/x/y/b

Re: [PATCH 8/8] Support "**" wildcard in .gitignore and .gitattributes

2012-10-09 Thread Nguyen Thai Ngoc Duy
u write either > > - A trailing "/**" matches everything inside. For example, > "/abc/**" is equivalent to "`/abc/`". > > or > > - A trailing "/**" matches everything inside. For example, > "abc/**" is equivalent to "

[PATCH v4 11/12] Support "**" wildcard in .gitignore and .gitattributes

2012-10-10 Thread Nguyễn Thái Ngọc Duy
/Documentation/gitattributes.txt @@ -57,6 +57,12 @@ overrides an earlier line. This overriding is done per attribute. The rules how the pattern matches paths are the same as in `.gitignore` files; see linkgit:gitignore[5]. +Note that if a .gitignore rule matches a directory, the directory +is ignored

[PATCH v5 12/12] Support "**" wildcard in .gitignore and .gitattributes

2012-10-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/gitignore.txt| 19 +++ attr.c | 4 +++- dir.c | 4 +++- t/t0003-attributes.sh | 37 + t/t3001-ls-files-others-

Relative paths don't work in .gitignore as would be expected.

2015-02-01 Thread /#!/JoePea
're not in the root, nor do gitignore files always exist in the root of a git repo. Being able to have ./*.js in .gitignore would make much sense. /#!/JoePea -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org Mor

[PATCH 5/5] Support "**" in .gitignore and .gitattributes patterns using wildmatch()

2012-09-15 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/gitignore.txt | 3 +++ attr.c | 4 +++- dir.c | 5 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt index c1f692a..eb81d

[PATCH 5/5] Support "**" in .gitignore and .gitattributes patterns using wildmatch()

2012-09-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- Documentation/gitignore.txt| 3 +++ attr.c | 4 +++- dir.c | 5 - t/t0003-attributes.sh | 17 + t/t3001-ls-files-others-exclu

[PATCH 09/10] Support "**" in .gitignore and .gitattributes patterns using wildmatch()

2012-10-05 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- Documentation/gitignore.txt| 3 +++ attr.c | 4 +++- dir.c | 5 - t/t0003-attributes.sh | 17 + t/t3001-ls-files-others-exclu

Re: Relative paths don't work in .gitignore as would be expected.

2015-02-01 Thread Stefan Beller
On 01.02.2015 14:51, /#!/JoePea wrote: > I have this in my .gitignore: > > ./*.js > > I would expect that to cause git to ignore .js files in the same > folder as .gitignore, but it doesn't do anything. However, this works: > > /*.js > > I'm not sure what this actually means because a leadi

Re: Relative paths don't work in .gitignore as would be expected.

2015-02-02 Thread Junio C Hamano
Stefan Beller writes: > On 01.02.2015 14:51, /#!/JoePea wrote: >> I have this in my .gitignore: >> >> ./*.js >> >> I would expect that to cause git to ignore .js files in the same >> folder as .gitignore, but it doesn't do anything. However, this works: >> >> /*.js >> >> I'm not sure what

Re: Relative paths don't work in .gitignore as would be expected.

2015-02-02 Thread Stefan Beller
2015-02-02 11:15 GMT-08:00 Junio C Hamano : > Stefan Beller writes: > >> On 01.02.2015 14:51, /#!/JoePea wrote: >>> I have this in my .gitignore: >>> >>> ./*.js >>> >>> I would expect that to cause git to ignore .js files in the same >>> folder as .gitignore, but it doesn't do anything. However,

  1   2   >