Commit Graph

5054 Commits

Author SHA1 Message Date
Dan Willemsen b6fc8e2f3c RepoCommand: Add linkfile support.
Android wants them to work, and we're only interested in them for bare
repos, so add them just for that.

Make sure to use symlinks instead of just using the copyfile
implementation. Some scripts look up where they're actually located in
order to find related files, so they need the link back to their
project.

Change-Id: I929b69b2505f03036f69e25a55daf93842871f30
Signed-off-by: Dan Willemsen <dwillemsen@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jeff Gaston <jeffrygaston@google.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-18 10:33:37 +02:00
Matthias Sohn fac16fe16a Add some tests for alternates
Change-Id: I00d256d0e132c0b5ff02ff27a26fbf21ecc1bccd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-18 03:56:36 -04:00
Jonathan Nieder f9e13efe47 Merge "Process all "have"s even when MissingObjectException is encountered" 2017-04-17 14:53:27 -04:00
Jonathan Nieder c2e6e7abc9 Process all "have"s even when MissingObjectException is encountered
Because objects described by the client using "have" lines do not need
to be reachable by any ref on the server, it is possible for them to
point to missing objects in the reachability graph.  When such an
object is encountered, I1097a2defa4a9dcf502ca8baca5d32880378818f (Only
throw MissingObjectException when necessary, 2017-03-29) aborts the
"have" walk early to salvage the fetch.  The downside of that change
is that remaining "have"s are ignored unless they pointed directly to
an object with a bitmap.  In the worst case this can increase the
bandwidth cost of a fetch to the cost of a clone because most "have"s
are ignored.

Avoid this cost by bypassing the failed "have" completely and moving
on to the remaining "have"s.

Change-Id: Iac236b6d05f735078c9935abfa6e58d1eb47f388
2017-04-17 11:50:28 -07:00
David Pursehouse a6df70569a Merge "Prevent alternates loop" 2017-04-17 12:01:55 -04:00
Martin Fick e4714a2a5f Prevent alternates loop
When looping through alternates, prevent visiting the same object
directory twice. This could happen when the objects/info/alternates file
includes itself directly or indirectly via a another repo and its
alternates file.

Change-Id: I79bb3da099ebc3c262d2e6c61ed4578eb1aa3474
Signed-off-by: James Melvin <jmelvin@codeaurora.org>
Signed-off-by: Martin Fick <mfick@codeaurora.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-14 23:35:17 +02:00
Matthias Sohn 3af4afdfbf Add missing @since tag for new API RepoCommand.setTargetURI()
Change-Id: I4531b94e3a04606a69eeb3c3d154510b87507012
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-14 19:49:19 +02:00
Matthias Sohn 3267f9161d Update Maven plugins
- japicmp-maven-plugin to 0.8.1
- maven-surefire-plugin to 2.20
- maven-surefire-report-plugin to 2.20
- tycho-extras to 1.0.0

Change-Id: Iecc9a5aeb7811a8ecc8198c8836a4a739be3cc08
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-14 19:03:36 +02:00
David Pursehouse c80d8c5901 Bazel: Restrict src globs to Java source files
Generating the src list with an unrestricted wildcard causes all
files in the source tree to be included. This results in junk files
such as .orig (generated during merge conflict resolution) to be
included, which causes in a build error:

  in srcs attribute of java_library rule //org.eclipse.jgit:jgit:
  file '//org.eclipse.jgit:src/org/eclipse/jgit/gitrepo/RepoCommand.java.orig'
  is misplaced here (expected .java, .srcjar or .properties).

Modify the globs to only include Java source files.

Change-Id: Iaef3db33ac71d71047cd28acb0378e15cb09ece9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-13 14:14:55 +09:00
Han-Wen Nienhuys fe5437e96b Fix RepoCommand to allow for relative URLs
This is necessary for deploying submodules on android.googlesource.com.

* Allow an empty base URL. This is useful if the 'fetch' field is "."
  and all names are relative to some host root.

* The URLs in the resulting superproject are relative to the
  superproject's URL. Add RepoCommand#setDestinationURI to
  set this. If unset, the existing behavior is maintained.

