{"thread":{"id":"21687","subject":"[PATCH] let core.excludesfile default to ~/.gitignore.","startedAt":"2009-11-20T13:23:50Z","lastAt":"2010-01-02T12:05:25Z","messageCount":17,"participants":["Matthieu Moy","Stefan Naewe","David Aguilar","Junio C Hamano","Michael J Gruber","Paolo Bonzini","Bert Wesarg","Nanako Shiraishi"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"128013","messageId":"1258723430-31684-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"21687","inReplyTo":null,"subject":"[PATCH] let core.excludesfile default to ~/.gitignore.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-11-20T13:23:50Z","receivedAt":"2009-11-20T13:23:50Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"It seems this is the value most users set, so let's make it the default.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\nA funny experiment:\n\nhttp://www.google.com/search?q=core.excludesfile+-%22~/.gitignore%22\nResults 1 - 10 of about 3,890 for core.excludesfile -\"~/.gitignore\"\n\nhttp://www.google.com/search?q=core.excludesfile+%22~/.gitignore%22\nResults 1 - 10 of about 7,990 for core.excludesfile \"~/.gitignore\"\n\nSo, most of the time someone mentions core.excludesfile on the web,\n~/.gitignore is mentionned right after.\n\n\nI'd have expected a place near config.c to set the default value for\nany config variable, but I can't find such thing, so I guess the\ncaller is the one that should set the default, which is what I do in\nthe patch.\n\n Documentation/config.txt |    1 +\n dir.c                    |    9 ++++++++-\n 2 files changed, 9 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 39d1226..0c55e52 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -384,6 +384,7 @@ core.excludesfile::\n \tof files which are not meant to be tracked.  \"~/\" is expanded\n \tto the value of `$HOME` and \"~user/\" to the specified user's\n \thome directory.  See linkgit:gitignore[5].\n+\tDefault: ~/.gitignore.\n \n core.editor::\n \tCommands such as `commit` and `tag` that lets you edit\ndiff --git a/dir.c b/dir.c\nindex d0999ba..dcea6ad 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -914,9 +914,16 @@ void setup_standard_excludes(struct dir_struct *dir)\n \n \tdir->exclude_per_dir = \".gitignore\";\n \tpath = git_path(\"info/exclude\");\n+\tif (!excludes_file) {\n+\t\tconst char *home = getenv(\"HOME\");\n+\t\tchar *user_gitignore = malloc(strlen(home) + strlen(\"/.gitignore\") + 1);\n+\t\tstrcpy(user_gitignore, home);\n+\t\tstrcat(user_gitignore, \"/.gitignore\");\n+\t\texcludes_file = user_gitignore;\n+\t}\n \tif (!access(path, R_OK))\n \t\tadd_excludes_from_file(dir, path);\n-\tif (excludes_file && !access(excludes_file, R_OK))\n+\tif (!access(excludes_file, R_OK))\n \t\tadd_excludes_from_file(dir, excludes_file);\n }\n \n-- \n1.6.5.2.152.gbbe9e\n"},{"id":"128018","messageId":"4B06A7EE.2090801@atlas-elektronik.com","threadId":"21687","inReplyTo":"1258723430-31684-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] let core.excludesfile default to ~/.gitignore.","fromName":"Stefan Naewe","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2009-11-20T14:30:06Z","receivedAt":"2009-11-20T14:30:06Z","isPatch":true,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"On 11/20/2009 2:23 PM, Matthieu Moy wrote:\n> It seems this is the value most users set, so let's make it the default.\n\nI like the idea but would suggest to use ~/.gitexcludes instead.\nThat way it doesn't clash with .gitignore if your $HOME is \nunder git-control.\n\nRegards\n\nStefan\n-- \n----------------------------------------------------------------\n/dev/random says: INTERLACE: To tie two boots together.\n"},{"id":"128033","messageId":"20091120185056.GB56351@gmail.com","threadId":"21687","inReplyTo":"4B06A7EE.2090801@atlas-elektronik.com","subject":"Re: [PATCH] let core.excludesfile default to ~/.gitignore.","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2009-11-20T18:50:57Z","receivedAt":"2009-11-20T18:50:57Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Nov 20, 2009 at 03:30:06PM +0100, Stefan Naewe wrote:\n> On 11/20/2009 2:23 PM, Matthieu Moy wrote:\n> > It seems this is the value most users set, so let's make it the default.\n> \n> I like the idea but would suggest to use ~/.gitexcludes instead.\n> That way it doesn't clash with .gitignore if your $HOME is \n> under git-control.\n> \n> Regards\n> \n> Stefan\n\nI second this.  I also keep my $HOME in git.\n\n\n-- \n\t\tDavid\n"},{"id":"128054","messageId":"7v6394vmlf.fsf@alter.siamese.dyndns.org","threadId":"21687","inReplyTo":"1258723430-31684-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] let core.excludesfile default to ~/.gitignore.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-20T22:49:00Z","receivedAt":"2009-11-20T22:49:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> It seems this is the value most users set, so let's make it the default.\n\nMaybe in 1.7.0, but I think using .gitignore will conflict with people who\nput the entire $HOME under git (I think they are misguided, but that is\nbesides the point), so it should use some different name.\n"},{"id":"128085","messageId":"1258840832-22130-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"21687","inReplyTo":"4B06A7EE.2090801@atlas-elektronik.com","subject":"[PATCH v2] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-11-21T22:00:32Z","receivedAt":"2009-11-21T22:00:32Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Most users will set it to ~/.gitsomething. ~/.gitignore would conflict\nwith per-directory ignore file if ~/ is managed by Git, so ~/.gitexcludes\nis a sane default.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\nChange since v1 : just changed gitignore -> gitexcludes.\n\n Documentation/config.txt |    1 +\n dir.c                    |    9 ++++++++-\n 2 files changed, 9 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 39d1226..13871a6 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -384,6 +384,7 @@ core.excludesfile::\n \tof files which are not meant to be tracked.  \"~/\" is expanded\n \tto the value of `$HOME` and \"~user/\" to the specified user's\n \thome directory.  See linkgit:gitignore[5].\n+\tDefault: ~/.gitexcludes.\n \n core.editor::\n \tCommands such as `commit` and `tag` that lets you edit\ndiff --git a/dir.c b/dir.c\nindex d0999ba..cf3d8b4 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -914,9 +914,16 @@ void setup_standard_excludes(struct dir_struct *dir)\n \n \tdir->exclude_per_dir = \".gitignore\";\n \tpath = git_path(\"info/exclude\");\n+\tif (!excludes_file) {\n+\t\tconst char *home = getenv(\"HOME\");\n+\t\tchar *user_gitignore = malloc(strlen(home) + strlen(\"/.gitexcludes\") + 1);\n+\t\tstrcpy(user_gitignore, home);\n+\t\tstrcat(user_gitignore, \"/.gitexcludes\");\n+\t\texcludes_file = user_gitignore;\n+\t}\n \tif (!access(path, R_OK))\n \t\tadd_excludes_from_file(dir, path);\n-\tif (excludes_file && !access(excludes_file, R_OK))\n+\tif (!access(excludes_file, R_OK))\n \t\tadd_excludes_from_file(dir, excludes_file);\n }\n \n-- \n1.6.5.3.435.g5f2e3.dirty\n"},{"id":"128447","messageId":"1259231726-5218-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"21687","inReplyTo":"1258840832-22130-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH (resend)] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-11-26T10:35:26Z","receivedAt":"2009-11-26T10:35:26Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Most users will set it to ~/.gitsomething. ~/.gitignore would conflict\nwith per-directory ignore file if ~/ is managed by Git, so ~/.gitexcludes\nis a sane default.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n(just resending since the patch seems to have got lost in the process)\n\n Documentation/config.txt |    1 +\n dir.c                    |    9 ++++++++-\n 2 files changed, 9 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 7ff2d1d..9fc527c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -408,6 +408,7 @@ core.excludesfile::\n \tof files which are not meant to be tracked.  \"{tilde}/\" is expanded\n \tto the value of `$HOME` and \"{tilde}user/\" to the specified user's\n \thome directory.  See linkgit:gitignore[5].\n+\tDefault: ~/.gitexcludes.\n \n core.editor::\n \tCommands such as `commit` and `tag` that lets you edit\ndiff --git a/dir.c b/dir.c\nindex 3a8d3e6..a6a6291 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -944,9 +944,16 @@ void setup_standard_excludes(struct dir_struct *dir)\n \n \tdir->exclude_per_dir = \".gitignore\";\n \tpath = git_path(\"info/exclude\");\n+\tif (!excludes_file) {\n+\t\tconst char *home = getenv(\"HOME\");\n+\t\tchar *user_gitignore = malloc(strlen(home) + strlen(\"/.gitexcludes\") + 1);\n+\t\tstrcpy(user_gitignore, home);\n+\t\tstrcat(user_gitignore, \"/.gitexcludes\");\n+\t\texcludes_file = user_gitignore;\n+\t}\n \tif (!access(path, R_OK))\n \t\tadd_excludes_from_file(dir, path);\n-\tif (excludes_file && !access(excludes_file, R_OK))\n+\tif (!access(excludes_file, R_OK))\n \t\tadd_excludes_from_file(dir, excludes_file);\n }\n \n-- \n1.6.5.3.435.g5f2e3.dirty\n"},{"id":"128454","messageId":"4B0E6DC9.3070105@drmicha.warpmail.net","threadId":"21687","inReplyTo":"1259231726-5218-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH (resend)] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-11-26T12:00:09Z","receivedAt":"2009-11-26T12:00:09Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Matthieu Moy venit, vidit, dixit 26.11.2009 11:35:\n> Most users will set it to ~/.gitsomething. ~/.gitignore would conflict\n> with per-directory ignore file if ~/ is managed by Git, so ~/.gitexcludes\n> is a sane default.\n\nI'm sorry to jump in so late, and this may sound like bike-shedding, but\nright now we have\n\n.git/info/exclude\n.gitignore\n\nand this would add\n\n~/.gitexcludes\n\nThat is, three terms, or two, where one comes in two variations\n(exclude/exludes). I always wondered why we have two.\n\nThe reason for .gitignore is most probably the similarity to\n.${othervcs}ignore, and that is a valid reason.\n\nI know we have ~/.gitconfig for the global version of .git/config, and\nmaybe that was just no good idea either. But I don't even dare\nsuggesting to rename it ~/.gitglobalconfig.\n\nSo, in line at least with our term \"global\" (per user) config, I would\nsuggest to use \"~/.gitglobalignore\" for the global ignore file. Maybe,\neventually, we'll manage to rename .git/info/excludes to .git/info/ignore.\n\nOn a somewhat larger scale, a good alternative strategy would be to have\na directory \"~/.gitglobal/\" in which Git would look for\n~/.gitglobal/config and\n~/.gitglobal/info/ignore or\n~/.gitglobal/ignore\n\ni.e. mirroring the repo structure or at least bundling everything in a\nsingle dir, which would also be a good place for a global svnauthors\nfile and such, and for other global configuration files we don't think\nof right now.\n\nMichael\n"},{"id":"128459","messageId":"helthi$8k5$1@ger.gmane.org","threadId":"21687","inReplyTo":"4B0E6DC9.3070105@drmicha.warpmail.net","subject":"Re: [PATCH (resend)] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2009-11-26T12:49:54Z","receivedAt":"2009-11-26T12:49:54Z","isPatch":true,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"On 11/26/2009 01:00 PM, Michael J Gruber wrote:\n> I'm sorry to jump in so late, and this may sound like bike-shedding, but\n> right now we have\n>\n> .git/info/exclude\n> .gitignore\n>\n> and this would add\n>\n> ~/.gitexcludes\n>\n> That is, three terms, or two, where one comes in two variations\n> (exclude/exludes). I always wondered why we have two.\n\nWould you be fine with ~/.gitexclude?\n\nPaolo\n"},{"id":"128460","messageId":"36ca99e90911260501q571929e5l114cb0af9f374a98@mail.gmail.com","threadId":"21687","inReplyTo":"4B0E6DC9.3070105@drmicha.warpmail.net","subject":"Re: [PATCH (resend)] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2009-11-26T13:01:15Z","receivedAt":"2009-11-26T13:01:15Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Thu, Nov 26, 2009 at 13:00, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Matthieu Moy venit, vidit, dixit 26.11.2009 11:35:\n>> Most users will set it to ~/.gitsomething. ~/.gitignore would conflict\n>> with per-directory ignore file if ~/ is managed by Git, so ~/.gitexcludes\n>> is a sane default.\n>\n> I'm sorry to jump in so late, and this may sound like bike-shedding, but\n> right now we have\n>\n> .git/info/exclude\n> .gitignore\n>\n> and this would add\n>\n> ~/.gitexcludes\n>\n> That is, three terms, or two, where one comes in two variations\n> (exclude/exludes). I always wondered why we have two.\n>\n> The reason for .gitignore is most probably the similarity to\n> .${othervcs}ignore, and that is a valid reason.\n>\n> I know we have ~/.gitconfig for the global version of .git/config, and\n> maybe that was just no good idea either. But I don't even dare\n> suggesting to rename it ~/.gitglobalconfig.\n>\n> So, in line at least with our term \"global\" (per user) config, I would\n> suggest to use \"~/.gitglobalignore\" for the global ignore file. Maybe,\n> eventually, we'll manage to rename .git/info/excludes to .git/info/ignore.\n>\n> On a somewhat larger scale, a good alternative strategy would be to have\n> a directory \"~/.gitglobal/\" in which Git would look for\n> ~/.gitglobal/config and\n> ~/.gitglobal/info/ignore or\n> ~/.gitglobal/ignore\n>\n> i.e. mirroring the repo structure or at least bundling everything in a\n> single dir, which would also be a good place for a global svnauthors\n> file and such, and for other global configuration files we don't think\n> of right now.\nI would vote for that too. Its more future-proof than a single new\nfile. Also I would suggest to name this dir ~/.gitrc/. On the other\nhand the --global option to git config specifies the .gitconfig in\nyour HOME.\n\nBert\n>\n> Michael\n"},{"id":"128462","messageId":"4B0E8251.7050605@drmicha.warpmail.net","threadId":"21687","inReplyTo":"helthi$8k5$1@ger.gmane.org","subject":"Re: [PATCH (resend)] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-11-26T13:27:45Z","receivedAt":"2009-11-26T13:27:45Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Paolo Bonzini venit, vidit, dixit 26.11.2009 13:49:\n> On 11/26/2009 01:00 PM, Michael J Gruber wrote:\n>> I'm sorry to jump in so late, and this may sound like bike-shedding, but\n>> right now we have\n>>\n>> .git/info/exclude\n>> .gitignore\n>>\n>> and this would add\n>>\n>> ~/.gitexcludes\n>>\n>> That is, three terms, or two, where one comes in two variations\n>> (exclude/exludes). I always wondered why we have two.\n> \n> Would you be fine with ~/.gitexclude?\n\nNot really. You see, a user tracking his $HOME will have a ~/.gitignore\nand a ~/.gitexclude then. I think we should distinguish local and global\n\"config\" files more systematically. Which is why I suggested the subdir,\nor having global in the name.\n\nMichael\n"},{"id":"128463","messageId":"4B0E8529.3040609@drmicha.warpmail.net","threadId":"21687","inReplyTo":"36ca99e90911260501q571929e5l114cb0af9f374a98@mail.gmail.com","subject":"Re: [PATCH (resend)] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-11-26T13:39:53Z","receivedAt":"2009-11-26T13:39:53Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Bert Wesarg venit, vidit, dixit 26.11.2009 14:01:\n> On Thu, Nov 26, 2009 at 13:00, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Matthieu Moy venit, vidit, dixit 26.11.2009 11:35:\n>>> Most users will set it to ~/.gitsomething. ~/.gitignore would conflict\n>>> with per-directory ignore file if ~/ is managed by Git, so ~/.gitexcludes\n>>> is a sane default.\n>>\n>> I'm sorry to jump in so late, and this may sound like bike-shedding, but\n>> right now we have\n>>\n>> .git/info/exclude\n>> .gitignore\n>>\n>> and this would add\n>>\n>> ~/.gitexcludes\n>>\n>> That is, three terms, or two, where one comes in two variations\n>> (exclude/exludes). I always wondered why we have two.\n>>\n>> The reason for .gitignore is most probably the similarity to\n>> .${othervcs}ignore, and that is a valid reason.\n>>\n>> I know we have ~/.gitconfig for the global version of .git/config, and\n>> maybe that was just no good idea either. But I don't even dare\n>> suggesting to rename it ~/.gitglobalconfig.\n>>\n>> So, in line at least with our term \"global\" (per user) config, I would\n>> suggest to use \"~/.gitglobalignore\" for the global ignore file. Maybe,\n>> eventually, we'll manage to rename .git/info/excludes to .git/info/ignore.\n>>\n>> On a somewhat larger scale, a good alternative strategy would be to have\n>> a directory \"~/.gitglobal/\" in which Git would look for\n>> ~/.gitglobal/config and\n>> ~/.gitglobal/info/ignore or\n>> ~/.gitglobal/ignore\n>>\n>> i.e. mirroring the repo structure or at least bundling everything in a\n>> single dir, which would also be a good place for a global svnauthors\n>> file and such, and for other global configuration files we don't think\n>> of right now.\n> I would vote for that too. Its more future-proof than a single new\n> file. Also I would suggest to name this dir ~/.gitrc/. \n\nNow, that is bike shedding ;)\n\nIt seems to me that all ~/.*rc that I have are config files (.bashrc,\n.xinitrc...), and all condif subdirs ~/.* are named by the\nprogram/subsystem (.qt, .kde, .gnupg), which we cannot do any more, and\nwhich is why I suggested .gitglobal. But I'd be fine with .gitrc.\n\n> On the other\n> hand the --global option to git config specifies the .gitconfig in\n> your HOME.\n\nThat would have to change (ouch, ducking). Transition plan would be:\n\n~/.gitconfig, ~/.gitrc/config::\n        User-specific configuration file. Also called \"global\"\n        configuration file. Git looks in these locations in the\n\tspecified order and uses the first one it finds.\n\n$(prefix)/etc/gitconfig, $(prefix)/etc/gitrc/config::\n        System-wide configuration file. Git looks in these locations\n\tin the specified order and uses the first one it finds.\n\nThis would mean no surprises for users with existing config, one could\nteach the new preferred locations exclusively, and at some future point\none could phase out the old paths.\n\nMichael\n"},{"id":"128486","messageId":"7vmy2987zi.fsf@alter.siamese.dyndns.org","threadId":"21687","inReplyTo":"4B0E6DC9.3070105@drmicha.warpmail.net","subject":"Re: [PATCH (resend)] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-26T18:18:57Z","receivedAt":"2009-11-26T18:18:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> I'm sorry to jump in so late, and this may sound like bike-shedding, but\n> right now we have\n>\n> .git/info/exclude\n> .gitignore\n\nThe current dir.c::setup_standard_excludes() implementation reads exclude\npatterns from \"$GIT_DIR/info/exclude\".  \n\nAs to the way forward regarding \"info/exclude\", my preference is to teach\nthe codepath to check if \"info/ignore\" exists, and read that after it\nreads from \"info/exclude\" (to give the new file a slightly higher\nprecedence if both exist).\n\nDocument that we read from both info/ignore and info/exclude immediately\nwhen this change happens.  The updated documentation probably should say\nthat \"info/exclude\" is still read and will be read forever, and tell the\nreaders that there is no difference in functionality between the two,\nother than that \"info/ignore\" is a name that is more consistent with the\n\".gitignore\" (which is the name of in-tree exclude patterns file).\n\nAnd stop there.\n\nWhile there is no reason to encourage new repositories to use info/exclude\nover info/ignore, we shouldn't stop mentioning info/exclude or declare\ndeprecation in the documentation, as doing so would:\n\n (1) scare existing users that their info/exclude file may become invalid\n     some day; and\n\n (2) puzzle new users (who inherited an already initialized repository\n     that has been maintained by somebody else from the era before this\n     change) what the info/exclude file in the repository is doing.\n\n> and this would add\n>\n> ~/.gitexcludes\n>\n> That is, three terms, or two, where one comes in two variations\n> (exclude/exludes). I always wondered why we have two.\n>\n> The reason for .gitignore is most probably the similarity to\n> .${othervcs}ignore, and that is a valid reason.\n\nI try not to get involved in bike-shedding (I removed myself from Cc), but\nthe events happened in the opposite order.\n\nOriginally we had the concept of \"exclude patterns\", in 9ff768e ([PATCH]\nGive show-files the ability to process exclusion pattern., 2005-04-28).\nThis origin is still visible in the names of command line options to\n\"ls-files\".  It was just a flat text file that is not tied to any\nparticular directory in the work tree.\n\nThen much later in f87f949 (git-ls-files: --exclude mechanism updates.,\n2005-07-24) the mechanism was extended, so that we could add per-directory\nexclude patterns.  But that was just the _ability_; its actual use in the\nPorcelains had to wait until ba966b9 (Teach git-status-script about\ngit-ls-files --others, 2005-08-26), and the commit finally established the\nname \".gitignore\" that is an in-tree, per-directory file that has exclude\npatterns.  The name was inconsistent with the established concept of\n\"excluding\", but was chosen to be similar to .scmignore.\n\nHopefully that would clear your wondering.\n"},{"id":"128499","messageId":"20091126200728.GA2665@gmail.com","threadId":"21687","inReplyTo":"4B0E8529.3040609@drmicha.warpmail.net","subject":"Re: [PATCH (resend)] Let core.excludesfile default to ~/.gitexcludes.","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2009-11-26T20:07:30Z","receivedAt":"2009-11-26T20:07:30Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Thu, Nov 26, 2009 at 02:39:53PM +0100, Michael J Gruber wrote:\n> \n> Now, that is bike shedding ;)\n> \n> It seems to me that all ~/.*rc that I have are config files (.bashrc,\n> .xinitrc...), and all condif subdirs ~/.* are named by the\n> program/subsystem (.qt, .kde, .gnupg), which we cannot do any more, and\n> which is why I suggested .gitglobal. But I'd be fine with .gitrc.\n> \n> > On the other\n> > hand the --global option to git config specifies the .gitconfig in\n> > your HOME.\n> \n> That would have to change (ouch, ducking). Transition plan would be:\n> \n> ~/.gitconfig, ~/.gitrc/config::\n>         User-specific configuration file. Also called \"global\"\n>         configuration file. Git looks in these locations in the\n> \tspecified order and uses the first one it finds.\n> \n> $(prefix)/etc/gitconfig, $(prefix)/etc/gitrc/config::\n>         System-wide configuration file. Git looks in these locations\n> \tin the specified order and uses the first one it finds.\n> \n> This would mean no surprises for users with existing config, one could\n> teach the new preferred locations exclusively, and at some future point\n> one could phase out the old paths.\n> \n> Michael\n\n\nIf we're going to bikeshed then let's throw a standard in there:\n\nhttp://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html\n\n~/.gitrc/ doesn't make sense (it's not a file) and ~/.gitglobal/\nhurts my eyes.\n\n\"global\"?  Huh?  Isn't it really user-specific?\nWhy not call it ~/.gituser/ then?\n\nAnd what about the standard?\nThe silly standard says to use ~/.config/git/.\n\n\nI'm quite happy with ~/.gitconfig and ~/.gitexclude if that's all\nthere is to git's per-user configuration abilities, especially\nsince ~/.gitexclude is less common.  _Much_ less common from\nwhat I've seen in practice.\n\nBeing that we cannot predict the future then there is some\nappeal to a top-leve ~/.config/git/-like directory.  But...\n\n\nLike Junio said, I would stop only after adding support for\nthe new paths.  We don't want to confuse old or new users\nand we should never deprecate existing ~/.gitconfig.\n\n\nSo now the \"user\" config is not just tied to one file but\nis instead multiple files?  I dunno.. I kinda don't like\nthat but the only reason is because I'm going to have to\ngo and change code to take that into account.\n\nWhen I have to change code for little added benefit\nI ask questions.\n\n\nWhat about:\n\n\t$ git config --global foo.bar baz\n\nWhat file does that touch?\n\t~/.gitconfig or ~/.config/git/config?\n\nWhat if ~/.gitconfig exists and ~/.config/git/config doesn't?\nWhat about vice versa?\n\nOkay, I also don't like it for that reason.\n\n\nWhat if you jump between git versions?  Now the previous\nquestion is much more important -- it means that we *must*\nwrite to ~/.gitconfig to keep backwards compatibility otherwise\nsomeone will config something with git-vNew and be surprised\nwhen git-vOld does not find it.\n\nAnd if we must write to ~/.gitconfig then\nwhy does ~/.config/git/config even exist?\n\n\nI guess all I'm saying is that I'm quite happy with\n~/.gitconfig and do not see a compelling reason as\nto why we'd need to transition to a different path.\n\nYes, I'm being lazy.  I don't feel like changing code\nwhen stuff works just fine right now ;-)\n\nAnd if we were to change it, then what about JGit,\nDulwich, GitSharp, etc?  Who's going to change those?\n\n\nTo quote an old famous horse, \"No sir, I don't like it.\"\n\n-- \n\t\tDavid\n"},{"id":"130552","messageId":"20091230224135.6117@nanako3.lavabit.com","threadId":"21687","inReplyTo":"1258840832-22130-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH v2] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-12-30T13:41:35Z","receivedAt":"2009-12-30T13:41:35Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Junio, could you tell us what happened to this thread?\n"},{"id":"130558","messageId":"vpqhbr8ttwv.fsf@bauges.imag.fr","threadId":"21687","inReplyTo":"20091230224135.6117@nanako3.lavabit.com","subject":"Re: [PATCH v2] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-12-30T14:31:44Z","receivedAt":"2009-12-30T14:31:44Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Nanako Shiraishi <nanako3@lavabit.com> writes:\n\n> Junio, could you tell us what happened to this thread?\n\nI'm not Junio, but I can try ...\n\nSetting a default for core.excludesfile implies that changing it later\nis hard. In particular, _if_ we chose one day to move from multiple\n$HOME/.gitsomething files to $HOME/something-else/multiple-files\n($XDG_CONFIG_HOME and $HOME/.gitglobal/{config,excludes,...} have been\nsuggested, as well as a $GIT_HOME variable), then the transition is\nmade harder by having a default.\n\nSo, while I think having a default is good, chosing the default\nshouldn't be taken lightly.\n\nI personally like the idea of a user config _directory_ with multiple\nfiles in it, but I'm not clear on exactly what it should be, how the\ntransition plan would be, ...\n\nSo, I dropped the patch until we get closer to a consensus on what the\ndefault value should be.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"130578","messageId":"7vk4w4z1h6.fsf@alter.siamese.dyndns.org","threadId":"21687","inReplyTo":"vpqhbr8ttwv.fsf@bauges.imag.fr","subject":"Re: [PATCH v2] Let core.excludesfile default to ~/.gitexcludes.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-30T19:49:25Z","receivedAt":"2009-12-30T19:49:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Nanako Shiraishi <nanako3@lavabit.com> writes:\n>\n>> Junio, could you tell us what happened to this thread?\n>\n> I'm not Junio, but I can try ...\n> ...\n> So, I dropped the patch until we get closer to a consensus on what the\n> default value should be.\n\nThanks for status updates.  Should we start trying to reach a consensus on\nhow to move forward, or is it not your itch?\n\nIt is not _too_ bad to treat ~/.gitconfig specially and support reading\nfrom ~/.$SOMEGITTTYNAME/{excludes,attributes} files.  We can also add\nsupport for ~/.$SOMEGITTYNAME/config and try reading from it as well, but\neven if we did so I don't think we should stop reading from ~/.gitconfig.\n\nI don't have strong preference myself either way.\n"},{"id":"130685","messageId":"vpqk4w0lnju.fsf_-_@bauges.imag.fr","threadId":"21687","inReplyTo":"7vk4w4z1h6.fsf@alter.siamese.dyndns.org","subject":"User-wide Git config directory (was Re: [PATCH v2] Let core.excludesfile default to ~/.gitexcludes.)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-01-02T12:05:25Z","receivedAt":"2010-01-02T12:05:25Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>\n>> Nanako Shiraishi <nanako3@lavabit.com> writes:\n>>\n>>> Junio, could you tell us what happened to this thread?\n>>\n>> I'm not Junio, but I can try ...\n>> ...\n>> So, I dropped the patch until we get closer to a consensus on what the\n>> default value should be.\n>\n> Thanks for status updates.  Should we start trying to reach a consensus on\n> how to move forward, or is it not your itch?\n\nI wouldn't say it's not my itch. But I'm not sure I'm the best person\nto do the job (job = comming close to a consensus, not writting the\ncode, which shouldn't be hard). Still, I can at least participate ;-).\n\n> It is not _too_ bad to treat ~/.gitconfig specially and support reading\n> from ~/.$SOMEGITTTYNAME/{excludes,attributes} files.\n\nLet's throw in some ideas about what ~/$SOMEGITTTYNAME/ could be :\n\n1) ~/.git/ => no, that would clash with people versioning their $HOME.\n\n2) ~/.gitconfig/ => no, there's already a file ~/.gitconfig\n\n3) ~/.gitglobal/ => that's an option.\n\n4) ~/.config/git/ or, if set, $XDG_CONFIG_HOME/git/ (see\n   http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html )\n   => my prefered one, already discussed in a different context here :\n   http://thread.gmane.org/gmane.comp.version-control.git/135447/focus=135559\n\nThen, there's the question of what to put in this directory. I can see\ntwo and a half options:\n\na) ~/.$SOMEGITTTYNAME/{excludes,attributes} as you propose.\n\na') ~/.$SOMEGITTTYNAME/{ignore,attributes} => I think \"ignore\" is the\n   advertized vocabulary most of the time in porcelain, and \"excludes\"\n   exists mostly for historical reasons.\n\nb) ~/.$SOMEGITTTYNAME/<same thing as the content of $GIT_DIR>, that\n   is:\n   ~/.$SOMEGITTTYNAME/info/exclude\n   ~/.$SOMEGITTTYNAME/info/attributes\n   and perhaps\n   ~/.$SOMEGITTTYNAME/config\n   we could imagine also\n   ~/.$SOMEGITTTYNAME/hooks\n\nIf I were really happy with the layout of $GIT_DIR, I'd vote for b)\nfor consistancy. But I'm not _that_ happy with it: why are exclude and\nattributes not in the same directory as config? why is exclude\nsingular and attributes plural?\n\nSo, I dunno.\n\n> We can also add support for ~/.$SOMEGITTYNAME/config and try reading\n> from it as well, but even if we did so I don't think we should stop\n> reading from ~/.gitconfig.\n\nYes, people having a ~/.gitconfig around should be able to continue to\nuse it (for years at least, and most likely forever).\n\nAnd you're right to present it as a different problem. Perhaps we\nshould solve the problem above before starting debating about this\none.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}