summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
Commit message (Collapse)AuthorAgeFilesLines
* pgm: add option if reflogs should be written when converting to reftableMatthias Sohn2019-12-151-1/+5
| | | | Change-Id: Ie1c38121005965e63015d9a2af26a1caa88d73fa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* pgm: add option to configure if convert-ref-storage should create backupMatthias Sohn2019-12-151-1/+6
| | | | Change-Id: I926f116797508a5982961dfd30c2f765d9536eee Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Set config "extensions" option when converting ref storage formatMatthias Sohn2019-12-151-2/+6
| | | | | | | | | | | | | When converting to reftable format the option extensions.refStorage must be set to "reftable" [1]. When converting back to refdir format this config option needs to be removed. Introduce constants for refStorage config options, also for the "reftree" format. [1] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/master/Documentation/technical/reftable.md#Version-1 Change-Id: I190222fa5edc1ad7309daa9be17ca934ff7971e3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix indentation in ConvertRefStorageMatthias Sohn2019-12-141-7/+7
| | | | Change-Id: Icd007b035e728f641c70cda68befa11a6197003f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Replace chain of if statements with switchCarsten Hammer2019-12-142-33/+40
| | | | | | | | | | | and switch over strings where possible. Sometimes if statements are chained and form a series of comparisons against constants. Using switch statements improves readability. Bug: 545856 Change-Id: Iacb78956ee5c20db4d793e6b668508ec67466606 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit pgm: Format blame output to match canonical gitThomas Wolf2019-11-271-23/+41
| | | | | | | | | | Canonical git shows the zero-Id for lines without commit, and uses the current time stamp for such lines. Also consider lines without commit when calculating the field widths. Change-Id: If0bee9b3e7f90861ad0f387f68e52ecc4a53dfd7 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Make blame work correctly on merge conflictsThomas Wolf2019-11-271-25/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a conflicting file was blamed, JGit would not identify lines coming from the merge parents. The main cause for this was that Blame and BlameCommand simply added the first DirCacheEntry found for a file to its queue of candidates (blobs or commits) to consider. In case of a conflict this typically is the merge base commit, and comparing a auto-merged contents against that base would yield incorrect results. Such cases have to be handled specially. The candidate to be considered by the blame must use the working tree contents, but at the same time behave like a merge commit/candidate with HEAD and the MERGE_HEADs as parents. Canonical git does something very similar, see [1]. Implement that and add tests. I first did this for the JGit pgm Blame command. When I then tried to do the same in BlameCommand, I noticed that the latter also included some fancy but incomplete CR-LF handling. In order to be able to use the new BlameGenerator.prepareHead() also in BlameCommand this CR-LF handling was also moved into BlameGenerator and corrected in doing so. (Just considering the git config settings was not good enough, CR-LF behavior can also be influenced by .gitattributes, and even by whether the file in the index has CR-LF. To correctly determine CR-LF handling for check-in one needs to do a TreeWalk with at least a FileTreeIterator and a DirCacheIterator.) [1] https://github.com/git/git/blob/v2.22.0/blame.c#L174 Bug: 434330 Change-Id: I9d763dd6ba478b0b6ebf9456049d6301f478ef7c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* pgm: add write stats to BenchmarkReftableHan-Wen Nienhuys2019-11-161-1/+36
| | | | | | | | | | | | | | | Usage: git ls-remote https://gerrit.googlesource.com/gerrit > lsr bazel build org.eclipse.jgit.pgm:jgit && rm -rf /tmp/reftable* && \ ./bazel-bin/org.eclipse.jgit.pgm/jgit debug-benchmark-reftable \ --test write_stack lsr /tmp/reftable On my Lenovo x250 laptop, this yields about 1ms per ref write. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: I31c74a08026ba188a3256ef6862dae9d85e6d5ef
* pgm: add command to convert repo to reftableHan-Wen Nienhuys2019-11-161-0/+60
| | | | | | Change-Id: I2f870699995da164a3e7adec430301ac7a53c425 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [pgm] Add --mirror option to clone commandMatthias Sohn2019-10-211-1/+5
| | | | | Bug: 552173 Change-Id: Ic8a98b2e0f8f29afd599723f93e51b06b9f13314 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enable and fix "Statement unnecessarily nested within else clause" warningsDavid Pursehouse2019-10-175-31/+22
| | | | | | | | | | | | | | | Since [1] the gerrit project includes jgit as a submodule, and has this warning enabled, resulting in 100s of warnings in the console. Also enable the warning here, and fix them. At the same time, add missing braces around adjacent and nearby one-line blocks. [1] https://gerrit-review.googlesource.com/c/gerrit/+/227897 Change-Id: I81df3fc7ed6eedf6874ce1a3bedfa727a1897e4c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* reftable: pass OutputStream at construction timeHan-Wen Nienhuys2019-09-201-2/+2
| | | | | | | | | | This makes the intended use of the classes more clear. It also simplifies generic functions that write reftables: they only need a ReftableWriter as argument, as the stream is carried within the ReftableWriter. Change-Id: Idbb06f89ae33100f0c0b562cc38e5b3b026d5181 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-5.4' into stable-5.5Matthias Sohn2019-09-081-3/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.4: Format BUILD files with buildifier Format BUILD files with buildifier [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache Bazel: Format BUILD files with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Fix warning about deprecated lib.bzl Format lib/BUILD with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Bump minimum supported version to 0.29.0 Bazel: Bump skylib library version to 0.8.0 Use bazelisk to switch between used bazel version Bazel: Require minimum bazel version 0.17.1 Fix wrong placeholder index in error message packInaccessible JGitText: Remove unused externalized strings RepoText: Remove unused externalized string CLI: Remove unused externalized strings Change-Id: Idf3abd80ad3b00188f655e638d9908228770911f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Merge branch 'stable-5.3' into stable-5.4Matthias Sohn2019-09-081-3/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.3: Format BUILD files with buildifier [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache Bazel: Format BUILD files with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Fix warning about deprecated lib.bzl Format lib/BUILD with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Bump minimum supported version to 0.29.0 Bazel: Bump skylib library version to 0.8.0 Use bazelisk to switch between used bazel version Bazel: Require minimum bazel version 0.17.1 Fix wrong placeholder index in error message packInaccessible JGitText: Remove unused externalized strings RepoText: Remove unused externalized string CLI: Remove unused externalized strings Change-Id: Iaea77a89fcd821df5dbb24f5e3e39e6d1dfc0bd4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Merge branch 'stable-5.2' into stable-5.3Matthias Sohn2019-09-081-4/+0
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.2: [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache Bazel: Format BUILD files with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Fix warning about deprecated lib.bzl Format lib/BUILD with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Bump minimum supported version to 0.29.0 Bazel: Bump skylib library version to 0.8.0 Use bazelisk to switch between used bazel version Bazel: Require minimum bazel version 0.17.1 Fix wrong placeholder index in error message packInaccessible JGitText: Remove unused externalized strings RepoText: Remove unused externalized string CLI: Remove unused externalized strings Change-Id: I0d8b7f79177a20dc00c89e2cf0005eb3d3039532 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Merge branch 'stable-5.1' into stable-5.2Matthias Sohn2019-09-071-4/+0
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Bazel: Fix warning about deprecated lib.bzl Format lib/BUILD with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Bump minimum supported version to 0.29.0 Bazel: Bump skylib library version to 0.8.0 Use bazelisk to switch between used bazel version Bazel: Require minimum bazel version 0.17.1 Fix wrong placeholder index in error message packInaccessible JGitText: Remove unused externalized strings RepoText: Remove unused externalized string CLI: Remove unused externalized strings Change-Id: Iea37a8e39e9d4872dc607c9222dcf191ce4e4757 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * CLI: Remove unused externalized stringsDavid Pursehouse2019-09-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Id44117dd72b0e71e9bf0046a3c965eeae64cf3ea Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | JGit pgm: make Blame more robust against bogus inputThomas Wolf2019-08-262-2/+23
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the command die with proper messages when the revision cannot be resolved or the file doesn't exist in the repository. Previously the command would throw NPEs in these cases. Bug: 490798 Change-Id: Ia457347aa22cf6bd2c2b6e7b9d705a66b3826307 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | [error prone] suppress AmbiguousMethodReference in AnyObjectIdMatthias Sohn2019-08-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the implementation of the static equals() method to a new method and suppress the error. Deprecate the old method to signal that we intend to remove it in the next major release. See https://errorprone.info/bugpattern/AmbiguousMethodReference Change-Id: I5e29c97f4db3e11770be589a6ccd785e2c9ac7f2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Merge branch 'stable-5.3' into stable-5.4Matthias Sohn2019-08-082-10/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.3: Fix OpenSshConfigTest#config FileSnapshot: fix bug with timestamp thresholding In LockFile#waitForStatChange wait in units of file time resolution Cache FileStoreAttributeCache per directory Fix FileSnapshot#save(long) and FileSnapshot#save(Instant) Persist minimal racy threshold and allow manual configuration Measure minimum racy interval to auto-configure FileSnapshot Reuse FileUtils to recursively delete files created by tests Fix FileAttributeCache.toString() Add test for racy git detection in FileSnapshot Repeat RefDirectoryTest.testGetRef_DiscoversModifiedLoose 100 times Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junit Add missing javadoc in org.eclipse.jgit.junit Enhance RepeatRule to report number of failures at the end Fix FileSnapshotTests for filesystem with high timestamp resolution Retry deleting test files in FileBasedConfigTest Measure filesystem timestamp resolution already in test setup Refactor FileSnapshotTest to use NIO APIs Measure stored timestamp resolution instead of time to touch file Handle CancellationException in FileStoreAttributeCache Fix FileSnapshot#saveNoConfig Use Instant for smudge time in DirCache and DirCacheEntry Use Instant instead of milliseconds for filesystem timestamp handling Workaround SecurityException in FS#getFsTimestampResolution Fix NPE in FS$FileStoreAttributeCache.getFsTimestampResolution FS: ignore AccessDeniedException when measuring timestamp resolution Add debug trace for FileSnapshot Use FileChannel.open to touch file and set mtime to now Persist filesystem timestamp resolution and allow manual configuration Increase bazel timeout for long running tests Bazel: Fix lint warning flagged by buildifier Update bazlets to latest version Bazel: Add missing dependencies for ArchiveCommandTest Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file Add support for nanoseconds and microseconds for Config#getTimeUnit Optionally measure filesystem timestamp resolution asynchronously Delete unused FileTreeIteratorWithTimeControl FileSnapshot#equals: consider UNKNOWN_SIZE Timeout measuring file timestamp resolution after 2 seconds Fix RacyGitTests#testRacyGitDetection Change RacyGitTests to create a racy git situation in a stable way Deprecate Constants.CHARACTER_ENCODING in favor of StandardCharsets.UTF_8 Fix non-deterministic hash of archives created by ArchiveCommand Update Maven plugins ecj, plexus, error-prone Update Maven plugins and cleanup Maven warnings Make inner classes static where possible Fix API problem filters Change-Id: Iec3ad6ccc194582cb844310dc172c3103dae4457 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | Merge branch 'stable-5.2' into stable-5.3Matthias Sohn2019-08-081-9/+13
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.2: Fix OpenSshConfigTest#config FileSnapshot: fix bug with timestamp thresholding In LockFile#waitForStatChange wait in units of file time resolution Cache FileStoreAttributeCache per directory Fix FileSnapshot#save(long) and FileSnapshot#save(Instant) Persist minimal racy threshold and allow manual configuration Measure minimum racy interval to auto-configure FileSnapshot Reuse FileUtils to recursively delete files created by tests Fix FileAttributeCache.toString() Add test for racy git detection in FileSnapshot Repeat RefDirectoryTest.testGetRef_DiscoversModifiedLoose 100 times Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junit Add missing javadoc in org.eclipse.jgit.junit Enhance RepeatRule to report number of failures at the end Fix FileSnapshotTests for filesystem with high timestamp resolution Retry deleting test files in FileBasedConfigTest Measure filesystem timestamp resolution already in test setup Refactor FileSnapshotTest to use NIO APIs Measure stored timestamp resolution instead of time to touch file Handle CancellationException in FileStoreAttributeCache Fix FileSnapshot#saveNoConfig Use Instant for smudge time in DirCache and DirCacheEntry Use Instant instead of milliseconds for filesystem timestamp handling Workaround SecurityException in FS#getFsTimestampResolution Fix NPE in FS$FileStoreAttributeCache.getFsTimestampResolution FS: ignore AccessDeniedException when measuring timestamp resolution Add debug trace for FileSnapshot Use FileChannel.open to touch file and set mtime to now Persist filesystem timestamp resolution and allow manual configuration Increase bazel timeout for long running tests Bazel: Fix lint warning flagged by buildifier Update bazlets to latest version Bazel: Add missing dependencies for ArchiveCommandTest Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file Add support for nanoseconds and microseconds for Config#getTimeUnit Optionally measure filesystem timestamp resolution asynchronously Delete unused FileTreeIteratorWithTimeControl FileSnapshot#equals: consider UNKNOWN_SIZE Timeout measuring file timestamp resolution after 2 seconds Fix RacyGitTests#testRacyGitDetection Change RacyGitTests to create a racy git situation in a stable way Deprecate Constants.CHARACTER_ENCODING in favor of StandardCharsets.UTF_8 Fix non-deterministic hash of archives created by ArchiveCommand Update Maven plugins ecj, plexus, error-prone Update Maven plugins and cleanup Maven warnings Make inner classes static where possible Fix API problem filters Change-Id: I238adfd3080a5fed9d64c3c757297da6ea893918 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | Merge branch 'stable-5.1' into stable-5.2Matthias Sohn2019-08-081-9/+13
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Fix OpenSshConfigTest#config FileSnapshot: fix bug with timestamp thresholding In LockFile#waitForStatChange wait in units of file time resolution Cache FileStoreAttributeCache per directory Fix FileSnapshot#save(long) and FileSnapshot#save(Instant) Persist minimal racy threshold and allow manual configuration Measure minimum racy interval to auto-configure FileSnapshot Reuse FileUtils to recursively delete files created by tests Fix FileAttributeCache.toString() Add test for racy git detection in FileSnapshot Repeat RefDirectoryTest.testGetRef_DiscoversModifiedLoose 100 times Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junit Add missing javadoc in org.eclipse.jgit.junit Enhance RepeatRule to report number of failures at the end Fix FileSnapshotTests for filesystem with high timestamp resolution Retry deleting test files in FileBasedConfigTest Measure filesystem timestamp resolution already in test setup Refactor FileSnapshotTest to use NIO APIs Measure stored timestamp resolution instead of time to touch file Handle CancellationException in FileStoreAttributeCache Fix FileSnapshot#saveNoConfig Use Instant for smudge time in DirCache and DirCacheEntry Use Instant instead of milliseconds for filesystem timestamp handling Workaround SecurityException in FS#getFsTimestampResolution Fix NPE in FS$FileStoreAttributeCache.getFsTimestampResolution FS: ignore AccessDeniedException when measuring timestamp resolution Add debug trace for FileSnapshot Use FileChannel.open to touch file and set mtime to now Persist filesystem timestamp resolution and allow manual configuration Increase bazel timeout for long running tests Bazel: Fix lint warning flagged by buildifier Update bazlets to latest version Bazel: Add missing dependencies for ArchiveCommandTest Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file Add support for nanoseconds and microseconds for Config#getTimeUnit Optionally measure filesystem timestamp resolution asynchronously Delete unused FileTreeIteratorWithTimeControl FileSnapshot#equals: consider UNKNOWN_SIZE Timeout measuring file timestamp resolution after 2 seconds Fix RacyGitTests#testRacyGitDetection Change RacyGitTests to create a racy git situation in a stable way Deprecate Constants.CHARACTER_ENCODING in favor of StandardCharsets.UTF_8 Fix non-deterministic hash of archives created by ArchiveCommand Update Maven plugins ecj, plexus, error-prone Update Maven plugins and cleanup Maven warnings Make inner classes static where possible Fix API problem filters Change-Id: Ia57385b2a60f48a5317c8d723721c235d7043a84 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Use Instant instead of milliseconds for filesystem timestamp handlingMatthias Sohn2019-07-181-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables higher file timestamp resolution on filesystems like ext4, Mac APFS (1ns) or NTFS (100ns) providing high timestamp resolution on filesystem level. Note: - on some OSes Java 8,9 truncate milliseconds, see https://bugs.openjdk.java.net/browse/JDK-8177809, fixed in Java 10 - UnixFileAttributes truncates timestamp resolution to microseconds when converting the internal representation to FileTime exposed in the API, see https://bugs.openjdk.java.net/browse/JDK-8181493 - WindowsFileAttributes also provides only microsecond resolution Change-Id: I25ffff31a3c6f725fc345d4ddc2f26da3b88f6f2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Make inner classes static where possibleDavid Pursehouse2019-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ee40efcea44bc0c9a28afe29a80c87636947484e)
* | | | Blame: Suppress ReferenceEquality warning for RevCommit instancesDavid Pursehouse2019-06-171-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Consistently use "!isEmpty()" to detect non-empty listDavid Pursehouse2019-06-075-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace "size() > 0" with "!isEmpty()" where appropriate. In the Status implementation we can drop the check; the subsequent loop will only execute when the list is non-empty anyway. Change-Id: I355aff551a603373e702a9d44304f087b476263c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | cli: Add the --always option to describeSebastian Schuberth2019-05-311-0/+4
| | | | | | | | | | | | | | | | | | | | Change-Id: I0342d589e4deabe9d80ea3c9c6b48d7b265d8fe6 Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
* | | | cli: Add the --tags option to describeSebastian Schuberth2019-05-311-0/+4
| | | | | | | | | | | | | | | | | | | | Change-Id: I78924e61e2050eeaff991ee56715f36514100492 Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
* | | | Convert to lambda or member referenceCarsten Hammer2019-05-165-46/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert anonymous inner classes to lambda expressions or member references Bug: 545856 CQ: 19537 Change-Id: I621431c178e8b99316314602f7c66c9a36f9ae98 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Use isEmpty() instead of size()==0 where possibleCarsten Hammer2019-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I97f1367a2ea9f1f6146e264c27c3981b842f2a26 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Join catch sections using multicatchCarsten Hammer2019-04-138-51/+18
| | | | | | | | | | | | | | | | | | | | Change-Id: I1a9112e6a4f938638c599b489cb0858eca27ab91 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Use String.isEmpty() instead of comparing to ""Carsten Hammer2019-04-113-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use of String.equals("") can be replaced with with String.length() == 0 (for JDK5 and lower) or String.isEmpty() (for JDK6 and higher) Change-Id: Id1462d22c5d249485d87993263a9239809e73c55 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | Replace usage of String.indexOf with String.contains where possibleCarsten Hammer2019-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iad3fce891077d85cf2533272c54206c33c37afd8 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | Merge "diff: Add "--staged" as alias to "--cached""Christian Halstrick2019-03-251-1/+1
|\ \ \ \
| * | | | diff: Add "--staged" as alias to "--cached"Andre Bossert2019-03-251-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see: https://git-scm.com/docs/git-diff "--staged is a synonym of --cached" Change-Id: Ie73f6b3d3b7179c339151cebab98f9ddee6aaf49 Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
* / / / Replace "Checkout" by "Check out" when used as a verbThomas Wolf2019-03-151-1/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | One occurrence in core JGit, several in jgit.pgm. One unused occurrence in jgit.pgm; remove it. Change-Id: I04c3dd9d9f542f1e1ac6df4cbf03bcefb6bfdf78 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | diff: add option metaVar for --src-prefix and --dst-prefixAndre Bossert2019-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | | Fixes exception if using "jgit diff --help". Bug: 544735 Change-Id: I694ff3103da4bc199dd03c40962c5be191eddcd1 Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
* | | pgm: Fix missing braces in Version.run()Matthias Sohn2019-01-211-2/+4
| | | | | | | | | | | | Change-Id: I4c5633846320f0324714f635b2be388b17cf79fa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Handle IOException in Version commandMatthias Sohn2019-01-211-2/+7
| | | | | | | | | | | | | | | | | | | | | This avoids we show a stacktrace on the console by default when this type of exception is thrown during the run method is executed. Change-Id: I37e6e3aaba411858042afac02098ce9eaa06f258 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Fix missing braces in UploadPack.run()Matthias Sohn2019-01-211-1/+2
| | | | | | | | | | | | Change-Id: I923af9b4ce62d5098828f4322a2a508bf3927bbd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Handle IOException in UploadPack commandMatthias Sohn2019-01-211-8/+9
| | | | | | | | | | | | | | | | | | | | | This avoids we show a stacktrace on the console by default when this type of exception is thrown during the run method is executed. Change-Id: Ife1d8e88387a32de63b0ef31f45499babdbdde3c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Handle exceptions in Tag commandMatthias Sohn2019-01-211-1/+5
| | | | | | | | | | | | | | | | | | | | | This avoids we show a stacktrace on the console by default when this type of exception is thrown during the run method is executed. Change-Id: I16b528fad74d0c5346d054b3c29070331d60db7f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Fix missing braces in Status.run()Matthias Sohn2019-01-211-2/+4
| | | | | | | | | | | | Change-Id: Ie30df8ed3d9a1e676f130214a173b622eaf67c6f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Handle exceptions in Status commandMatthias Sohn2019-01-211-1/+5
| | | | | | | | | | | | | | | | | | | | | This avoids we show a stacktrace on the console by default when this type of exception is thrown during the run method is executed. Change-Id: I662a343fbb46c35090bd6f840e5a35a88036a65a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Fix missing braces in ShowRef.run()Matthias Sohn2019-01-211-1/+2
| | | | | | | | | | | | Change-Id: I92bc2008c72bd4495dc3df47a9dd7eb242aab30f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Handle IOException in ShowRef commandMatthias Sohn2019-01-211-6/+10
| | | | | | | | | | | | | | | | | | | | | This avoids we show a stacktrace on the console by default when this type of exception is thrown during the run method is executed. Change-Id: If18a5d8013f1cb393af3a5e5a1ec9613ac2151bd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Fix missing braces in Show.run()Matthias Sohn2019-01-211-3/+5
| | | | | | | | | | | | Change-Id: I50097649f1355856e342035d54c55e65270ef507 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Handle exceptions in Show commandMatthias Sohn2019-01-211-2/+5
| | | | | | | | | | | | | | | | | | | | | This avoids we show a stacktrace on the console by default when this type of exception is thrown during the run method is executed. Change-Id: I1c6cc5ecdc44b81e5f3f9b7dc64c3653de5475ba Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Fix missing braces in Rm commandMatthias Sohn2019-01-211-1/+2
| | | | | | | | | | | | Change-Id: I5ad2f02516917bbd02aa0eb4fb6b05d4b06dc670 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Handle GitAPIException in Rm commandMatthias Sohn2019-01-211-1/+4
| | | | | | | | | | | | | | | | | | | | | This avoids we show a stacktrace on the console by default when this type of exception is thrown during the run method is executed. Change-Id: I55c15a35369e790a3ca946d6db0097a57ac6fae5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>