Re: [PATCH] Respect crlf attribute in "git add" even if core.autocrlf has not been set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/24/08, Steffen Prohaska <prohaska@xxxxxx> 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;
 }
--
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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux