summaryrefslogtreecommitdiff
path: root/include/git2/config.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-05-07 00:10:02 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-05-07 21:42:56 +0200
commit5d8318875fc7234d00140ce1f18b67bc4703e5f4 (patch)
treee32dacb60fc7884b2d18b7eff61cdda59c0e0321 /include/git2/config.h
parenta4b75dcf56bc8e6d295cae89e2f5871c4707af21 (diff)
downloadlibgit2-5d8318875fc7234d00140ce1f18b67bc4703e5f4.tar.gz
config: convenience function to open global/xdg
The rules for which one to open is a bit silly, so let's make it easier for our users.
Diffstat (limited to 'include/git2/config.h')
-rw-r--r--include/git2/config.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/git2/config.h b/include/git2/config.h
index 5a2f956fd..724788ae0 100644
--- a/include/git2/config.h
+++ b/include/git2/config.h
@@ -195,6 +195,21 @@ GIT_EXTERN(int) git_config_open_level(
unsigned int level);
/**
+ * Open the global/XDG configuration file according to git's rules
+ *
+ * Git allows you to store your global configuration at
+ * `$HOME/.config` or `$XDG_CONFIG_HOME/git/config`. For backwards
+ * compatability, the XDG file shouldn't be used unless the use has
+ * created it explicitly. With this function you'll open the correct
+ * one to write to.
+ *
+ * @param out pointer in which to store the config object
+ * @param config the config object in which to look
+ */
+GIT_EXTERN(int) git_config_open_global(git_config **out, git_config *config);
+
+
+/**
* Reload changed config files
*
* A config file may be changed on disk out from under the in-memory