* Add two tests for the Android and Gerrit case, checking the URL
  format in .gitmodules; the tests use a custom RemoteReader which is
  representative of the use of this class in Gerrit's Supermanifest
  plugin.

Change-Id: Ia75530226120d75aa0017c5410fd65d0563e91b
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-13 10:53:58 +09:00
Jonathan Nieder e730fcce77 Merge "BundleWriter: Allow constructing from only an ObjectReader" 2017-04-12 21:12:15 -04:00
Terry Parker 56a1cced74 Merge "Only throw MissingObjectException when necessary" 2017-04-12 10:25:11 -04:00
Dave Borowitz c9c9e672e5 BundleWriter: Allow constructing from only an ObjectReader
Change-Id: I01821d6a9fbed7a5fe4619884e42937fbd6909ce
2017-04-12 08:27:57 -04:00
Matthias Sohn cc0dbbae43 Merge branch 'stable-4.7'
* stable-4.7:
  Cleanup and test trailing slash handling in ManifestParser
  ManifestParser: Throw exception if remote does not have fetch attribute

Change-Id: Ia9dc3110bcbdae05175851ce647ffd11c542f4c0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-11 00:54:16 +02:00
Han-Wen Nienhuys f17ec3928c Cleanup and test trailing slash handling in ManifestParser
This is a workaround for
https://bugs.openjdk.java.net/browse/JDK-4666701.

Change-Id: Idd04657e8d95a841d72230f8881b6b899daadbc2
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-11 00:37:38 +02:00
Han-Wen Nienhuys 84d855cda7 ManifestParser: Throw exception if remote does not have fetch attribute
In the repo manifest documentation [1] the fetch attribute is marked
as "#REQUIRED".

If the fetch attribute is not specified, this would previously result in
NullPointerException. Throw a SAXException instead.

[1] https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.txt

Change-Id: Ib8ed8cee6074fe6bf8f9ac6fc7a1664a547d2d49
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-10 15:08:32 +02:00
Matthias Sohn fc24c5e18d Add missing @Override annotations in AppServer.TestMappedLoginService
Change-Id: Ia728f1d033ecdf96b22945bc1ae38e5cb11064dd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-09 23:43:43 +02:00
Matthias Sohn b3cc05d886 Remove unused API filters
Change-Id: I1e00d71395228265aad4071b023024ee1bf855d5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-09 23:43:43 +02:00
Matthias Sohn 2642c727ad Update JGit version used to detect API changes to 4.7.0.201704051617-r
We detect API changes during the Maven build using japicmp. Update the
reference version to the latest minor version 4.7.0.201704051617-r.

Change-Id: Iab354fbf745cdfe44f71ce0bb64bb838b8bcd57d
2017-04-09 23:43:43 +02:00
Matthias Sohn 81ef0cd058 Exclude generated class UbcCheck from PMD checks
Silence the many duplicate code warnings for this generated class.

Change-Id: I3ecb0f986c809dad962b821c5de7cf18865642d3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-09 17:07:21 -04:00
David Pursehouse 21fa8f6192 Merge branch 'stable-4.7'
* stable-4.7:
  Prepare 4.5.3-SNAPSHOT builds
  JGit v4.5.2.201704071617-r

Change-Id: Id52cd145a94919b43bc31274d28940c101790080
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-09 21:03:53 +09:00
David Pursehouse 52be84aea5 Merge branch 'stable-4.6' into stable-4.7
* stable-4.6:
  Prepare 4.5.3-SNAPSHOT builds
  JGit v4.5.2.201704071617-r

Change-Id: I5d2044c59af7bc2786fb66ebf5130e412884d74b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-09 20:03:33 +09:00
David Pursehouse c047e2ad2d Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Prepare 4.5.3-SNAPSHOT builds
  JGit v4.5.2.201704071617-r

