Skip to content

gitignore: remove !*.* rule that interferes with personal exclusions #24590

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

Open
gchumillas opened this issue May 27, 2025 · 2 comments
Open
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@gchumillas
Copy link
Contributor

gchumillas commented May 27, 2025

Describe the bug

This gitignore rule (!*.*) prevents us from ignoring local files:
https://github.com/vlang/v/blob/master/.gitignore#L10

For example, I usually ignore all "test.txt" files, as I often use them to add private notes. Therefore, I add the following rule to the .git/info/exclude file:

test.*

But the !*.* rule is more relevant than the previous rules. Therefore, the previous rule has no effect.

Reproduction Steps

Add a rule to the .git/info/exclude file. For example:

test.*

Include a test.txt file into the project directory and execute the git status command:

git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        test.txt

As you can see, the test.txt file is listed in the "Untracked files" section.

Expected Behavior

The .gitignore file should not override local ignored files.

Current Behavior

The .gitignore file overrides local ignored files.

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.10 52c7130

Environment details (OS name and version, etc.)

V full version V 0.4.10 52c7130
OS macos, macOS, 15.5, 24F74
Processor 8 cpus, 64bit, little endian, Apple M1 Pro
Memory 0.96GB/16GB
V executable /Users/gonzalo/Projects/Personal/vlang/v
V last modified time 2025-05-26 22:06:31
V home dir OK, value: /Users/gonzalo/Projects/Personal/vlang
VMODULES OK, value: /Users/gonzalo/.vmodules
VTMP OK, value: /tmp/v_501
Current working dir OK, value: /Users/gonzalo/Projects/Personal/vlang
Git version git version 2.39.1
V git status 52c7130
.git/config present true
cc version Apple clang version 17.0.0 (clang-1700.0.13.3)
gcc version Apple clang version 17.0.0 (clang-1700.0.13.3)
clang version Apple clang version 17.0.0 (clang-1700.0.13.3)
tcc version tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7 (AArch64 Darwin)
tcc git status thirdparty-macos-arm64 e447816c
emcc version N/A
glibc version N/A

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@gchumillas gchumillas added the Bug This tag is applied to issues which reports bugs. label May 27, 2025
Copy link

Connected to Huly®: V_0.6-22955

@gchumillas
Copy link
Contributor Author

As a workaround we can tell git to assume .gitignore has not changed:

git update-index --assume-unchanged .gitignore

Then, we can add the files or directories we want to ignore after the !*.* rule:

# file: .gitignore
!*.*
# add here the files or directories you want to ignore
test.txt
PERSONAL_NOTES/
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant