From: Junio C Hamano Date: Wed, 4 Sep 2013 19:35:34 +0000 (-0700) Subject: Merge branch 'nd/gc-lock-against-each-other' X-Git-Tag: v1.8.5-rc0~187 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/05584b2a4e18e0693ac2af6dd9650e59351786ed?ds=inline;hp=-c Merge branch 'nd/gc-lock-against-each-other' * nd/gc-lock-against-each-other: gc: reject if another gc is running, unless --force is given --- 05584b2a4e18e0693ac2af6dd9650e59351786ed diff --combined Documentation/git-gc.txt index 2402ed6828,5d04ab0330..e158a3b31f --- a/Documentation/git-gc.txt +++ b/Documentation/git-gc.txt @@@ -9,7 -9,7 +9,7 @@@ git-gc - Cleanup unnecessary files and SYNOPSIS -------- [verse] - 'git gc' [--aggressive] [--auto] [--quiet] [--prune= | --no-prune] + 'git gc' [--aggressive] [--auto] [--quiet] [--prune= | --no-prune] [--force] DESCRIPTION ----------- @@@ -62,9 -62,8 +62,9 @@@ automatic consolidation of packs --prune=:: Prune loose objects older than date (default is 2 weeks ago, - overridable by the config variable `gc.pruneExpire`). This - option is on by default. + overridable by the config variable `gc.pruneExpire`). + --prune=all prunes loose objects regardless of their age. + --prune is on by default. --no-prune:: Do not prune any loose objects. @@@ -72,6 -71,10 +72,10 @@@ --quiet:: Suppress all progress reports. + --force:: + Force `git gc` to run even if there may be another `git gc` + instance running on this repository. + Configuration ------------- diff --combined compat/mingw.c index bb92c436f7,2951389c69..22ee9ef1cf --- a/compat/mingw.c +++ b/compat/mingw.c @@@ -841,8 -841,8 +841,8 @@@ struct pinfo_t struct pinfo_t *next; pid_t pid; HANDLE proc; -} pinfo_t; -struct pinfo_t *pinfo = NULL; +}; +static struct pinfo_t *pinfo = NULL; CRITICAL_SECTION pinfo_cs; static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **env, @@@ -1086,6 -1086,12 +1086,12 @@@ int mingw_kill(pid_t pid, int sig errno = err_win_to_posix(GetLastError()); CloseHandle(h); return -1; + } else if (pid > 0 && sig == 0) { + HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid); + if (h) { + CloseHandle(h); + return 0; + } } errno = EINVAL; @@@ -1253,7 -1259,7 +1259,7 @@@ static int WSAAPI getaddrinfo_stub(cons else sin->sin_addr.s_addr = INADDR_LOOPBACK; ai->ai_addr = (struct sockaddr *)sin; - ai->ai_next = 0; + ai->ai_next = NULL; return 0; } @@@ -1677,16 -1683,14 +1683,16 @@@ int sigaction(int sig, struct sigactio #undef signal sig_handler_t mingw_signal(int sig, sig_handler_t handler) { - sig_handler_t old = timer_fn; + sig_handler_t old; switch (sig) { case SIGALRM: + old = timer_fn; timer_fn = handler; break; case SIGINT: + old = sigint_fn; sigint_fn = handler; break;