From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH 3/4] Move Windows-specific config settings into compat/mingw.c
Date: Tue, 30 Oct 2018 11:40:06 -0700 (PDT) [thread overview]
Message-ID: <62813ef54647bb224a20208124d7d763bd9789d5.1540924800.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.62.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
cache.h | 8 --------
compat/mingw.c | 18 ++++++++++++++++++
config.c | 8 --------
environment.c | 1 -
4 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/cache.h b/cache.h
index f7fabdde8..0ce95c5a8 100644
--- a/cache.h
+++ b/cache.h
@@ -906,14 +906,6 @@ int use_optional_locks(void);
extern char comment_line_char;
extern int auto_comment_line_char;
-/* Windows only */
-enum hide_dotfiles_type {
- HIDE_DOTFILES_FALSE = 0,
- HIDE_DOTFILES_TRUE,
- HIDE_DOTFILES_DOTGITONLY
-};
-extern enum hide_dotfiles_type hide_dotfiles;
-
enum log_refs_config {
LOG_REFS_UNSET = -1,
LOG_REFS_NONE = 0,
diff --git a/compat/mingw.c b/compat/mingw.c
index 293f286af..272d5e11e 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -6,6 +6,7 @@
#include "../run-command.h"
#include "../cache.h"
#include "win32/lazyload.h"
+#include "../config.h"
#define HCAST(type, handle) ((type)(intptr_t)handle)
@@ -203,8 +204,25 @@ static int ask_yes_no_if_possible(const char *format, ...)
}
}
+/* Windows only */
+enum hide_dotfiles_type {
+ HIDE_DOTFILES_FALSE = 0,
+ HIDE_DOTFILES_TRUE,
+ HIDE_DOTFILES_DOTGITONLY
+};
+
+static enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
+
int mingw_core_config(const char *var, const char *value, void *cb)
{
+ if (!strcmp(var, "core.hidedotfiles")) {
+ if (value && !strcasecmp(value, "dotgitonly"))
+ hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
+ else
+ hide_dotfiles = git_config_bool(var, value);
+ return 0;
+ }
+
return 0;
}
diff --git a/config.c b/config.c
index 646b6cca9..5bf19a23c 100644
--- a/config.c
+++ b/config.c
@@ -1344,14 +1344,6 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
return 0;
}
- if (!strcmp(var, "core.hidedotfiles")) {
- if (value && !strcasecmp(value, "dotgitonly"))
- hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
- else
- hide_dotfiles = git_config_bool(var, value);
- return 0;
- }
-
if (!strcmp(var, "core.partialclonefilter")) {
return git_config_string(&core_partial_clone_filter_default,
var, value);
diff --git a/environment.c b/environment.c
index 3f3c8746c..30ecd4e78 100644
--- a/environment.c
+++ b/environment.c
@@ -71,7 +71,6 @@ int core_apply_sparse_checkout;
int merge_log_config = -1;
int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
unsigned long pack_size_limit_cfg;
-enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
enum log_refs_config log_all_ref_updates = LOG_REFS_UNSET;
#ifndef PROTECT_HFS_DEFAULT
--
gitgitgadget
next prev parent reply other threads:[~2018-10-30 18:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 18:40 [PATCH 0/4] mingw: prevent external PERL5LIB from interfering Johannes Schindelin via GitGitGadget
2018-10-30 18:40 ` [PATCH 1/4] config: rename `dummy` parameter to `cb` in git_default_config() Johannes Schindelin via GitGitGadget
2018-10-30 18:40 ` [PATCH 2/4] Allow for platform-specific core.* config settings Johannes Schindelin via GitGitGadget
2018-10-30 18:40 ` Johannes Schindelin via GitGitGadget [this message]
2018-10-30 18:40 ` [PATCH 4/4] mingw: unset PERL5LIB by default Johannes Schindelin via GitGitGadget
2018-10-31 3:44 ` [PATCH 0/4] mingw: prevent external PERL5LIB from interfering Junio C Hamano
2018-10-31 11:04 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=62813ef54647bb224a20208124d7d763bd9789d5.1540924800.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).