git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob 5753153a84ffe60107bd3bc83fefa071aa39021e 1209 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
45
46
47
48
49
50
 
#include "cache.h"
#include "repository.h"
#include "config.h"
#include "repo-settings.h"

#define UPDATE_DEFAULT(s,v) do { if (s == -1) { s = v; } } while(0)

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.featureadoptionrate")) {
		int rate = git_config_int(key, value);
		if (rate >= 3) {
			UPDATE_DEFAULT(rs->core_commit_graph, 1);
			UPDATE_DEFAULT(rs->gc_write_commit_graph, 1);
			UPDATE_DEFAULT(rs->index_version, 4);
		}
		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;
	}
	if (!strcmp(key, "index.version")) {
		rs->index_version = git_config_int(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;
	r->settings->index_version = -1;

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

debug log:

solving 5753153a84 ...
found 5753153a84 in https://public-inbox.org/git/02c89415fe11f14a65f2e6ee94e9d0de5a727e33.1560957119.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/4fe896e423b698ef60b208c613252b4847b6cd0a.1561991348.git.gitgitgadget@gmail.com/
found f7fc2a1959 in https://public-inbox.org/git/bdaee3ea9df0533c268d6bebbd252c00cfbaccd6.1560957119.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/13b9e71b383485885c4823baa466c32511fd20bc.1561991348.git.gitgitgadget@gmail.com/

applying [1/2] https://public-inbox.org/git/bdaee3ea9df0533c268d6bebbd252c00cfbaccd6.1560957119.git.gitgitgadget@gmail.com/
diff --git a/repo-settings.c b/repo-settings.c
new file mode 100644
index 0000000000..f7fc2a1959

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

skipping https://public-inbox.org/git/13b9e71b383485885c4823baa466c32511fd20bc.1561991348.git.gitgitgadget@gmail.com/ for f7fc2a1959
index at:
100644 f7fc2a1959acd9c24ae24b1b25886467c06331a3	repo-settings.c

applying [2/2] https://public-inbox.org/git/02c89415fe11f14a65f2e6ee94e9d0de5a727e33.1560957119.git.gitgitgadget@gmail.com/
diff --git a/repo-settings.c b/repo-settings.c
index f7fc2a1959..5753153a84 100644

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

skipping https://public-inbox.org/git/4fe896e423b698ef60b208c613252b4847b6cd0a.1561991348.git.gitgitgadget@gmail.com/ for 5753153a84
index at:
100644 5753153a84ffe60107bd3bc83fefa071aa39021e	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).