Change-Id: I4e1915d3a88e15c9ef1fb2b470b7f3b821243ff5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-09 17:22:39 +09:00
Matthias Sohn 3db0f507ee Prepare 4.5.3-SNAPSHOT builds
Change-Id: I69681b7a5687ca76bd0dd5d3e7ce2cff841d0e32
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-08 00:31:09 +02:00
Matthias Sohn c1d3ecbeab JGit v4.5.2.201704071617-r
Change-Id: I66402643d7c84c90bf5cefed4d2ec3aa68c94cfb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-07 22:17:27 +02:00
Matthias Sohn 7adacbd19a Silence API error for new method added to abstract MergeStrategy
OSGi semantic versioning rules allow to break implementors of an API in
a minor version.

Change-Id: I4ada3e6455e8e8e1bb8fb71affa0a1b36bd46fc4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-06 18:17:22 +02:00
Matthias Sohn 4e8655c74d Fix @since tags of new API added after 4.7.0
Change-Id: I356f71cdef8e23a9b06cf0a4079060a116b9ed27
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-06 18:16:04 +02:00
David Pursehouse e48dd364f8 Merge branch 'stable-4.7'
* stable-4.7:
  PushConnectionTest: Increase maxCommandBytes again

Change-Id: Idbbc48964166ef80d578dde1b68e1ade892f00dc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-06 13:28:20 +09:00
David Pursehouse 661232b1e9 PushConnectionTest: Increase maxCommandBytes again
It was already increased in 61a943e, but that was still not enough to
take into account the length of snapshot versions.

Change-Id: Ib54cec97e97042fe274b87a3a1afa9bb06c8bf19
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-06 11:45:02 +09:00
David Pursehouse c4e952109f Merge branch 'stable-4.7'
* stable-4.7:
  Prepare 4.7.1-SNAPSHOT
  JGit v4.7.0.201704051617-r

Change-Id: I1e27e9875f7a8ed68fdde79640d0fd9a7205faca
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-06 10:10:22 +09:00
Zhen Chen f5368dc97f Only throw MissingObjectException when necessary
When preparing the bitmap, the flag ignoreMissingStart only applied to
the start object. However, sometime the start object is present but some
related objects are not present during the walk, we should only release
the MissingObjectException when the ignoreMissingStart is set false.

Change-Id: I1097a2defa4a9dcf502ca8baca5d32880378818f
Signed-off-by: Zhen Chen <czhen@google.com>
2017-04-05 19:09:16 -04:00
Matthias Sohn 6a311a071f Prepare 4.7.1-SNAPSHOT
Change-Id: I16a45035258276217446bccc0ad1b0991383aa0c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-06 00:16:53 +02:00
Dave Borowitz 4c3e274588 Support creating Mergers without a Repository
All that's really required to run a merge operation is a single
ObjectInserter, from which we can construct a RevWalk, plus a Config
that declares a diff algorithm. Provide some factory methods that don't
take Repository.

Change-Id: Ib884dce2528424b5bcbbbbfc043baec1886b9bbd
2017-04-05 17:50:54 -04:00
Matthias Sohn 9f4c10784b JGit v4.7.0.201704051617-r
Change-Id: Ic2bd6aca0b7a7e0597ffc1f7cf647b49878f9950
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-05 22:17:44 +02:00
Matthias Sohn aec22e74cf Prepare 4.8.0-SNAPSHOT builds
Change-Id: Ifea6750e79d417a8a2a891b3b5f96d68c7200011
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-05 14:49:49 +02:00
Matthias Sohn 4cfaef4c20 Fix version.sh to update version of imported jgit features
Change-Id: I9f29e84b4d357ac8910b8dc534ea91dc9be96079
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-05 14:48:00 +02:00
Andrey Loskutov ace9e4305a Merge "Fixed NP dereference error reported by ecj in UploadPack.stopBuffering()" 2017-04-05 07:53:26 -04:00
David Pursehouse db8b2c4288 Merge branch 'stable-4.7'
* stable-4.7:
  TarFormat: Use commit time as timestamp for entries

Change-Id: I24e2ad725a32b9b06af4dcac59454c08bd528387
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-05 17:22:16 +09:00
Andrey Loskutov 7476baebfc Fixed NP dereference error reported by ecj in UploadPack.stopBuffering()
Introduced via commit 3b2508b514.

