All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Cc: git@vger.kernel.org, peff@peff.net
Subject: Re: [PATCH (Apple Git) 12/13] Enable support for Xcode.app-bundled gitconfig
Date: Tue, 29 Jan 2019 15:10:30 -0800	[thread overview]
Message-ID: <xmqqo97z5ac9.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190129193818.8645-13-jeremyhu@apple.com> (Jeremy Huddleston Sequoia's message of "Tue, 29 Jan 2019 11:38:18 -0800")

Jeremy Huddleston Sequoia <jeremyhu@apple.com> writes:

> Useful for setting up osxkeychain in Xcode.app's gitconfig
>
> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
> ---

A concern shared with 13/13 is this.

While it may not hurt too much to look at one extra location even on
non-Apple platform, it probably is a mistake to have this xcode
specific change in generic part of the system like config.c or
attr.c.  For that matter, would it make sense to force Apple uses to
look at one extra location in the first place?  In other words, we
already have "system wide" location (i.e. system_path(ETC_GITCONFIG))
defined so system owners can give reasonable default to its users.
The value of not using that facility and instead adding yet another
place is dubious.


  




>  config.c | 13 +++++++++++++
>  config.h |  2 ++
>  2 files changed, 15 insertions(+)
>
> diff --git a/config.c b/config.c
> index ff521eb27a..656bfef8ab 100644
> --- a/config.c
> +++ b/config.c
> @@ -1631,6 +1631,14 @@ const char *git_etc_gitconfig(void)
>  	return system_wide;
>  }
>  
> +const char *git_xcode_gitconfig(void)
> +{
> +	static const char *xcode_config;
> +	if (!xcode_config)
> +		xcode_config = system_path("share/git-core/gitconfig");
> +	return xcode_config;
> +}
> +
>  /*
>   * Parse environment variable 'k' as a boolean (in various
>   * possible spellings); if missing, use the default value 'def'.
> @@ -1673,6 +1681,11 @@ static int do_git_config_sequence(const struct config_options *opts,
>  	else
>  		repo_config = NULL;
>  
> +	current_parsing_scope = CONFIG_SCOPE_XCODE;
> +	if (git_config_system() && git_xcode_gitconfig() && !access_or_die(git_xcode_gitconfig(), R_OK, 0))
> +		ret += git_config_from_file(fn, git_xcode_gitconfig(),
> +					    data);
> +
>  	current_parsing_scope = CONFIG_SCOPE_SYSTEM;
>  	if (git_config_system() && !access_or_die(git_etc_gitconfig(), R_OK, 0))
>  		ret += git_config_from_file(fn, git_etc_gitconfig(),
> diff --git a/config.h b/config.h
> index ee5d3fa7b4..f848423d28 100644
> --- a/config.h
> +++ b/config.h
> @@ -115,6 +115,7 @@ extern int git_config_rename_section_in_file(const char *, const char *, const c
>  extern int git_config_copy_section(const char *, const char *);
>  extern int git_config_copy_section_in_file(const char *, const char *, const char *);
>  extern const char *git_etc_gitconfig(void);
> +extern const char *git_xcode_gitconfig(void);
>  extern int git_env_bool(const char *, int);
>  extern unsigned long git_env_ulong(const char *, unsigned long);
>  extern int git_config_system(void);
> @@ -131,6 +132,7 @@ enum config_scope {
>  	CONFIG_SCOPE_GLOBAL,
>  	CONFIG_SCOPE_REPO,
>  	CONFIG_SCOPE_CMDLINE,
> +	CONFIG_SCOPE_XCODE,
>  };
>  
>  extern enum config_scope current_config_scope(void);

  reply	other threads:[~2019-01-29 23:10 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29 19:38 [PATCH (Apple Git) 00/13] Differences between git-2.20.1 and Apple Git-116 Jeremy Huddleston Sequoia
2019-01-29 19:38 ` [PATCH (Apple Git) 01/13] .gitignore: Remove *.s as it matches *.S on case insensitive filesystem Jeremy Huddleston Sequoia
2019-01-30 11:33   ` Eric Sunshine
2019-01-30 11:37     ` Jeremy Huddleston Sequoia
2019-01-30 12:29       ` Eric Sunshine
2019-01-30 12:32         ` Eric Sunshine
2019-01-30 12:42       ` Johannes Schindelin
2019-01-30 19:13         ` Jeremy Huddleston Sequoia
2019-01-31 17:57           ` Junio C Hamano
2019-01-31 18:17             ` Jeremy Sequoia
2019-01-31 19:48               ` Eric Sunshine
2019-01-30 16:47   ` Junio C Hamano
2019-01-29 19:38 ` [PATCH (Apple Git) 02/13] test-lib: Export PERL5LIB for testing git-svn Jeremy Huddleston Sequoia
2019-01-29 22:47   ` Junio C Hamano
2019-01-29 23:46     ` Jeremy Huddleston Sequoia
2019-01-29 23:59       ` SZEDER Gábor
2019-01-30  0:01         ` Jeremy Sequoia
2019-01-30 18:59           ` Junio C Hamano
2019-01-30  0:07         ` Carlo Arenas
2019-01-30 12:51       ` Johannes Schindelin
2019-01-30 18:45         ` Jeremy Sequoia
2019-01-29 19:38 ` [PATCH (Apple Git) 03/13] t0500: New regression test for git add of a path that contains a .git directory Jeremy Huddleston Sequoia
2019-01-30 11:47   ` Eric Sunshine
2019-01-30 13:12   ` Johannes Schindelin
2019-01-30 19:04     ` Jeremy Huddleston Sequoia
2019-01-29 19:38 ` [PATCH (Apple Git) 04/13] t4014: git --version can have SP in it Jeremy Huddleston Sequoia
2019-01-29 22:58   ` Junio C Hamano
2019-01-30 13:30   ` Johannes Schindelin
2019-01-29 19:38 ` [PATCH (Apple Git) 05/13] t5701: " Jeremy Huddleston Sequoia
2019-01-30 13:36   ` Johannes Schindelin
2019-01-30 19:35     ` Jeremy Huddleston Sequoia
2019-01-29 19:38 ` [PATCH (Apple Git) 06/13] Set Apple Git version during build Jeremy Huddleston Sequoia
2019-01-30 13:43   ` Johannes Schindelin
2019-01-30 19:45     ` Jeremy Huddleston Sequoia
2019-01-29 19:38 ` [PATCH (Apple Git) 07/13] HTML documentation is not provided with Apple's git. Make the error message more on point Jeremy Huddleston Sequoia
2019-01-29 23:01   ` Junio C Hamano
2019-01-30 13:45     ` Johannes Schindelin
2019-01-30 16:50       ` Junio C Hamano
2019-01-30 19:34         ` Johannes Schindelin
2019-01-29 19:38 ` [PATCH (Apple Git) 08/13] git mergetool/difftool doesn't list 'opendiff' as an available tool on 10.8 Jeremy Huddleston Sequoia
2019-01-30 19:07   ` Johannes Schindelin
2019-01-29 19:38 ` [PATCH (Apple Git) 09/13] Use symbolic links rather than hard links for files in libexec Jeremy Huddleston Sequoia
2019-01-30  9:50   ` brian m. carlson
2019-01-30 11:41     ` Jeremy Huddleston Sequoia
2019-01-30 19:15       ` Johannes Schindelin
2019-01-30 20:52         ` Jeremy Huddleston Sequoia
2019-01-29 19:38 ` [PATCH (Apple Git) 10/13] Support for Xcode.app co-exestince and relocation Jeremy Huddleston Sequoia
2019-01-30 19:26   ` Johannes Schindelin
2019-01-30 21:07     ` Jeremy Huddleston Sequoia
2019-01-29 19:38 ` [PATCH (Apple Git) 11/13] Fix problem found from running the test suite Jeremy Huddleston Sequoia
2019-01-29 23:12   ` Junio C Hamano
2019-01-29 23:30   ` Eric Wong
2019-01-29 19:38 ` [PATCH (Apple Git) 12/13] Enable support for Xcode.app-bundled gitconfig Jeremy Huddleston Sequoia
2019-01-29 23:10   ` Junio C Hamano [this message]
2019-01-29 23:51     ` Jeremy Huddleston Sequoia
2019-01-30 19:32       ` Johannes Schindelin
2019-01-30 21:09         ` Jeremy Huddleston Sequoia
2019-01-30 22:01           ` Jeremy Huddleston Sequoia
2019-01-31  0:01             ` Jonathan Nieder
2019-01-31  8:29               ` Jeremy Huddleston Sequoia
2019-01-31 18:06           ` Junio C Hamano
2019-01-30  9:44     ` brian m. carlson
2019-01-29 19:38 ` [PATCH (Apple Git) 13/13] Enable support for Xcode.app-bundled gitattributes Jeremy Huddleston Sequoia

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqo97z5ac9.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jeremyhu@apple.com \
    --cc=peff@peff.net \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.