Re: [PATCH] Respect crlf attribute in "git add" even if core.autocrlf has not been set
- From
Avery Pennarun <apenwarr@gmail.com>
- Date
- Jul 24, 2008, 16:44 UTC
- Message-ID
- <32541b130807240944s6b4abd60j4ff95eccf7017770@mail.gmail.com>
- In-Reply-To
- <465DE5CD-DA13-42B4-B0D8-961F3D118F59@zib.de>
On 7/24/08, Steffen Prohaska <prohaska@zib.de> wrote:
> Why is it unset? Since 1.5.5, our installer sets core.autocrlf=true > on Windows. So we *do* set a sane default for Windows users.
Well, if you've been following the thread, not everyone uses msysGit, and cygwin Git doesn't set autocrlf by default, and changing such things behind people's backs can be really nasty.
So I can't decide if I mean the following as a joke or not ;)
diff --git a/builtin-init-db.c b/builtin-init-db.c index 38b4fcb..91b79dd 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -314,10 +314,19 @@ int init_db(const char *template_dir, unsigned int flags) } if (!(flags & INIT_DB_QUIET)) + { printf("%s%s Git repository in %s/\n", reinit ? "Reinitialized existing" : "Initialized empty", shared_repository ? " shared" : "", get_git_dir()); +#ifdef _WIN32 + if (!auto_crlf) + printf("WARNING: You're using Windows but core.autocrlf is not set!\n"); +#else + if (auto_crlf) + printf("WARNING: You're not using Windows but core.autocrlf is set!\n"); +#endif + } return 0; }