Change-Id: I2b6175c095aea2868a8c302103095accde5170e3
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2017-04-05 09:51:12 +02:00
Shawn Pearce db2493e7d8 Merge "Make diff locations more consistent" 2017-04-04 22:26:38 -04:00
Yasuhiro Takagi b26102469c TarFormat: Use commit time as timestamp for entries
This was already done for ZipFormat in 1448ec3.

Change-Id: Ie131938a3f640c68718dc793d18dd35be5c71e7c
Signed-off-by: Yasuhiro Takagi <ytakagi@bea.hi-ho.ne.jp>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-05 10:01:45 +09:00
David Pursehouse cab9dee333 Merge branch 'stable-4.7'
* stable-4.7:
  PushConnectionTest#limitCommandBytes: Increase maxCommandBytes

Change-Id: I354f46475ee96eb3b31abd303b5df2f3023fcf75
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-05 07:58:34 +09:00
Dave Borowitz edb6593ef0 ResolveMergerTest: Add tests for content merges
Change-Id: I2b85cc239e9b3090426c956cbf9af3deb4106a41
2017-04-04 17:27:15 -04:00
Dave Borowitz e4672d1c16 NameConflictTreeWalk: Mark repo param @Nullable
This is passed directly to the super constructor, where it is also
@Nullable. Marking it here saves the reader a jump.

Change-Id: Icc8db2f2dc6aae6e591aa4f09a3c283336a5424c
2017-04-04 14:53:17 -04:00
Jonathan Nieder db58abbbe8 Merge "Buffer the response until request parsing has done" 2017-04-04 14:25:41 -04:00
Masaya Suzuki 3b2508b514 Buffer the response until request parsing has done
This is a continuation from https://git.eclipse.org/r/#/c/4716/. For a
non-bidirectional request, we need to consume the request before writing
any response. In UploadPack, we write "shallow"/"unshallow" responses
before parsing "have" lines. This has happened not to be a problem most
of the time in the smart HTTP protocol because the underlying
InputStream has a 32 KiB buffer in SmartOutputStream.

Change-Id: I7c61659e7c4e8bd49a8b17e2fe9be67bb32933d3
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
2017-04-04 10:52:49 -07:00
David Pursehouse 61a943e03d PushConnectionTest#limitCommandBytes: Increase maxCommandBytes
A higher limit is required to account for proper JGit version number
being sent in the UserAgent.

The version string "4.7.0.201704031717-r" is 20 characters, however
the strings used during development are shorter:

- When running from mvn, "4.7.0.qualifier" is used; 15 characters
- When running in Eclipse, "unknown" is used; 7 characters

Change-Id: I9aca2f71389a42fedce305e9078db016869c3d1a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-04 21:37:48 +09:00
KB Sriram 4a985f5aa8 Make diff locations more consistent
DiffAlgorithms can return different edit locations for inserts or
deletes, if they can be "shifted" up or down repeating blocks of
lines. This causes the 3-way merge to apply both edits, resulting in
incorrectly removing or duplicating lines.

Augment an existing "tidy-up" stage in DiffAlgorithm to move all
shiftable edits (not just the last INSERT edit) to a consistent
location, and add test cases for previously incorrect merges.

Bug: 514095
Change-Id: I5fe150a2fc04e1cdb012d22609d86df16dfb0b7e
Signed-off-by: KB Sriram <kbsriram@google.com>
2017-04-03 16:45:13 -07:00
David Pursehouse 61e336475d Downgrade Jetty to 9.3.17.v20170317 in Bazel build
Jetty was downgraded on stable-4.6 which doesn't have a Bazel
build.

Change-Id: Ibeb91436169e852a4241189f80e4895b54ce3cd0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-03 08:33:33 +09:00
Matthias Sohn 6d5d3e4584 Merge branch 'stable-4.6'
* stable-4.6:
  Update Jetty to 9.3.17.v20170317
  Revert "Update Jetty to 9.4.1.v20170120 in buck build"
  Revert "Update Jetty to 9.4.1.v20170120"

Change-Id: I9193b568cce9c72da899a8f3eaaf833956438e13
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-02 15:45:00 +02:00