Archives created by the ArchiveCommand didn't produce deterministic
archive hashes. For RevCommits RevWalk.parseTree returns the root tree
instead of the RevCommit hence retrieving the commit's timestamp didn't
work. Instead use RevWalk.parseAny and extract the tree manually.
Archive entries store timestamps with 1 second resolution hence we need
to wait longer when creating the same archive twice and compare archive
hashes. Otherwise hash comparison in tests wouldn't fail without this
patch.
Bug: 548312
Change-Id: I437d515de51cf68265584d28a8446cebe6341b79
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
update Maven plugins
- ecj to 3.17.0
- error_prone_core to 2.3.3
- plexus-compiler-eclipse to 2.8.5
- plexus-compiler-javac to 2.8.5
- plexus-compiler-javac-errorprone to 2.8.5
Change-Id: I51ecb44538915ed84db041510562394bce977a3e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
update Maven plugins
- jacoco-maven-plugin to 0.8.4
- japicmp-maven-plugin to 0.14.1
- maven-compiler-plugin to 3.8.1
- maven-deploy-plugin to 3.0.0-M1
- maven-enforcer-plugin to 3.0.0-M2
- maven-install-plugin to 3.0.0-M1
- maven-jar-plugin to 3.1.2
- maven-javadoc-plugin to 3.1.0
- maven-jxr-plugin to 3.0.0
- maven-pmd-plugin to 3.12.0
- maven-resources-plugin to 3.1.0
- maven-shade-plugin to 3.2.1
- maven-source-plugin to 3.1.0
- maven-surefire-plugin to 3.0.0-M3
- spotbugs-maven-plugin to 3.1.12
- tycho to 1.3.0
- tycho-pack200a-plugin to 1.3.0
- tycho-pack200b-plugin to 1.3.0
Cleanup Maven warnings
- pin version of all used Maven plugins
- remove deprecated way to declare minimum Maven version
Change-Id: If23e2e2bb03e5e1e7b1eb9d4924a8faa0aa3704e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This change is fixing confusing name warning: [1].
./org.eclipse.jgit.test/tests.bzl:12: confusing-name:
Never use 'l', 'I', or 'O' as names (they're too easily confused
with 'I', 'l', or '0').
And is also fixing: "All calls to rules or macros should pass arguments
by keyword position argument" warning: [2].
./org.eclipse.jgit.test/BUILD:42: positional-args: All calls to rules
or macros should pass arguments by keyword (arg_name=value) syntax.
[1] https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#confusing-name
[2] https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#positional-args
Change-Id: If5c28ec8a1ddc1d1b1035bd07b838a2a564aea4f
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
This is needed to make build tool chain compatible with the latest
Bazel releases.
Change-Id: I9822b5fe5f934457e6069217d687b3cf4764b7b7
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
This update is required for Java 11.
Update
- org.mockito to 2.23.0.v20190527-1420
- net.bytebuddy.byte-buddy to 1.9.0.v20181107-1410
- net.bytebuddy.byte-buddy-agent to 1.9.0.v20181106-1534
CQ: 20214
CQ: 20215
CQ: 20216
See: https://github.com/mockito/mockito/issues/1482
Change-Id: I3ac744f7247c71f01d50f7f409fee5825f3d5295
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
In JDK 9 and later, the default locale data uses data derived from the
Unicode Consortium's Common Locale Data Repository (CLDR). So there are
changes with respect to some locales.
For example the short date-time format is ‹{1}, {0}› in the CLDR locale,
as opposed to {1} {0} in the JRE locale data.
See: https://bugs.openjdk.java.net/browse/JDK-8206961
See: https://www.unicode.org/cldr/charts/29/by_type/date_&_time.gregorian.html#1141bf54834c4261
Change-Id: I7535821e8ecd8702a95db8732cbbf3a4a7385eca
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Replace javax.xml.bind.DatatypeConverter, that is not available any
more in Java 11 and later with Hex utility from non optional Bouncy
Castle library.
Bug: 540790
Change-Id: I9903c00ecc1a434e9795b8ba9267f02628fdc0e9
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
As reported by Error Prone:
An inner class should be static unless it references members of its
enclosing class. An inner class that is made non-static unnecessarily
uses more memory and does not make the intent of the class clear.
See https://errorprone.info/bugpattern/ClassCanBeStatic
Change-Id: Ib99d120532630dba63cf400cc1c61c318286fc41
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
(cherry picked from commit ee40efcea4)
Error Prone reports the warning on several classes:
[NonOverridingEquals] equals method doesn't override Object.equals;
if this is a type-specific helper for a method that does override
Object.equals, either inline it into the callers or rename it to
avoid ambiguity.
See https://errorprone.info/bugpattern/NonOverridingEquals
Most of these are in the public API, so we can't rename or inline them
without breaking the API. FileSnapshot is not part of the public API,
but clients may be using it anyway, so we also shouldn't change that.
Suppress all the warnings instead. Having the check at severity ERROR
will at least make sure we don't introduce any new occurrences.
Change-Id: I92345c11256f06b4fa03ccc13337f72af5a43591
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
ParseableSimpleDateFormat is an enum, and enums must be immutable,
hence the member should be final. At the same time, make it private
since it does not need to be publicly visible.
Change-Id: I7e181f591038d556f1123b6e37adf8441059e99a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Reference comparison is intentional. The END and DELIM string
constants are used as sentinels and will always be the same
instances.
Suppress both ReferenceEquality and StringEquality warnings.
Change-Id: I4ce0495702c56b3911f42f26c2f81d28073cbe19
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Reference comparison with EMPTY and MISSING_FILE is intended; these
are static instances used as markers, and will always be the same
instances.
Change-Id: Ic27f5b797bdb9370cf8f6b3b7bb3f1523d4a454c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Reference comparison of the RevCommit objects is OK; BlameGenerator uses
a single RevWalk which caches the RevCommits, so if a given commit is
cached the RevWalk will always return the same instance.
Factor the comparison out to a method, and suppress the warning with an
explanatory comment.
Change-Id: I5a148001dba7749ac15119aed388adb12b6f51ad
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Otherwize the jgit command line does not support the xz archive format.
Change-Id: I64897e658e4ed761614948b9d432f26e83034f15
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This wasn't the case for the bundles
- org.eclipse.jgit.ant
- org.eclipse.jgit.archive
Change-Id: Ibefcc82174fe23a9c1afb765099957414ac3556b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
When cloning repository with --single-branch option, tag chains are not
packed and pack file is broken in some cases.
Typical test-case:
git tag -a test_tag <commit-id>
git tag -a test_prev_tag test_tag
git tag -d test_tag
git clone --single-branch <repository>
fatal: did not receive expected object <test_tag_id>
The reason for that is missing object for original test_tag reference,
which was deleted.
Problem description:
When pack-objects is given --include-tag, it peels each tag reference
down to a commit. If the commit is prepared to be packed, we we have to
include such tag too. The problem is when the tag points to through some
chain of other tag to commit. Then, the inner tags are not added leading
to broken pack.
Fix:
When going to commit, we have to check and add any of the tags on the
way (if they were not selected, which may happen with --single-branch
option).
Change-Id: I1682d4a2c52d674f90a1b021e0f6c3524c5ce5bc
Signed-off-by: Pavel Flaška <Pavel.Flaska@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Issues reported by downstream analyzers.
The "hash" method can be static.
It is a good practice to group overloaded methods. Move the write(URL)
method with the other writes.
Change-Id: Ia42c0d7081333edcb77e58d5e627929d29672490
Signed-off-by: Ivan Frade <ifrade@google.com>
Downstream analyzers reported empty fields in the javadoc. I corrected
few more details:
* Fill empty javadoc fields.
* Use <p> to separate description paragraphs.
* End description paragraphs with a period.
* Remove period at the end of field descriptions.
Change-Id: I749e4b821fc855999caddc442ac788fa514386ea
Signed-off-by: Ivan Frade <ifrade@google.com>
Reported by downstream analyzers. Suppress the warning on reference
equality for isMissing and fill an empty javadoc field.
Change-Id: I3494423daf2a53ca10e0a9c66553f00204c35396
Signed-off-by: Ivan Frade <ifrade@google.com>
Using the | and & operators in boolean conditions results in a warning
from Error Prone:
[ShortCircuitBoolean]
Prefer the short-circuiting boolean operators && and || to & and |.
see https://errorprone.info/bugpattern/ShortCircuitBoolean
Change-Id: I182f986263b8b9ac189907f4bd1662b4092a52d8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Using the | and & operators in boolean conditions results in a warning
from Error Prone:
[ShortCircuitBoolean]
Prefer the short-circuiting boolean operators && and || to & and |.
see https://errorprone.info/bugpattern/ShortCircuitBoolean
Change-Id: I6cccca3fdd28bf93b302a9b8a66e68ac912cb60d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Using the | and & operators in boolean conditions results in a warning
from Error Prone:
[ShortCircuitBoolean]
Prefer the short-circuiting boolean operators && and || to & and |.
see https://errorprone.info/bugpattern/ShortCircuitBoolean
Change-Id: I4275c60306e43c74030c4465ba02cb853ad444e1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* stable-5.4:
Prepare 5.4.1-SNAPSHOT builds
JGit v5.4.0.201906121030-r
JGit v5.4.0.201906120450-r
Increase severity of OperatorPrecedence to ERROR, and fix instances
PackWriter: Make internal class static
Prepare 5.3.3-SNAPSHOT builds
JGit v5.3.2.201906051522-r
Prepare 5.1.9-SNAPSHOT builds
JGit v5.1.8.201906050907-r
Test detecting modified packfiles
Enhance fsTick() to use filesystem timer resolution
Add debug trace to measure time needed to open pack index
Extend FileSnapshot for packfiles to also use checksum to detect changes
Wait opening new packfile until it can't be racy anymore
Avoid null PackConfig in GC
Add FileSnapshot test testing recognition of file size changes
Capture reason for result of FileSnapshot#isModified
Skip FileSnapshotTest#testSimulatePackfileReplacement on Windows
Tune max heap size for tests
Fix FileSnapshotTest.testNewFileNoWait() to match its javadoc
ObjectDirectory: fix closing of obsolete packs
Update API filters for methods added to fix bugs
Bazel: Increase severity of most error-prone checks to ERROR
Enable error-prone checks by default
Add bazel options to align with gerrit's
Include filekey file attribute when comparing FileSnapshots
Measure file timestamp resolution used in FileSnapshot
Fix FileSnapshot's consideration of file size
Fix API problem filters
Fix API problem filters
Change-Id: I4abbaaf79da1944244511aad97d2df09d47c0c3c
Fix all remaining instances of the OperatorPrededence warning, by adding
parentheses to make the precedence explicit.
Change-Id: Ib296dfed09f9be042d0ff0f7fad8214e4dd766b4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* master:
Handle missing "ours" stage in WorkingTreeIterator.hasCrLfInIndex()
Config: Add helper method to check for empty value
ErrorProne: Increase severity of FutureReturnValueIgnored to ERROR
FS_Win32: Add missing parentheses on if-blocks
Upgrade spotbugs to 3.1.12
Abbreviated{Long}ObjectId: Make operator precedence explicit
GC: Update TODO comments
FS_POSIX: Fix reference comparison of Boolean.FALSE
Increase bazel timeout for long running tests
Use bazelisk to switch between used bazel version
Bump minimum Bazel version to 0.26.1
Bazel: Bump skylib library version to 0.8.0
Retry loading config when locked by another process
Make pull --rebase on an unborn branch do a checkout
Warn if configured cookie file is missing
Handle escaped CR-LF in git config files
DescribeCommand: use glob match instead of path match
Fix off-by-one error in RebaseTodoFile when reading a todo file
Consistently use "!isEmpty()" to detect non-empty list
TransportHttp: Check for non-empty list with "!isEmpty()" rather than
"size() > 0"
TransportHttp: Fix comparison of size with ">= 0"
NetscapeCookieFileTest: Split HttpCookiesMatcher to own class
Bazel: Add missing dependency on mockito for TransportHttpTest
Determine hard-linking and nlink support per FileStore
Support reading and writing cookies.
Repository: Add getIdentifier() method to avoid instanceof operator
Update to Orbit R20190602212107
PacketLineIn: Deprecate the END constant
PacketLineIn: Add an iterator over strings in the input stream
Replace most usages of PacketLineIn.END with PacketLineIn.end()
PacketLineIn: Deprecate DELIM constant
Replace trivial reference comparison of PacketLineIn.{DELIM,END}
PacketLineIn: Rename isDelim to isDelimiter
ProtocolV2ParserTest: Fix typo in comment
Upgrade Bouncy Castle to 1.61
Update to Orbit R20190531194818 and rollback update to Ant 1.10.6
cli: Add the --always option to describe
DescribeCommand: Support the "always" option
cli: Add the --tags option to describe
DescribeCommand: Consistenly omit the default value
Remove excess blank line in FileUtilsTest
PacketLineIn: Add helper methods to check for END and DELIM
UploadPackTest: Rename variable to avoid hiding class member
UploadPackTest: Add missing <> operator on instantiation of ArrayList
BitmapCalculator: javadoc fixes
RevWalkUtils: add progress callback to findBranchesReachableFrom
Upgrade maven-source-plugin to 3.1.0
Upgrade maven-jar-plugin to 3.1.2
Upgrade jacoco-maven-plugin to 0.8.4
BitmapCalculator and its test: add missing license header
RevWalk: new method createReachabilityChecker()
Change-Id: I4d76c7c0dbe6411c842f3468b709f7df51789c08
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
In a delete-modify conflict with the deletion as "ours" there may be
no stage 2 in the index. Add appropriate null checks. Add a new test
for this case, and verify that the file gets added with a single LF
after conflict resolution with core.autocrlf=true. This matches the
behavior of canonical git for this case.
Bug: 547724
Change-Id: I1bafdb83d9b78bf85294c78325e818e72fae53bc
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Rename MAGIC_EMPTY_VALUE to MISSING_ENTRY, make it private, and add
a helper method to check if a given string is that value.
This avoids that callers trigger the "reference equality" warning
from Error Prone.
Change-Id: Idc76f78c0cf1828aa48d02ee33911a4b5df50355
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
The only remaining code where the return value is ignored is in tests.
Update them to store the value and perform a basic assertion.
Change-Id: I29ef5bd5dd0648aac3490f9e47ecc74544109652
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
The TODO comments say "in 5.0", but 5.0 was already released without
resolving them. Remove "in 5.0" on the assumption that the mentioned
improvements still need to be done at some point.
Change-Id: I3eb429803e2266de3fc490e1f3912991c08aa1ad
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
EolRepositoryTest and GcCommitSelectionTest timed out frequently when
running unit tests using bazel with the default timeout "moderate"
(300s). Increase timeout of these tests to "long" (900s).
Change-Id: I43588cf950f55b50f868d9fe9c66d22bd428a54c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Bazelisk is utility to switch to the right Bazel version, that we
used to have with Buck build tool: [1].
Bazelisk will download the right Bazel version only once and will use
it in subsequent calls:
$ bazelisk build :release
2019/06/06 16:22:15 Downloading \
https://releases.bazel.build/0.26.1/release/bazel-0.26.1-linux-x86_64...
Bazelisk is storing the binaries in user's cache directory: [2], e.g.
on Linux OS:
$ ls -1 ~/.cache/bazelisk/bin
bazel-0.26.1-linux-x86_64
* [1] https://github.com/bazelbuild/bazelisk
* [2] https://golang.org/pkg/os/#UserCacheDir
Change-Id: Ia9180fb75f8cc17a0a0232622cf33a13bfad6b60
Signed-off-by: David Ostrovsky <david@ostrovsky.org>