From 7d19038ccca2379140022037e6861a8f8d5fe8fa Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 13 Aug 2013 08:07:25 +0200 Subject: git-web--browse.sh: use "open" on Haiku diff --git a/git-web--browse.sh b/git-web--browse.sh index ae15253..b074d1a 100755 --- a/git-web--browse.sh +++ b/git-web--browse.sh @@ -133,6 +133,11 @@ if test -z "$browser" ; then browser_candidates="cygstart $browser_candidates" fi + # /boot/system/haiku_loader indicates Haiku + if test -f /boot/system/haiku_loader; then + browser_candidates="open $browser_candidates" + fi + for i in $browser_candidates; do init_browser_path $i if type "$browser_path" > /dev/null 2>&1; then -- 2.14.2 From c28ebdeca7e0ad7a4d14a1026a5471ee2d8937db Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 19 Jan 2015 15:37:16 -0500 Subject: On Haiku use the user settings directory instead of HOME diff --git a/path.c b/path.c index da8b655..ec3d6c2 100644 --- a/path.c +++ b/path.c @@ -11,6 +11,11 @@ #include "path.h" #include "packfile.h" +#ifdef __HAIKU__ +#include +#include +#endif + static int get_st_mode_bits(const char *path, int *mode) { struct stat st; @@ -1331,10 +1336,19 @@ char *xdg_config_home(const char *filename) { const char *home, *config_home; +#ifdef __HAIKU__ + char settingsPath[B_PATH_NAME_LENGTH]; + assert(filename); + if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, true, settingsPath, + sizeof(settingsPath)) == B_OK) + return mkpathdup("%s/git/%s", settingsPath, filename); +#else assert(filename); config_home = getenv("XDG_CONFIG_HOME"); + if (config_home && *config_home) return mkpathdup("%s/git/%s", config_home, filename); +#endif home = getenv("HOME"); if (home) -- 2.14.2 From bb13568f941bb3e59a8e33f91676364313544614 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 19 Jan 2015 15:50:09 -0500 Subject: Ensure config-directory exists before using it. diff --git a/config.c b/config.c index adb7d7a..4b1b14e 100644 --- a/config.c +++ b/config.c @@ -2453,6 +2453,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename, int ret; struct lock_file lock = LOCK_INIT; char *filename_buf = NULL; + char *config_dir = NULL; char *contents = NULL; size_t contents_sz; @@ -2466,6 +2467,12 @@ int git_config_set_multivar_in_file_gently(const char *config_filename, if (!config_filename) config_filename = filename_buf = git_pathdup("config"); + config_dir = xstrdup(config_filename); + * find_last_dir_sep(config_dir) = '\0'; + if (access(config_dir, F_OK) != 0) + mkdir(config_dir, 0755); + free(config_dir); + /* * The lock serves a purpose in addition to locking: the new * contents of .git/config will be written into it. -- 2.14.2 From 66ce1d4e8611573bde7ae110d015c45cc5529adf Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 14 Feb 2016 10:32:12 +0100 Subject: Move credential cache to the config directory. Do not clutter the home dir. diff --git a/credential-cache.c b/credential-cache.c index 1cccc3a..076f6fa 100644 --- a/credential-cache.c +++ b/credential-cache.c @@ -87,7 +87,7 @@ static char *get_socket_path(void) { struct stat sb; char *old_dir, *socket; - old_dir = expand_user_path("~/.git-credential-cache", 0); + old_dir = xdg_config_home("credential-cache"); if (old_dir && !stat(old_dir, &sb) && S_ISDIR(sb.st_mode)) socket = xstrfmt("%s/socket", old_dir); else -- 2.14.2