git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC 0/5] add "unset.variable" for unsetting previously set variables
@ 2014-10-02 13:24 Tanay Abhra
  2014-10-02 13:24 ` [PATCH/RFC 1/5] config.c : move configset_iter() to an appropriate position Tanay Abhra
                   ` (6 more replies)
  0 siblings, 7 replies; 30+ messages in thread
From: Tanay Abhra @ 2014-10-02 13:24 UTC (permalink / raw)
  To: git; +Cc: Tanay Abhra, Matthieu Moy

Hi,

This series aims to add a method to filter previously set variables.
The patch series can be best described by the 3/5 log message
which I have pasted below verbatim.

"
Add a new config variable "unset.variable" which unsets previously set
variables. It affects `git_config()` and `git_config_get_*()` family
of functions. It removes the matching variables from the `configset`
which were added previously. Those matching variables which come after
the "unset.variable" in parsing order will not be deleted and will
be left untouched.

It affects the result of "git config -l" and similar calls.
It may be used in cases where the user can not access the config files,
for example, the system wide config files may be only accessible to
the system administrator. We can unset an unwanted variable declared in
the system config file by using "unset.variable" in a local config file.

for example, /etc/gitconfig may look like this,
	[foo]
		bar = baz

in the repo config file, we will write,
	[unset]
		variable  = foo.bar
to unset foo.bar previously declared in system wide config file.
"

Now, I have some points of
contention which I like to clarify,

1> The name of the variable, I could not decide between "unset.variable"
and "config.unset", or may be some other name would be more appropriate.

2> It affects both the C git_config() calls and, git config shell
invocations. Due to this some variables may be absent from the git config -l
result which might confuse the user.

3> I also have an another implementation for this series which just marks the config
variables instead of deleting them from the configset. This can be used to
provide two versions of git_config(), one with filtered variables other without
it.

4> While hacking on this series, I saw that git_config_int() does not print
the file name of the invalid variable when values are fed by the configset.
I will correct this regression in another patch.

Cheers,
Tanay


 Documentation/config.txt | 12 +++++++
 config.c                 | 93 +++++++++++++++++++++++++++++++++++++-----------
 t/t1300-repo-config.sh   | 56 ++++++++++++++++++++++++++++-
 3 files changed, 139 insertions(+), 22 deletions(-)

-- 
1.9.0.GIT

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2014-10-13 18:22 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-02 13:24 [PATCH/RFC 0/5] add "unset.variable" for unsetting previously set variables Tanay Abhra
2014-10-02 13:24 ` [PATCH/RFC 1/5] config.c : move configset_iter() to an appropriate position Tanay Abhra
2014-10-02 13:24 ` [PATCH/RFC 2/5] make git_config_with_options() to use a configset Tanay Abhra
2014-10-02 13:24 ` [PATCH/RFC 3/5] add "unset.variable" for unsetting previously set variables Tanay Abhra
2014-10-02 13:24 ` [PATCH/RFC 4/5] document the new "unset.variable" variable Tanay Abhra
2014-10-02 13:24 ` [PATCH/RFC 5/5] add tests for checking the behaviour of "unset.variable" Tanay Abhra
2014-10-02 20:09   ` Junio C Hamano
2014-10-02 20:18     ` Tanay Abhra
2014-10-02 20:23       ` Junio C Hamano
2014-10-02 20:35         ` Tanay Abhra
2014-10-02 23:38           ` Junio C Hamano
2014-10-03  7:01             ` Matthieu Moy
2014-10-03 18:25               ` Junio C Hamano
2014-10-03 18:48                 ` Junio C Hamano
2014-10-03 19:49                 ` Matthieu Moy
2014-10-03 20:12                   ` Junio C Hamano
2014-10-06 18:59                     ` Tanay Abhra
2014-10-06 19:28                       ` Junio C Hamano
2014-10-06 19:43                         ` Tanay Abhra
2014-10-02 19:29 ` [PATCH/RFC 0/5] add "unset.variable" for unsetting previously set variables Junio C Hamano
2014-10-02 20:41   ` Jeff King
2014-10-02 19:58 ` Junio C Hamano
2014-10-07 11:17   ` Jakub Narębski
2014-10-07 16:44     ` Junio C Hamano
2014-10-08  5:46       ` Matthieu Moy
2014-10-08 17:14         ` Junio C Hamano
2014-10-08 18:37           ` Matthieu Moy
2014-10-08 19:52             ` Junio C Hamano
2014-10-10  8:11               ` Jeff King
2014-10-13 18:21                 ` Junio C Hamano

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 NNTP newsgroup(s).