git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob 6f5e18d92e59965d920337aeaa2044280d1c7fd9 974 bytes (raw)
name: repo-settings.c 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
#include "cache.h"
#include "repository.h"
#include "config.h"
#include "repo-settings.h"


#define UPDATE_DEFAULT(s,v) if (s != -1) { s = v; }

static int git_repo_config(const char *key, const char *value, void *cb)
{
	struct repo_settings *rs = (struct repo_settings *)cb;

	if (!strcmp(key, "core.size")) {
		if (!strcmp(value, "large")) {
			UPDATE_DEFAULT(rs->core_commit_graph, 1);
			UPDATE_DEFAULT(rs->gc_write_commit_graph, 1);
		}
		return 0;
	}
	if (!strcmp(key, "core.commitgraph")) {
		rs->core_commit_graph = git_config_bool(key, value);
		return 0;
	}
	if (!strcmp(key, "gc.writecommitgraph")) {
		rs->gc_write_commit_graph = git_config_bool(key, value);
		return 0;
	}

	return 1;
}

void prepare_repo_settings(struct repository *r)
{
	if (r->settings)
		return;

	r->settings = xmalloc(sizeof(*r->settings));

	/* Defaults */
	r->settings->core_commit_graph = -1;
	r->settings->gc_write_commit_graph = -1;

	repo_config(r, git_repo_config, r->settings);
}

debug log:

solving 6f5e18d92e ...
found 6f5e18d92e in https://public-inbox.org/git/704613f4480e3b9aacab91d2241247791f34ce22.1559593097.git.gitgitgadget@gmail.com/

applying [1/1] https://public-inbox.org/git/704613f4480e3b9aacab91d2241247791f34ce22.1559593097.git.gitgitgadget@gmail.com/
diff --git a/repo-settings.c b/repo-settings.c
new file mode 100644
index 0000000000..6f5e18d92e

Checking patch repo-settings.c...
Applied patch repo-settings.c cleanly.

index at:
100644 6f5e18d92e59965d920337aeaa2044280d1c7fd9	repo-settings.c

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).