summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix clone from multi_ack_detailed clientsv2.1.10Shawn Pearce2013-06-241-1/+1
| | | | Change-Id: I3ea32a031a78b7e2507c96a0f3458cf83eb8e964
* Update JGit to patch security hole during clonev2.1.9Shawn Pearce2013-06-221-12/+2
| | | | Change-Id: I95de1ac7f97609f0fed05c9071c082c13d436d04
* Update 2.1.8 release notesv2.1.8Shawn O. Pearce2011-06-242-0/+58
| | | | Change-Id: I3ee5a21441ac8b99afeae36a090efeb7f299bdfe
* Allow serving static files in subdirectoriesJames Y Knight2011-06-241-10/+29
| | | | | | Change-Id: I82447dd9ce47ffc44727d9f886a45a9fa1a2463e Signed-Off-By: James Y Knight <jyknight@google.com> (cherry picked from commit b8ddd05fbf98c63b70bfa3a714952b43bcad549a)
* Normalize OpenID URLs with http:// prefixShawn O. Pearce2011-06-241-1/+6
| | | | | | | | | | Gerrit used to violate OpenID 1.1 and 2.0, both of which require OpenIDs to be normalized (http:// added). Gerrit now normalizes OpenIDs before checking whether they are permitted. Bug: issue 1019 Change-Id: I5e75e7d5782ec400adaacbe26f602b46f502709b (cherry picked from commit e9c3992898b63d5333077b22cd3eeadc6fdb50b1)
* Ignore PartialResultException from LDAP.James Y Knight2011-06-243-12/+22
| | | | | | | | | | | | | | | This exception occurs when the server isn't following referrals for you, and thus the result contains a referral. That happens when you're using Active Directory. You almost certainly don't really want to follow referrals in AD *anyways*, so just ignore these exceptions, so we can still use the actual data. Inspired by: https://src.springframework.org/svn/spring-ldap/trunk/core/src/main/java/org/springframework/ldap/core/LdapTemplate.java Change-Id: I484145a2e262173de6b3ac4081608bd684577916 Signed-Off-By: James Y Knight <jyknight@google.com> (cherry picked from commit 1244ed057467ae07f4f0c6a7d70104ed3a5117dd)
* Fix MySQL counter resetsShawn O. Pearce2011-06-241-1/+1
| | | | | | | | | | | | MySQL resets its counters to 0 on server restarts, resulting in database errors on the next insertion attempt for common entities like account or change. gwtorm 1.1.5 was patched to leave in the dummy row that incremented the counter, ensuring the server will use MAX() + 1 instead of 1 on the next increment after restart. Bug: issue 518 Change-Id: I52cf5354f4fccf787fe8c62539ead6d5f6a0fead (cherry picked from commit 17ca55ff0f4553212c9fc53275d7cf75a0b6d188)
* Substantially speed up pushing changes for reviewJames Y Knight2011-06-241-34/+18
| | | | | | | | | | | | | | | | | | | | | Pushing a new change for review checks if the change is related to the branch it's destined for. It used to do this in a way that required a topo-sort of the rev history, and now uses JGit's merge-base functionality. Typically new commits for review are close to the branch head, so a merge base can be quickly found. The ugly corner case is when there is no history in common, JGit will walk to the root of both branches before erroring out to the end-user. This fortunately does not happen very frequently. If the walk to the root would be costly on the new commits, the user typically notices the problem during `git push` counting too many objects and aborts the request before the code even reaches this point. Change-Id: I2b41e6befcb1abbfdb7ca712e1d6d5e17ba74d78 Signed-Off-By: James Y Knight <jyknight@google.com> (cherry picked from commit f4e6799232b5545871656311c7aedaab957313a6) (cherry picked from commit fcc6493dd49f09cea6331d01c8258c2248bc573b)
* Avoid costly findMergedInto during push to refs/for/*Shawn O. Pearce2011-06-241-8/+13
| | | | | | | | | | | | | | | | | It is uncommon to automatically close a change by first getting the commit into a branch or tag, and then later pushing that commit to refs/for/* and expecting Gerrit will close the change by matching the Change-Id in the commit message footer. Most of the time a change is automatically closed by a direct branch push, and doesn't need this fallback driven by Change-Id in the message. However, leave in the fix for GERRIT-54 e6b34af43cae ("Close change if a replacement patch set is already submitted") to permit users to close a change by pushing the exact commit to refs/changes/NNNN. This format is deprecated and will be removed in the future anyway. Change-Id: Ie5d2af4c1aa2a1bb301b29332e856babf6288b17 (cherry picked from commit 718fd9bcccc290bdbca8e7c67aa28eee901221d3)
* Add cache for tag advertisementsShawn O. Pearce2011-06-2412-133/+796
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a client asks the server for access to a Git repository, the server has to compute a list of tags to advertise to the client. It is an expensive computation to determine which tags are reachable from the branches the client has READ permission on. For large repositories with many tags the computation can take a considerable amount of time, bordering on several seconds per connection. To make the general case more efficient, introduce a cache called "git_tags". On a trivial usage of the Linux kernel repository, the average running time of the VisibleRefFilter when caches were hot was 7195.68 ms. With this commit, it is a mere 5.07 milliseconds on a hot cache. A reduction of 99% of the running time. The caches performs incremental updates under certain situations, making common updates relatively painless for waiting clients: * Branch fast-forward / change submission: When a branch fast-forwards to a new commit, or a change is submitted to a branch, all prior tags that are reachable from that branch are still reachable. The cache updates itself in-place to this new commit, after performing a fast-forward check. Although a fast-forward check requires walking commit history, most fast-forwards are only a few commits ahead of the prior position, making the check fast enough to do on demand for a client. Once the cache has been updated, other clients will not need to perform the check. * Short branch rewinds: If a branch rewinds to a prior version (or cuts to a different history), and in doing so does not eliminate any tags, the cache is updated in-place in real-time. Since the change did not impact any tags, the cache is still valid and can continue to be reused. * Branch deletion: If a branch is deleted, the cache is not updated. The deleted branch is simply ignored in the cache. If a great number of branches are deleted and the cache is wasting memory, site administrators should flush the "git_tags" cache and force a rebuild. However, since a branch costs just 1 bit per tag, plus the size of the branch name string, it would require deleting 75,000 branches before its even worth considering flushing the cache manually... as 75,000 branches is about 5 MB of storage. * Branch creation at another branch tip: If a new branch is created and points to the same commit as an existing branch, the cache is updated by cloning itself and adding the new branch for all tags reachable from the source branch. To keep things thread-safe in memory with minimal locking, this type of update requires making a full copy of the cache's data and is therefore more expensive than the prior update techniques, but is significantly cheaper than a full rebuild. There are some nasty corner cases the cache does not try to handle. For these we just suffer through a full rebuild: * Branch creation not at another branch tip: Since the newly created branch does not exactly match another branch, the project history must be scanned and computed to determine which tags are reachable from which branches. There is no optimization available for creating a new branch at an existing tag, so those cases also force a rebuild. * New tag: Since the tag position is not exactly known, which branches can reach it is also not known. The project history is scanned to rebuild the cache. Unlike the prior version of VisibleRefFilter, a rebuild of the cache only walks the history of the project once. This makes a rebuild slightly faster (5s now vs. 7s before). Cache updates occur automatically as a result of observed changes in the Git repository references. Doing these updates live just before sending the advertisement to a client ensure the cache's reachability data accurately represents the advertisement the client will receive. It also ensures any updates made directly to the repository (without Gerrit being involved) is still properly reflected in the result. We try to optimize updates for two common cases: change submission and direct push fast-forwards. Both attempt to update the cache immediately after the reference has been updated. This saves clients from needing to perform the fast-forward check themselves, as the change submission or receive code already performed the check and has the results on hand. There is still room for future improvement: Adding a new tag to the cache could be computed more quickly by copying the old cache, and doing a walk from all branch heads up to the new tag, but stopping at the new tag. This does not always work well when there are disconnected branches in the repository, as those unrelated branches will scan to the roots before terminating, making the update nearly the cost of full rebuild. Adding a new branch not at the exact same position as another branch could be computed more quickly by scanning all commits in the new branch (to see if tags were added), and all commits in existing branches (to see if tags should be excluded), and stopping at the merge base of the two sets. Any tags that are not excluded from the other branches but are reachable from the other branches should also be reachable from the new branch. However this is a tricky concept, as one must consider unrelated branches, so this operation may need to be performed once per unique set of branches that a tag can reach. Since this may require more than one history traversal, and if the branches are unrelated, a traversal all the way to the root, its nearly as expensive as the full rebuild option. Since its a lot more complex than a full rebuild, I am punting on this and may never implement it. Change-Id: I519a39ade2742de02003d9dedd17a8edca5c4923
* Fix ChangeDetailFactory's invocation of PatchSetDetailFactoryv2.1.7.2Shawn O. Pearce2011-06-073-2/+2
| | | | | | | | I flipped the order of the arguments, but did not correctly update all callers. Change-Id: Iae14ec35374342f53bc353082db35cb8750a750a Signed-off-by: Shawn O. Pearce <sop@google.com>
* Release notes for 2.1.7.1v2.1.7.1Shawn O. Pearce2011-06-072-0/+33
| | | | | Change-Id: If75ca735e5bea95f136cd7dc0ebf73de582af37f Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix API breakage on ChangeDetailServiceShawn O. Pearce2011-06-075-17/+25
| | | | | | | | | The Mylyn Reviews project pointed out Gerrit changed the API signature of a JSON method they use remotely. Fix the API back to the original signature, and define a new method with the extra arguments. Change-Id: I51cbbdd64bdb72a666a6b5266db3b93494b75182 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Merge "Resolve Project Owners when checking access right on any ref" into stableShawn Pearce2011-06-072-5/+27
|\
| * Resolve Project Owners when checking access right on any refEdwin Kempin2011-06-032-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A project is visible to a user when the user has Read Access on any ref of the project. This check whether an access right is granted on any ref is not taking the access rights granted to the 'Project Owners' group into account. As a result a user does not see a project if he is project owner and Read Access is only granted to the 'Project Owners' group. This change ensures that the 'Project Owners' group is properly resolved in this case. Bug: issue 997 Change-Id: I27cd8293e5c4a01c867a4e076073bf587294e0ba Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* | Do not reset Patch History selection on navigation to next file diffEdwin Kempin2011-06-031-0/+3
|/ | | | | | | | | | | | | | | | When the user views a file diff and then changes in the Patch History the selection of side A (left side), then this selection is lost when the user navigates to the previous or next file diff. The selection of side A is always reset to the patch set that is selected as 'Old Version History' on the ChangeScreen (the base for comparing patch sets). This change ensures that the selection in the Patch History is kept when the user navigates to the previous or next file diff. Bug: issue 999 Change-Id: I19cafedd8a11683dca4a24fbebbcacf63425fe62 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* Update 2.1.7 release notesv2.1.7Shawn O. Pearce2011-05-311-21/+151
| | | | | Change-Id: Ib2fe7ccbc1713487333e67216d5082e8e71497b8 Signed-off-by: Shawn O. Pearce <sop@google.com>
* ExportReviewNotes: Default to 2 threadsShawn O. Pearce2011-05-312-3/+2
| | | | | | | | | 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>
* Escape spaces in HTTP URLs during replicationShawn O. Pearce2011-05-272-2/+70
| | | | | | | | | | | | If the repository name contains spaces (e.g. "-- All Projects --") the spaces must be URL encoded using the esacpe "%20" in order to appear in an http:// or https:// URL. Encoding does *not* happen for ssh:// and git:// protocols as these both pass-through the remote repository name as-is. Change-Id: I3bb494c1bc3e21f3a9960071e9930a5ec1c8cf1a Signed-off-by: Shawn O. Pearce <sop@google.com>
* Invert signed-in and signed-out background colorsShawn O. Pearce2011-05-242-4/+4
| | | | | | | | | Most users work in the signed-in mode when reading source files during review. Using the white background makes it easier to read the text, especially with syntax coloring enabled. Change-Id: If49aa62c0ff26971c64fd75505265c58ac859062 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix SLF4J StaticLoggerBinder warningNasser Grainawi2011-05-201-0/+4
| | | | | | http://www.slf4j.org/codes.html#StaticLoggerBinder Change-Id: Ic04c0f1f45ce4a454df95d741ca421b6d27a7fe9
* ExportReviewNotes: Dump submitted changes to refs/notes/reviewShawn O. Pearce2011-05-209-83/+524
| | | | | | | | | 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>
* Support different color pallete when not signed inv2.1.7-rc2Shawn O. Pearce2011-05-209-79/+125
| | | | | | | | | If the user is not signed in a different theme of colors can be applied to the UI, making it more obvious that login is necessary. Bug: issue 913 Change-Id: Id8c780042740b3b93dcee7ed84b3f9f6be06d9de Signed-off-by: Shawn O. Pearce <sop@google.com>
* Merge changes I14eb9d19,I8f6d5c5a into stableShawn O. Pearce2011-05-202-3/+3
|\ | | | | | | | | | | * changes: Send new patchset event after its available Enable git:// download URLs if canonicalGitUrl set
| * Send new patchset event after its availableShawn O. Pearce2011-05-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | gerrit stream-events sent notification of a new patch set before it created the reference in the Git repository. This confused some CI systems that were able to read the stream-events message and look for the reference before the server was able to create it. Bug: issue 755 Change-Id: I14eb9d19984701eb9afbb13e006a24057e8c3473 Signed-off-by: Shawn O. Pearce <sop@google.com>
| * Enable git:// download URLs if canonicalGitUrl setShawn O. Pearce2011-05-201-1/+2
| | | | | | | | | | | | | | | | | | | | If the administrator has set gerrit.canonicalGitUrl but has left the download.scheme variable unset to its default, assume they want to use git:// as a type of download and enable it. Bug: issue 966 Change-Id: I8f6d5c5a3d16821d07c61f16bce9680a7e0721e5 Signed-off-by: Shawn O. Pearce <sop@google.com>
* | Merge "Add config setting to only suggest users which are in a visible ↵Shawn Pearce2011-05-203-0/+20
|\ \ | |/ |/| | | group" into stable
| * Add config setting to only suggest users which are in a visible groupEdwin Kempin2011-05-203-0/+20
| | | | | | | | | | | | | | | | | | Add a new setting for the suggest section in the Gerrit configuration that limits the suggested users to those which are in at least one group that is visible to the current user. Change-Id: I89654bfdf63e2b780c5e0c93ee54b14afc1640a0 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* | Fix NPE on Gerrit startup if mail.from doesn't include a nameEdwin Kempin2011-05-201-2/+2
|/ | | | | | | | | If for mail.from in the gerrit.config only an e-mail address but no name was set, Gerrit failed on startup with a NullPointerException. Bug: issue 961 Change-Id: Ie99a6c7ae42d77e408bc624408b2d13c8b5f9797 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* Fix unused and deprecation warningsShawn O. Pearce2011-05-193-15/+2
| | | | | | | | Despite our best efforts to resolve warnings, some new ones slipped in late this afternoon. Change-Id: I4b8f8bba08de2d5c7a2a03c04d121c0e447bfa8e Signed-off-by: Shawn O. Pearce <sop@google.com>
* Merge "Adds a "revert change"-button to a submitted patchset." into stableShawn Pearce2011-05-1918-1/+425
|\
| * Adds a "revert change"-button to a submitted patchset.Gustaf Lundh2011-05-1918-3/+425
| | | | | | | | Change-Id: I409e656c88a7021f604c021ca3987d2e917c18d9
* | Fix assertion caused by early key-rebinding in ChangeScreenShawn O. Pearce2011-05-191-3/+3
| | | | | | | | | | | | | | | | | | | | Keys cannot be registered until the prior screen has dropped its key bindings. Move the activation of the current patch set into the registerKeys() routine of ChangeScreen, where its legal to register (or re-register) the key bindings. Change-Id: I24bba5a09bd9f1452e01bdb5685e2b332aa51106 Signed-off-by: Shawn O. Pearce <sop@google.com>
* | Implement web interface for patches diffmonica.dionisio2011-05-199-41/+238
| | | | | | | | | | | | | | | | | | | | | | Support diff between patches in the change screen. Allow changing patches base comparison. All displayed patches can now have their files listed and compared to target branch or to a specific patch of the change. Bug issue: 194 Change-Id: I617cbe647338b8a4fb71788f04ab6e2c952780fc
* | Support diff between patch setsmonica.dionisio2011-05-196-22/+92
| | | | | | | | | | | | | | | | | | | | | | Pass through arguments for diff between patch sets Modify internal APIs to pass through the old, new and preferences needed to compute the differences between two patch sets for the UI. Bug: issue 194 Change-Id: I98827bf88227e912860769f22cd90f5c35b784b0
* | Fix connectivity check for new branchesShawn O. Pearce2011-05-191-0/+7
| | | | | | | | | | | | | | | | | | If a branch did not yet exist (e.g. a new project with no commits) Gerrit refused to allow uploading a new change for review, as the new commit was not connected to the history. Change-Id: Ie0beca2c51751d618655dcb739ff94de87ace75b Signed-off-by: Shawn O. Pearce <sop@google.com>
* | Merge "Documenting when different regexp libraries are used" into stableShawn Pearce2011-05-194-12/+35
|\ \
| * | Documenting when different regexp libraries are usedMagnus Bäck2011-05-194-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation hasn't been clear on which regular expression implementations were used when e.g. interpreting different configuration variables. In trivial cases this doesn't matter as most regular expression metacharacters are widely supported, but for complex expressions it can be beneficial to know. Change-Id: I2a479aba68779cf857dac9999bc4a90ac2685838
* | | Delete unused setDest() in MergedSenderShawn O. Pearce2011-05-192-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | We moved the private instance member this used to populate, as it was never read (and is thus dead code). But we forgot to also delete the now-dead setter. Change-Id: I5ef5897c58f32c88908c5134ef8221b1d938f970 Signed-off-by: Shawn O. Pearce <sop@google.com>
* | | Delete dead code computing domain of ActiveDirectoryShawn O. Pearce2011-05-191-10/+0
| | | | | | | | | | | | | | | | | | | | | We no longer use the default domain computation. Change-Id: Id08974efbb19e7aef8ed7ed9c43eb03a93d34047 Signed-off-by: Shawn O. Pearce <sop@google.com>
* | | init: Fix prompting for Account BaseDNShawn O. Pearce2011-05-191-0/+5
| | | | | | | | | | | | | | | | | | | | | This was accidentally dropped as dead code. Change-Id: Ie5d5f6425829c8f1361ea05eb71266aab75986eb Signed-off-by: Shawn O. Pearce <sop@google.com>
* | | Merge "Fix calculation of project owners" into stableShawn Pearce2011-05-192-5/+39
|\ \ \
| * | | Fix calculation of project ownersEdwin Kempin2011-05-192-5/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calculating the owners of a project the ref pattern to which the OWN access rights are assigned are ignored and the inherited OWN access rights are also not taken into account. There are two use-cases for which the owners of a project must be calculated: 1. e-mail notification for project owners about new changes: This e-mail notification should only be sent to the local project owners (the groups to which the OWN access right is assigned on this project). In case there are no local owners for a project this e-mail notification should be sent to the local owners of the nearest parent project that has local owners. 2. resolving of the system group 'Project Owners': The 'Project Owners' system group should be resolved to all groups that are allowed to administrate the project. These are the local owners plus the inherited owners. For both use cases we have to filter the OWN access rights to only those access rights that are assigned for the ref pattern 'refs/*'. This change implements the logic described above. Change-Id: Ib90014caf628db00250694f00741076db0492113 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* | | | Merge "Go back to change screen if 'Publish and Submit' fails on submit" ↵Shawn Pearce2011-05-191-1/+1
|\ \ \ \ | |/ / / |/| | | | | | | into stable
| * | | Go back to change screen if 'Publish and Submit' fails on submitEdwin Kempin2011-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'Publish and Submit' action is not atomic. This means if the submit fails the comments and approvals will still be published. If the screen stays with the PublishCommentScreen on submit failure there is no indication for the user that the comments and approvals were actually published. To make this more obvious we now go back to the change screen before displaying the submit error. On the change screen the user can then see that the comments and approvals were successfully published. Bug: issue 963 Change-Id: I9fcfd6b89b53db6f672d79714c6942fa953e5dd9 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* | | | Move ANTLR code to its own packageShawn O. Pearce2011-05-1910-21/+463
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way we can set the Eclipse warnings/error reporting for the generated code to ignore problems we normally try to prevent in human written sources. Change-Id: I0b32d4ebf95611f58468a14e81489bf76f5d7603 Signed-off-by: Shawn O. Pearce <sop@google.com>
* | | | Fix GWT DeferredCommand deprecationsShawn O. Pearce2011-05-196-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move to the new Scheduler API. It hasn't been deprecated yet. Change-Id: Icfe5d6a53f362a97e798afae9f8eb984b13e8ae5 Signed-off-by: Shawn O. Pearce <sop@google.com>
* | | | Fix SuggestBox related deprecation warningsShawn O. Pearce2011-05-194-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We always use the DefaultSuggestionDisplay so its reasonable to perform the downcast here to that type in order to control the UI as we want it to behave. Change-Id: Id48fdaf59ece74abe67773c800f23c3b8312ff3c Signed-off-by: Shawn O. Pearce <sop@google.com>
* | | | Fix unchecked type warnings in predicate testsShawn O. Pearce2011-05-193-13/+27
| | | | | | | | | | | | | | | | | | | | Change-Id: If9c681e429e8c130c8cdf3f449a889eb234f3d2d Signed-off-by: Shawn O. Pearce <sop@google.com>
* | | | Add missing serialVersionUID to servletsShawn O. Pearce2011-05-194-0/+6
| | | | | | | | | | | | | | | | | | | | Change-Id: I430066f9f5903d9893882d8c8f3bbbdff8ce4b9e Signed-off-by: Shawn O. Pearce <sop@google.com>