Skip to content

Commit

Permalink
Merge "Merge branch 'stable-3.3' into master"
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-miller authored and Gerrit Code Review committed Nov 10, 2020
2 parents 4f1d0b9 + 88a1f8a commit ff943fb
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 12 deletions.
53 changes: 53 additions & 0 deletions Documentation/config-gerrit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5523,6 +5523,49 @@ Sample `etc/jgit.config` file:
trustFolderStat = false
----

[[jgit-gc]]
=== Section gc

Options in section gc are used when command link:cmd-gc.html[gerrit gc] is used
or scheduled via options link:cmd-gc.html#gc.startTime[gc.startTime] and
link:cmd-gc.html#gc.interval[gc.interval].

[[gc.auto]]gc.auto::
+
When there are approximately more than this many loose objects in the repository,
auto gc will pack them. Some commands use this command to perform a light-weight
garbage collection from time to time. The default value is 6700.
+
Setting this to 0 disables not only automatic packing based on the number of
loose objects, but any other heuristic auto gc will otherwise use to determine
if there’s work to do, such as link:#gc.autoPackLimit[gc.autoPackLimit].

[[gc.autodetach]]gc.autodetach::
+
Makes auto gc run in a background thread. Default is `true`.

[[gc.autopacklimit]]gc.autopacklimit::
+
When there are more than this many packs that are not marked with `*.keep` file
in the repository, auto gc consolidates them into one larger pack. The
default value is 50. Setting this to 0 disables it. Setting `gc.auto` to 0 will
also disable this.

[[gc.packRefs]]gc.packRefs::
+
This variable determines whether gc runs git pack-refs. The default is `true`.

[[gc.reflogExpire]]gc.reflogExpire::
+
Removes reflog entries older than this time; defaults to 90 days. The value "now"
expires all entries immediately, and "never" suppresses expiration altogether.

[[gc.reflogExpireUnreachable]]gc.reflogExpireUnreachable::
+
Removes reflog entries older than this time and not reachable from the
current tip; defaults to 30 days. The value "now" expires all entries immediately,
and "never" suppresses expiration altogether.

[[jgit-protocol]]
=== Section protocol

Expand All @@ -5540,6 +5583,16 @@ Supported versions:
2:: wire protocol version 2. Speeds up fetches from repositories with many refs by allowing the client
to specify which refs to list before the server lists them.

[[jgit-receive]]
=== Section receive

[[receive.autogc]]receive.autogc::
+
By default, `git-receive-pack` will run auto gc after receiving data from git-push and updating refs.
You can stop it by setting this variable to `false`. This is recommended in gerrit to avoid the
additional load this creates. Instead schedule gc using link:cmd-gc.html#gc.startTime[gc.startTime]
and link:cmd-gc.html#gc.interval[gc.interval] or e.g. in a cron job that runs gc in a separate process.

GERRIT
------
Part of link:index.html[Gerrit Code Review]
Expand Down
3 changes: 1 addition & 2 deletions Documentation/dev-bazel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ Java 8 is a legacy Java release and support for Java 8 will be discontinued
in future gerrit releases. To build Gerrit with Java 8 language level, run:

```
$ bazel build --java_toolchain //tools:error_prone_warnings_toolchain_java8
:release
$ bazel build --java_toolchain //tools:error_prone_warnings_toolchain :release
```

[[java-11]]
Expand Down
2 changes: 1 addition & 1 deletion Documentation/dev-core-plugins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Apache License Version 2.0.
The plugin functionality has gone outside the Gerrit-related scope,
has a clear scope or conflict with other core plugins or existing and
planned Gerrit core features.

+
NOTE: The plugin would need to remain core until the planned replacement gets
implemented. Otherwise the feature is likely missing between the removal and
planned implementation times.
Expand Down
25 changes: 16 additions & 9 deletions tools/release_noter/release_noter.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,14 @@ class Task(Enum):
class Commit:
sha1 = None
subject = None
component = None
issues = set()

def reset(self, signature, task):
if signature is not None:
self.sha1 = signature.group(1)
self.subject = None
self.component = None
self.issues = set()
return Task.finish_headers
return task
Expand Down Expand Up @@ -238,24 +240,25 @@ def finish(commit, commits, gerrit, options, cwd):
if noted_commit.subject == commit.subject:
return Commit()
set_component(commit, commits, cwd)
link_subject(commit, gerrit, options)
link_subject(commit, gerrit, options, cwd)
escape_these(commit)
return Commit()


def set_component(commit, commits, cwd):
component_found = False
component_found = None
for component in Components:
for sentinel in component.value.sentinels:
if not component_found:
if component_found is None:
if re.match(f"{GIT_PATH}/{PLUGINS}{component.value.name.lower()}", cwd):
component_found = True
component_found = component
elif sentinel.lower() in commit.subject.lower():
component_found = True
if component_found:
component_found = component
if component_found is not None:
commits[component].append(commit)
if not component_found:
if component_found is None:
commits[Components.otherwise].append(commit)
commit.component = component_found


def init_components():
Expand All @@ -265,13 +268,17 @@ def init_components():
return components


def link_subject(commit, gerrit, options):
def link_subject(commit, gerrit, options, cwd):
if options.link:
gerrit_change = gerrit.get(f"{COMMIT_URL}{commit.sha1}")
if not gerrit_change:
return
change_number = gerrit_change[0]["_number"]
change_address = f"{GERRIT_URL}{CHANGE_URL}{change_number}"
plugin_wd = re.search(f"{GIT_PATH}/({PLUGINS}.+)", cwd)
if plugin_wd is not None:
change_address = f"{GERRIT_URL}/c/{plugin_wd.group(1)}/+/{change_number}"
else:
change_address = f"{GERRIT_URL}{CHANGE_URL}{change_number}"
short_sha1 = commit.sha1[0:7]
commit.subject = f"[{short_sha1}]({change_address})\n {commit.subject}"

Expand Down

0 comments on commit ff943fb

Please sign in to comment.