Replace the code with an error message that git has to be
in the PATH instead of trying to parse gerrit.conf with
shell code. The shell code do not remove whitespaces as
it should and this will give stranger errors when looking
for java later in the script (all platforms/shells).
This code doesn't seem to have been used anyway.
Change-Id: Ideba5b950a97c0e77839cbddd4616ef737470da2
Not all systems have enough database connections in the connection
pool to support 2 threads per CPU. Exporting lots of changes doesn't
take that long, so 2 threads is acceptable.
Change-Id: I69bbade7f67023689ca54665833bc764d2d5503d
Signed-off-by: Shawn O. Pearce <sop@google.com>
The GitRepositoryManager and @GerritPersonIdent PersonIdent are now
bound in the SchemaModule as part of the git-store topic.
Change-Id: I3935b7d699c899e419d8db0836ad5dd9e2894aff
Signed-off-by: Shawn O. Pearce <sop@google.com>
This program allows site administrators to dump their existing notes
out to the refs/notes/review branch, making the prior data available
to Git clients.
Change-Id: Iebaf1e4b2fb4620443e80d2a8f840cb30ae1e389
Signed-off-by: Shawn O. Pearce <sop@google.com>
Project settings are now saved in the project.config file of the
refs/meta/config branch within each Git repository. This offers
us free version control over the lifespan of the project, and will
help reduce schema version issues as the configuration file is
more free-form.
Project owners can edit the configuration of their project by
hand and push the results back up, possibly even going through
code review, if the proper access rules are assigned in the
project's access panel. Project users can inspect the history of
the configuration by reading the history of the refs/meta/config
branch with their favorite history browser.
Change-Id: Id63414d86dbfb9033021f76e1d5e782373525a77
Signed-off-by: Shawn O. Pearce <sop@google.com>
Since projects are listed by recursively walking the filesystem,
we don't need to import them into the database.
Change-Id: I86613ac34a9c0ac68ba82b70b2c0312f877a8e69
Signed-off-by: Shawn O. Pearce <sop@google.com>
Some OSes are more restrictive than other what the sh interpreter
will accept. Solaris is particularly picky about what is allowed.
Change-Id: Iebad888e52ea01bd21e0d36f517d639e35b3e04d
Mac OS X may have spaces in its JAVA_HOME path, so support those by
avoiding contexts where it isn't properly quoted or protected from the
shell splitting rules.
Change-Id: I228c3e6456009ffb4adec7d1a385ea0d333258d0
Signed-off-by: Shawn O. Pearce <sop@google.com>
It is necessary to use at least this revision in order to get the
new functionality of merging Git notes available to Gerrit. Gerrit
will make use of this functionlity to finish the implementation of
the change 20045.
Change-Id: I406d3b708187fb7b15660f89dbcdf108d5d0fba7
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
This simplifies all of the calling sites, where they have a
Project.NameKey on hand and would prefer not to invoke .get() to
convert it into a String.
Change-Id: If661fc07cff542a57af3c28f27ab401ce7b3a656
Signed-off-by: Shawn O. Pearce <sop@google.com>
Authentication was broken for push over HTTP when using the internal
Jetty daemon, as the ProjectQoSFilter was installed in front of the
ProjectDigestFilter and asked for the user identity in order to know
which type of queue to schedule the request onto. This caused the
ProjectQoSFilter to always authenticate the request as ANONYMOUS,
which later caused it to reject the push because Gerrit never
permits an anonymous user to push to a project.
Moving the ProjectQoSFilter after all other filters (but just before
the servlet itself) fixes this issue. Fortunately Guice allows
us to register the filter after the servlet, which means we just
needed to flip the order the modules are installed into the injector.
Change-Id: Ie59db01e731e4269a968f10bb5d17e94afe6518e
Signed-off-by: Shawn O. Pearce <sop@google.com>
Since gerrit is usually a essential process that can consume a lot of
memory and you might run other memory hogs (git gc, git repack) on the
same machine, lets tell the oom killer that we prefer not to be killed.
Currently this only works if we're root... And i don't know if the
values is what we'd want to use in real life.
When doing a gerrit.sh check, currently we only look for the pid file.
If the service has crashed or something else has shut it down, we won't
see it and since Gerrit usually is pretty critical we should make sure
that we verify that we have a process running.
Support for authentication using client side SSL certificate. This
authentication type is actually kind of SSO. Gerrit will configure Jetty's SSL
channel to request client's SSL certificate. For this authentication to work a
Gerrit administrator has to import the root certificate of the trust chain used
to issue the client's certificate into the <review-site>/etc/keystore.
For the Gerrit's server side SSL certificate one can use a certificate signed
by a CA or a self-signed certificate.
After the authentication is done Gerrit will obtain basic user
registration (name and email) from LDAP, and some group memberships.
Change-Id: Ic076178f844f05b73be5d7c8fe9c8bb29b458f26
If the configuration file hasn't been modified by the init program,
don't attempt to write it out to disk. Do the same for gerrit.sh
and also the mail templates.
Change-Id: I7eca3f654a7504b990da8a386e6a6d568caa9ac8
Signed-off-by: Shawn O. Pearce <sop@google.com>
RevWalk implicitly creates an ObjectReader if you call its Repository
based constructor. Ensure we always release those ObjectReaders,
or use our own that we can release when we are done.
Change-Id: I6421507d248e331e7c35bdeb7831ea2f7bcff6b5
Signed-off-by: Shawn O. Pearce <sop@google.com>
* stable: (30 commits)
Clarify the upgrade instructions
Draft release notes for 2.1.5
documentation: Document why hook --change-url might be missing
documentation: Fix rendering errors in gerrit.config
Allow ; and & to seperate parameters in gitweb
Include a quick summary of the size of a change in email
Display the size of a patch (lines added/removed)
Fix clearing of topic during replace
Fix inherited Read Access +2 not inheriting
Add some basic RefControl tests for delegated ownership
Fix branch owner adding exclusive ACL
Optimize RegexFilePredicate for common matches
Correct copyright headers to AOSP
Don't expose /COMMIT_MSG as a modified file in ChangeData
Don't enable dk.brics.automaton's optional syntax
Fix NPE while matching file:^ pattern on deleted files
Fixed unused imports in OutgoingEmail
Don't show /COMMIT_MSG in change emails
Fix NPE during merge failure on new branch
Honor user's syntax coloring preference in unified view
...
Conflicts:
gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java
gerrit-server/src/main/java/com/google/gerrit/common/ChangeHookRunner.java
gerrit-server/src/main/java/com/google/gerrit/server/mail/ChangeEmail.java
gerrit-server/src/main/java/com/google/gerrit/server/mail/CommentSender.java
gerrit-server/src/main/java/com/google/gerrit/server/mail/OutgoingEmail.java
gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListCacheImpl.java
gerrit-server/src/main/java/com/google/gerrit/server/patch/Text.java
Change-Id: I80bfdb55872fa4bdf4f751c337b609e7ec809605
I meant to keep reusing the 2.1 version number for the entire
2.1 series during development, but botched it during the 2.1.4
development cycle and set it to 2.1.4-SNAPSHOT by mistake. Put
it back to 2.1-SNAPSHOT since 2.1.4 is released.
Change-Id: I37e206c0609bf3fd94a5aab8ea301c98b7fb013e
Signed-off-by: Shawn O. Pearce <sop@google.com>
Convert the NewChange, RegisterNewEmail and ReplacePatchSet
classes to use file based velocity templates which an admin
may edit. Factor out getChangeDetail and getReviewersNames
from formatChangeDetail and formatSalutation respectively
to enable this.
Change-Id: I36aa7051f06c7641114e2e681639267769846c22
Convert the AbandonedSender and MergeFailSender classes to use
file based velocity templates which an admin may edit.
Change-Id: I5eae65a46aea074ef25bfc259c013f9be91fdc2f
Add an admin editable ChangeSubject.vm template used to
format the subject header in change emails.
Change-Id: Iea58807b9a947bf0a4eba31c04977582430137ed
When we added the non-interactive execution queue we broke the
ability to cancel a pending project request that had been deferred
with a Jetty continuation. When the timeout is reached we are
invoked through a different code path that bypasses the GuiceFilter,
which means we don't have access to the current user state.
That prevents us from finding the proper WorkQueue.Executor to
cancel the task from.
Remember the WorkQueue.Executor we pushed the task into, so we
can remove it from the same queue.
Bug: issue 614
Change-Id: I76344befc1c248cbd03f34d629d3ea15d9ef8bbf
Signed-off-by: Shawn O. Pearce <sop@google.com>
We may run out of transient file descriptors if packedGitOpenFiles is
too low, such as the default setting of 128. Assume we can get at
least 1024 file descriptors and request that many by default.
Bug: issue 460
Change-Id: I45e62a8af9f3763eacf977431c299193f014bd1e
Signed-off-by: Shawn O. Pearce <sop@google.com>
This simple command looks at every change's most recent patch set
and reindexes the associated tracking information, based on the
current trackingid blocks in gerrit.config. Administrators can
run this command to reindex existing records after making changes.
Bug: issue 124
Change-Id: I152ce430f84b70b6f84510f1abefc8da6037e746
Signed-off-by: Shawn O. Pearce <sop@google.com>
When running Gerrit in large environments it's sometimes necessary
to configure Gerrit slave installations. This change adds the
configuration option container.slave, if set to true gerrit.sh
is called with the slave switch. If no value is set (or any other
value), Gerrit defaults to master mode.
Change-Id: Ic4103e0d3d952e0d56b6aa5101d20c960588772a
The initial implementation of reference level access control only
supports a corner case, that of "locking down" access for a specific
branch.
Upon further discussion, we've decided that this is not the more
general need. Most Gerrit configurations prefer to have a more "open"
access model, where access rights on a reference specified with a
wildcard, such as "refs/heads/*" aren't overridden by a more specific
access right. So this change makes the default behavior to evaluate
all rights, including the wild card ones.
However, in order to accomodate the corner case we were supporting
before, this change also introduces a new way to specify exclusive
reference level access rights. All access rights that start with the
'-' prefix are considered exclusive, and will prevent all wild card
rights from being considered.
Change-Id: I629f5439967b2141e46098614fadb25ff28e5f45
A new internal user group, "Non-Interactive Users" is added. members
of this group are not expected to perform interactive operations on
the gerrit web frontend.
However, sometimes such a user may need a separate thread pool in
order to prevent it from grabbing threads from the interactive users.
This change introduces a second thread pool, which separates
operations from the non-interactive users from the interactive ones.
This ensures that the interactive users can keep working when
resources are tight.
Change-Id: I16334dd84ec50e1a6ca894e635c8beea9bd42115
Normally these go to stdout, but in daemon mode that is usually
the useless /dev/null device.
Bug: issue 483
Change-Id: Ida8d0c91744410b316ba32834a2307b10bc312f8
Signed-off-by: Shawn O. Pearce <sop@google.com>