Most users will set it to ~/.gitsomething. ~/.gitignore would conflict with per-directory ignore file if ~/ is managed by Git, so ~/.gitexcludes is a sane default. Signed-off-by: Matthieu Moy <Matthieu.Moy@xxxxxxx> --- Change since v1 : just changed gitignore -> gitexcludes. Documentation/config.txt | 1 + dir.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 39d1226..13871a6 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -384,6 +384,7 @@ core.excludesfile:: of files which are not meant to be tracked. "~/" is expanded to the value of `$HOME` and "~user/" to the specified user's home directory. See linkgit:gitignore[5]. + Default: ~/.gitexcludes. core.editor:: Commands such as `commit` and `tag` that lets you edit diff --git a/dir.c b/dir.c index d0999ba..cf3d8b4 100644 --- a/dir.c +++ b/dir.c @@ -914,9 +914,16 @@ void setup_standard_excludes(struct dir_struct *dir) dir->exclude_per_dir = ".gitignore"; path = git_path("info/exclude"); + if (!excludes_file) { + const char *home = getenv("HOME"); + char *user_gitignore = malloc(strlen(home) + strlen("/.gitexcludes") + 1); + strcpy(user_gitignore, home); + strcat(user_gitignore, "/.gitexcludes"); + excludes_file = user_gitignore; + } if (!access(path, R_OK)) add_excludes_from_file(dir, path); - if (excludes_file && !access(excludes_file, R_OK)) + if (!access(excludes_file, R_OK)) add_excludes_from_file(dir, excludes_file); } -- 1.6.5.3.435.g5f2e3.dirty -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html