| Summary: | Git ignores (almost) all makefiles in subdirectories ./regress/* | ||
|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Torben <Torben.Hansen.2015> |
| Component: | Build system | Assignee: | Assigned to nobody <unassigned-bugs> |
| Status: | NEW --- | ||
| Severity: | enhancement | CC: | bugtrack, djm |
| Priority: | P5 | ||
| Version: | 7.7p1 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
Torben
2018-07-03 10:47:08 AEST
Hi Torben,
I can't reproduce this. E.g.
$ pwd
/Users/djm/cvs/openssh
$ echo foo >> regress/misc/Makefile
$ git diff
diff --git a/regress/misc/Makefile b/regress/misc/Makefile
index 14c0c279..07a8f1c2 100644
--- a/regress/misc/Makefile
+++ b/regress/misc/Makefile
@@ -1,3 +1,4 @@
SUBDIR= kexfuzz
.include <bsd.subdir.mk>
+foo
Moreover the behaviour you describe seems at odds with this line from the manual for gitignore:
> 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 location
> of the .gitignore file (relative to the toplevel of the work tree if not
> from a .gitignore file).
Hi Damien
I see the same behaviour. However, If the file is not tracked, then I experience a different behaviour. If you, say, create a new git repository with the OpenSSH source files and wants to start tracking all files, then the makefiles will be ignored.
Toy example below
$ pwd
/Users/himsen/tmp
$ mkdir test_root test_root/test_subdir
$ cd test_root
$ git init
$ echo test >> test_subdir/Makefile
$ echo Makefile >> .gitignore
$ git add test_subdir/Makefile
The following paths are ignored by one of your .gitignore files:
test_subdir/Makefile
Use -f if you really want to add them.
Or, in your OpenSSH repository, you can do
$ git rm --cached regress/unittests/Makefile
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: regress/unittests/Makefile
seeing that regress/unittests/Makefile does not appear as untracked.
This extract from the Git manual explains that there is indeed a recursive thing going on: "Patterns read from a .gitignore file in the same directory as the path, or in any parent directory, with patterns in the higher level files (up to the toplevel of the work tree) being overridden by those in lower level files down to the directory containing the file. [...]" The correct if to ignore only Makefile subject of creation, i.e. those listed AC_CONFIG_FILES. Current "ignore" file does not follow this rule. So can not understand some comments on this issue. |