Skip to content

Commit 1468a80

Browse files
committed
Merge branch 'master' into stable-7.2
* master: Ensure access to autoRefresh is thread-safe FileReftableStack: use FileSnapshot to detect modification FileReftableDatabase: consider ref updates by another process BlameRegionMerger: report invalid regions with checked exception. [ssh known_hosts] Handle unknown keys better [releng] Remove unused target platform definitions Change-Id: I2e49d582a5be9f1383b4f1713e33cb378b4f6118
2 parents 1b70d59 + 4ef8870 commit 1468a80

File tree

28 files changed

+363
-913
lines changed

28 files changed

+363
-913
lines changed

Documentation/config-options.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ For details on native git options see also the official [git config documentatio
5858
| ~~`core.trustFolderStat`~~ | `true` | ⃞ | __Deprecated__, use `core.trustStat` instead. If set to `true` translated to `core.trustStat=always`, if `false` translated to `core.trustStat=never`, see below. If both `core.trustFolderStat` and `core.trustStat` are configured then `trustStat` takes precedence and `trustFolderStat` is ignored. |
5959
| `core.trustLooseRefStat` | `inherit` | ⃞ | Whether to trust the file attributes of loose refs and its fan-out parent directory. See `core.trustStat` for possible values. If `inherit`, JGit will use the behavior configured in `trustStat`. |
6060
| `core.trustPackedRefsStat` | `inherit` | ⃞ | Whether to trust the file attributes of the packed-refs file. See `core.trustStat` for possible values. If `inherit`, JGit will use the behavior configured in `core.trustStat`. |
61+
| `core.trustTablesListStat` | `inherit` | ⃞ | Whether to trust the file attributes of the `tables.list` file used by the reftable ref storage backend to store the list of reftable filenames. See `core.trustStat` for possible values. If `inherit`, JGit will use the behavior configured in `core.trustStat`. The reftable backend is used if `extensions.refStorage = reftable`. |
6162
| `core.trustLooseObjectStat` | `inherit` | ⃞ | Whether to trust the file attributes of the loose object file and its fan-out parent directory. See `core.trustStat` for possible values. If `inherit`, JGit will use the behavior configured in `core.trustStat`. |
6263
| `core.trustPackStat` | `inherit` | ⃞ | Whether to trust the file attributes of the `objects/pack` directory. See `core.trustStat` for possible values. If `inherit`, JGit will use the behavior configured in `core.trustStat`. |
63-
| `core.trustStat` | `always` | ⃞ | Global option to configure whether to trust file attributes (Java equivalent of stat command on Unix) of files storing git objects. Can be overridden for specific files by configuring `core.trustLooseRefStat, core.trustPackedRefsStat, core.trustLooseObjectStat, core.trustPackStat`. If `never` JGit will ignore the file attributes of the file and always read it. If `always` JGit will trust the file attributes and will only read it if a file attribute has changed. `after_open` behaves the same as `always`, but file attributes are only considered *after* the file itself and any transient parent directories have been opened and closed. An open/close of the file/directory is known to refresh its file attributes, at least on some NFS clients. |
64+
| `core.trustStat` | `always` | ⃞ | Global option to configure whether to trust file attributes (Java equivalent of stat command on Unix) of files storing git objects. Can be overridden for specific files by configuring `core.trustLooseRefStat, core.trustPackedRefsStat, core.trustLooseObjectStat, core.trustPackStat,core.trustTablesListStat`. If `never` JGit will ignore the file attributes of the file and always read it. If `always` JGit will trust the file attributes and will only read it if a file attribute has changed. `after_open` behaves the same as `always`, but file attributes are only considered *after* the file itself and any transient parent directories have been opened and closed. An open/close of the file/directory is known to refresh its file attributes, at least on some NFS clients. |
6465
| `core.worktree` | Root directory of the working tree if it is not the parent directory of the `.git` directory | ✅ | The path to the root of the working tree. |
6566

6667
## __fetch__ options
@@ -134,6 +135,13 @@ Proxy configuration uses the standard Java mechanisms via class `java.net.ProxyS
134135
| `pack.window` | `10` | ✅ | Number of objects to try when looking for a delta base per thread searching for deltas. |
135136
| `pack.windowMemory` | `0` (unlimited) | ✅ | Maximum number of bytes to put into the delta search window. |
136137

138+
## reftable options
139+
140+
| option | default | git option | description |
141+
|---------|---------|------------|-------------|
142+
| `reftable.autoRefresh` | `false` | ⃞ | Whether to auto-refresh the reftable stack if it is out of date. |
143+
144+
137145
## __repack__ options
138146

139147
| option | default | git option | description |

org.eclipse.jgit.benchmarks/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
<artifactId>org.eclipse.jgit.junit</artifactId>
5353
<version>${project.version}</version>
5454
</dependency>
55+
<dependency>
56+
<groupId>junit</groupId>
57+
<artifactId>junit</artifactId>
58+
</dependency>
5559
</dependencies>
5660

5761
<build>

org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/GetRefsBenchmark.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import org.eclipse.jgit.api.Git;
2626
import org.eclipse.jgit.api.errors.GitAPIException;
27+
import org.eclipse.jgit.internal.storage.file.FileReftableDatabase;
2728
import org.eclipse.jgit.internal.storage.file.FileRepository;
2829
import org.eclipse.jgit.lib.BatchRefUpdate;
2930
import org.eclipse.jgit.lib.ConfigConstants;
@@ -39,8 +40,10 @@
3940
import org.eclipse.jgit.transport.ReceiveCommand;
4041
import org.eclipse.jgit.util.FS;
4142
import org.eclipse.jgit.util.FileUtils;
43+
import org.junit.Assume;
4244
import org.openjdk.jmh.annotations.Benchmark;
4345
import org.openjdk.jmh.annotations.BenchmarkMode;
46+
import org.openjdk.jmh.annotations.Fork;
4447
import org.openjdk.jmh.annotations.Measurement;
4548
import org.openjdk.jmh.annotations.Mode;
4649
import org.openjdk.jmh.annotations.OutputTimeUnit;
@@ -67,6 +70,9 @@ public static class BenchmarkState {
6770
@Param({ "true", "false" })
6871
boolean useRefTable;
6972

73+
@Param({ "true", "false" })
74+
boolean autoRefresh;
75+
7076
@Param({ "100", "1000", "10000", "100000" })
7177
int numBranches;
7278

@@ -82,6 +88,9 @@ public static class BenchmarkState {
8288
@Setup
8389
@SuppressWarnings("boxing")
8490
public void setupBenchmark() throws IOException, GitAPIException {
91+
// if we use RefDirectory skip autoRefresh = false
92+
Assume.assumeTrue(useRefTable || autoRefresh);
93+
8594
String firstBranch = "firstbranch";
8695
testDir = Files.createDirectory(Paths.get("testrepos"));
8796
String repoName = "branches-" + numBranches + "-trustStat-"
@@ -98,6 +107,9 @@ public void setupBenchmark() throws IOException, GitAPIException {
98107
((FileRepository) git.getRepository()).convertRefStorage(
99108
ConfigConstants.CONFIG_REF_STORAGE_REFTABLE, false,
100109
false);
110+
FileReftableDatabase refdb = (FileReftableDatabase) git
111+
.getRepository().getRefDatabase();
112+
refdb.setAutoRefresh(autoRefresh);
101113
} else {
102114
cfg.setEnum(ConfigConstants.CONFIG_CORE_SECTION, null,
103115
ConfigConstants.CONFIG_KEY_TRUST_STAT,
@@ -113,6 +125,7 @@ public void setupBenchmark() throws IOException, GitAPIException {
113125
System.out.println("Preparing test");
114126
System.out.println("- repository: \t\t" + repoPath);
115127
System.out.println("- refDatabase: \t\t" + refDatabaseType());
128+
System.out.println("- autoRefresh: \t\t" + autoRefresh);
116129
System.out.println("- trustStat: \t" + trustStat);
117130
System.out.println("- branches: \t\t" + numBranches);
118131

@@ -154,6 +167,7 @@ public void teardown() throws IOException {
154167
@OutputTimeUnit(TimeUnit.MICROSECONDS)
155168
@Warmup(iterations = 2, time = 100, timeUnit = TimeUnit.MILLISECONDS)
156169
@Measurement(iterations = 2, time = 5, timeUnit = TimeUnit.SECONDS)
170+
@Fork(2)
157171
public void testGetExactRef(Blackhole blackhole, BenchmarkState state)
158172
throws IOException {
159173
String branchName = state.branches
@@ -166,6 +180,7 @@ public void testGetExactRef(Blackhole blackhole, BenchmarkState state)
166180
@OutputTimeUnit(TimeUnit.MICROSECONDS)
167181
@Warmup(iterations = 2, time = 100, timeUnit = TimeUnit.MILLISECONDS)
168182
@Measurement(iterations = 2, time = 5, timeUnit = TimeUnit.SECONDS)
183+
@Fork(2)
169184
public void testGetRefsByPrefix(Blackhole blackhole, BenchmarkState state)
170185
throws IOException {
171186
String branchPrefix = "refs/heads/branch/" + branchIndex.nextInt(100)

org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/R20200831200620-2020-09.tpd

Lines changed: 0 additions & 66 deletions
This file was deleted.

org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/R20201130205003-2020-12.tpd

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)