This allows use the standard git archive command to create an archive
of the content of a repository:
$ git archive -f tar.bz2 --prefix=foo-1.0/ \
--remote=ssh://john@gerrit:29418/foo \
refs/changes/73/673/1 > foo-1.0.tar.bz2
Different compression levels can be configured for zip format:
$ git archive -f zip -9 \
--remote=ssh://john@gerrit:29418/foo \
refs/changes/73/673/1 > foo.zip
TEST PLAN:
buck test --include ssh
Bug: Issue 2061
Change-Id: Ifc1a92bacef3155cf474adee883cbe587dd8759f
- Declare variables on separate lines
- Declare class modifiers in Java language spec recommended order
- Replace C-style array declarations with Java-style declarations
Change-Id: I12434301cb02db5c6b4548d18f7670543bf9e0f2
* changes:
Merge PerformRenameGroup into PutName
Use REST implementation from rename-group SSH command
Remove duplicate code to add group members
Merge PerformCreateGroup into CreateGroup
Remove support for initial groups from PerformCreateGroup
Use REST implementation to create groups during tests
Use REST implementation from create-group SSH command
The PutName class is the only user of the PerformRenameGroup
class. This additional indirection is not needed and the pattern of
having a Perform* class to encapsule common logic between SSH and UI
was given up in favor of having this common code in the REST API
implementation classes.
Having all the functionality in PutName avoids to do validation
checks twice and to convert exceptions.
Change-Id: I695ce026be88c7012f1cf6536f34f8c99ea7d405
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The rename-group SSH command should invoke the rename group
functionality in the REST API rather then reimplementing the logic.
Change-Id: I8786808776edc539536557d291162798fdc2199d
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The create-group SSH command should invoke the create group
functionality in the REST API rather then reimplementing the logic.
The create group REST endpoint doesn't support adding of initial
members and included groups since there are own REST endpoints for
this. This is why the create-group SSH command must invoke these REST
endpoints as well.
Change-Id: Ic6e97c57be839bbe86d325a89d0d90deb4bee7ae
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* stable-2.11:
SshDaemon: Don't use deprecated IoAcceptor.dispose()
PatchListLoader: Don't use deprecated TemporaryBuffer.LocalFile constructor
Fix unused exception throws in EncryptedContactStore
Remove unused imports
Don't use deprecated PGPPublicKeyRingCollection constructor
Print proper name for mergeability check tasks in show-queue command
Print proper name for ListenableFutureTask in show-queue command
Work around asciidoctor handling of nested ` and *
Revert "Revert "Allow configuration of SSH rekey values""
Revert "Revert "SSHD: Allow ECDSA based public key authentication""
Revert "Revert "SSHD: Prevent double authentication for the same public key""
Revert "Downgrade SSHD to 0.9.0-4-g5967cfd"
Recommend --data-binary flag when testing submit rules from curl
Change edit shortcut from 'm' to 'e'
Fix NPE in MergeabilityCache.getIfPresent
Fix F5 shortcut being hijacked by edit topic in Firefox
Update 2.11 release notes
Update version to 2.10.2
Release notes for Gerrit 2.10.2
Do not return 403 when clicking on Gitweb breadcrumb
Add log messages to troubleshoot OAuth/OpenID linking
Remove unused imports
Convert to new AutoCloseable instances coming in JGit 4.0
Remove unused OAuthToken in authorisation URL
OnlineReindexer: log the success/failure numbers on exit
Work around MyersDiff infinite loop in PatchListLoader
Bind SecureStore and SecureStoreClassName in WebAppInitializer
Update replication plugin
Rework intra line diff to interrupt threads instead of killing them
Update JGit to 3.7.0.201502260915-r.58-g65c379e
Update replication plugin
Workaround a RecursiveMerger bug [1], avoid online reindexing failure
OAuth: Allow to link claimed identity to existing accounts
OAuth: Allow to change username
Allow PatchListLoader to use recursive merger
Allow plugins to use self-provided licenses for used Maven Jars
Change-Id: Ie7f96abd97bd2c7e9205a708eed11f9052546187
* stable-2.10:
SshDaemon: Don't use deprecated IoAcceptor.dispose()
PatchListLoader: Don't use deprecated TemporaryBuffer.LocalFile constructor
Fix unused exception throws in EncryptedContactStore
Remove unused imports
Don't use deprecated PGPPublicKeyRingCollection constructor
Print proper name for mergeability check tasks in show-queue command
Print proper name for ListenableFutureTask in show-queue command
Revert "Revert "Allow configuration of SSH rekey values""
Revert "Revert "SSHD: Allow ECDSA based public key authentication""
Revert "Revert "SSHD: Prevent double authentication for the same public key""
Revert "Downgrade SSHD to 0.9.0-4-g5967cfd"
Change-Id: I5d67f0a3c9686cf96b7c7eb349b73cd5ae8ffbbf
Java 8's javadoc fails hard on unknown HTML tags. Due some
documentation code snippets that contain generics and lacked a
{@code...}, the code got picked up as html, which made the target fail
like:
[...]/extensions/registration/DynamicSet.java:64: error: unknown tag: Foo
* DynamicSet.setOf(binder(), new TypeLiteral<Thing<Foo>>() {});
We insert the needed {@code...} to make the build pass for Java 8.
Change-Id: I430b8eb9f2f158c2c7a2a7a8d93446eff3253529
When triggering a garbage collection through ssh it can be specified
whether to run an aggressive garbage collection or not.
Change-Id: Icfecc69915870289f5957912d3d53348f21a83f7
Update the Checkstyle configuration to only warn on lines that exceed
150 characters.
In code reviews we usually ask people to wrap lines at around 80 columns,
but there are too many existing long lines (between 80 and 150) to bother
fixing them all now.
Only wrap the ones that are egregiously long (i.e. more than 150) and add
suppressions for the ones that cannot be wrapped, for example containing
long URLs.
Change-Id: I09625efa7a0509f1d88c27ebc83dda67b6afd026
The old idiom:
api.projects().name("foo").create(in);
more closely matches the REST API, but makes less sense in Java where
we don't necessarily require a hierarchical structure, and we can
infer the project name from the input.
The above becomes the simpler:
api.projects().create(in);
Also include a method to create with just a name.
Change-Id: Ib789854bd22e1a15ceebf37c57382ca4079c4459
When a command is not bound on slaves, non meaningful not bound message
is currently reported. Improve the situation by binding generic SSH
command that reports "not supported in slave mode" message.
Change-Id: Ia25012486b33f98650018c0fa2d1a55eaa7a5cee
Adds SSH command to change project HEAD reference.
Change-Id: I1a4cb0673eb819fae85e9babdb569ab9785662c8
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
NIO methods throw NoSuchFileException, not FileNotFoundException. How
nice.
Throwing from Files#getLastModifiedTime, apart from cluttering up
throws clauses, means callers have to check for FileNotFoundException,
which is verbose and error prone. Instead, implement a helper with the
old File#lastModified() semantics; this preserves old behavior, which
might not handle some error cases well, but worked well enough. (In
theory we could use FileSnapshot or something, but I don't want to
shave that particular yak until/unless I get a chance to add a
Path-compatible interface to FileSnapshot in JGit as well.)
Organize some imports.
Tested:
-Tests pass.
-Initialized a site, including downloading.
-Launched a site.
-Added and removed site headers and CSS in a running site.
-Added and removed plugins, both live and while shutdown.
Change-Id: I60dfe5280512f00dce4ec99fe3689b2f2b3c6685
We previously needed 8 bytes of data from a SecureRandom in order to
start an SSH daemon. Unfortunately, sometimes machines run out of
entropy, for example when running the Gerrit test suite several times
in a row.
Add an undocumented configuration option to use a different Random
factory for Apache SSHD that uses a hard-coded seed instead of
depending on SecureRandom. Unfortunately, because SshDaemon is
constructed using Daemon's injector stack, we can't easily modify its
modules to swap out the provider, so a configuration option is the
easiest solution.
Change-Id: I539b8e3d39d2da9908962fdb8d9633adf935fb4c
Transitive dependency is missing for mina-sshd in sshd_tests rule.
The error message in Java 8 is:
gerrit-sshd/src/test/java/com/google/gerrit/sshd/commands/ProjectConfigParamParserTest.java:41:
error: cannot access org.apache.sshd.server.Command
cmd.parsePluginConfigValues(Collections.singletonList(in));
^
class file for org.apache.sshd.server.Command not found
Change-Id: I5ca948bcd04b7a5ce7588810d1db151309ed39c4
- Change ordering of 'static', 'final', etc modifiers according to
the order suggested by JLS.
- Add comments in empty catch blocks for intentionally ignored
exceptions.
- Add curly braces around if-else blocks.
- Move `catch` to same line as closing brace of preceding `try`
blocks.
- Wrap long lines.
Note that this change does not fix all instances of the above errors
across the entire code base.
Change-Id: I24bb9649cc5013c249fa5d84e05322a5cdf2ace6
The current ChangeHook interface supports methods for event creators and
listeners. Since creators and listeners are unlikely to be the same
classes, it does not make sense to expose both sets of methods to each
type of user. While this change will clean things up API wise, it also
paves the way to split out some event firing logic from the ChangeHooks
class. By splitting this logic it provides a better path to make it
possible for other classes such as a plugins to fire events.
Change-Id: I0906c86fa6ea32aa519b452134d2caddf489df09
Coverity reports a performance issue caused by using the + operator
to concatenate strings within a loop. See CID 19979 on the coverity
scan project [1].
Refactor it to use a StringBuilder instead.
[1] https://scan.coverity.com/projects/4032
Change-Id: I0db269bfb19d5f84dfc5815f8f286052e2bc6140
Coverity reports a performance issue caused by using the + operator
to concatenate strings within a loop. See CID 20069 on the coverity
scan project [1].
Refactor it to use a StringBuilder instead.
[1] https://scan.coverity.com/projects/4032
Change-Id: Ib091b3a1ac8a2404b2d68e88c17c28e31f70475c
Coverity reports a performance issue caused by using the + operator
to concatenate strings within a loop. (See CID 20103) on the coverity
scan project [1].
Refactor it to use a StringBuilder instead.
[1] https://scan.coverity.com/projects/4032
Change-Id: Id071ac4d4369e47ca5bf8dcd2d13a9e6f10fd3a5