aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stable-5.6'Matthias Sohn2019-12-112-11/+2
|\ | | | | | | | | | | | | | | * stable-5.6: Prepare 5.6.1-SNAPSHOT builds JGit v5.6.0.201912101111-r Change-Id: I7824278560d828e1c6e2d540e3372e19507a39c0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 5.6.1-SNAPSHOT buildsMatthias Sohn2019-12-1174-455/+455
| | | | | | | | | | Change-Id: Iaa72d2ea6764ccd4fb6a124b51d89fe6492c602d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v5.6.0.201912101111-rv5.6.0.201912101111-rMatthias Sohn2019-12-1074-105/+105
| | | | | | | | | | Change-Id: Icbb3b46f9d04e45da53936860e07e69fde12971c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Change the wildcard import to explicit ones.Yunjie Li2019-12-091-1/+4
| | | | | | | | | | Change-Id: Ia7bc1c4b6b82c127e1e4e0e657f69d249684e8e6 Signed-off-by: Yunjie Li <yunjieli@google.com>
* | Merge branch 'stable-5.6'Matthias Sohn2019-12-0912-19/+326
|\| | | | | | | | | | | | | | | | | * stable-5.6: Add ability to redirect stderr from git hooks Add possibility to get pure stderr output from AbortedByHookException Change-Id: Ifc02675542dad6ced25fdd8b9fae80b5736db688 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Add ability to redirect stderr from git hooksTim Neumann2019-12-0911-10/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | This will change the behavior in the CLI to resemble that of C-Git more closely by printing the stderr of the hooks to the CLI stderr independently of the exit code of the hook. This is also useful for the corresponding EGIT-Change, which will add the ability to show the hook output in eclipse. With this also the stderr can be shown even if the exit code is 0. Bug: 553471 Change-Id: Ie7bc503fe39e270e9b93dd1108b5879f02a12b4c Signed-off-by: Tim Neumann <Tim.Neumann@advantest.com>
| * Add possibility to get pure stderr output from AbortedByHookExceptionTim Neumann2019-12-091-9/+19
| | | | | | | | | | | | | | | | | | This is a preparation for the corresponding EGit change to remove redundant output in the aborted by commit hook popup. Bug: 553469 Change-Id: Id5f39a4df659fafc9d951668e6f53fed4380de9d Signed-off-by: Tim Neumann <Tim.Neumann@advantest.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge branch 'stable-5.6'David Pursehouse2019-12-063-115/+309
|\| | | | | | | | | | | | | | | | | * stable-5.6: Cleanup CommitAndLogCommandTest CLI: Add support for excluding paths from Git log command Change-Id: I2f48e16640ab1b13f0c32779422add3162260c50 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Cleanup CommitAndLogCommandTestMatthias Sohn2019-12-051-55/+51
| | | | | | | | | | | | | | - if a test can throw different exceptions declare it throws Exception - fix code formatting Change-Id: I55d63918f3163b31f2297d6217d5855108dd43b5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * CLI: Add support for excluding paths from Git log commandJohn Tipper2019-12-053-60/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | Git log supports the exclude pathspec, which allows for excluding paths from the log command. JGit only supports adding paths to the log command. See the following StackOverflow question for details: https://stackoverflow.com/questions/59143934/java-jgit-how-to-get-git- commits-not-affecting-certain-directories This commit adds an excludePath() method to the log command. It does not yet support regex or glob wildcards. Change-Id: I8cd59950b87850b55a15c7e2ea5470145c9aae28 Signed-off-by: John Tipper <john_tipper@hotmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Fix API check errors introduced in ReceivePack in 945d43d5Matthias Sohn2019-12-052-1/+12
| | | | | | | | | | | | | | | | - add missing @since tag on new field connectivityChecker - suppress warning for this added field which may affect subclasses which is ok Change-Id: Id6c22258efd10fa3847290f3dcfa42893b6ae882 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | ReceivePack: Moves connectivity check to separate classDemetr Starshov2019-12-053-85/+362
| | | | | | | | | | | | | | | | | | | | Move all connectivity check to separate classes. Set default to be FullConnectivityChecker i.e. checker which will check connectivity from all advertised refs. Add ability to set other connectivity checker which can use different approach. Signed-off-by: Demetr Starshov <dstarshov@google.com> Change-Id: Ibb107dbfbdde8ad109be25b5ecf42be7660ef736
* | Upgrade error_prone_core to 2.3.4David Pursehouse2019-12-052-2/+2
| | | | | | | | | | Change-Id: I7e91acc4d094d92cac41d5044268dfc2208bb663 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Merge branch 'stable-5.6'David Pursehouse2019-12-052-17/+27
|\| | | | | | | | | | | | | | | | | * stable-5.6: ReftableTest: Clean up boxing warnings on usage of String.format MergedReftable: Remove unnecessary semicolon Change-Id: Id35406acfdd91c3ddf17ce4e1023395f774774f2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * ReftableTest: Clean up boxing warnings on usage of String.formatDavid Pursehouse2019-12-051-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing int as an argument to String.format causes a warning: The expression of type int is boxed into Integer Most of these are already suppressed, but there are a couple that are not. Add suppressions for those. For the existing ones, move the suppression scope from the method to the actual usage. Where necessary extract the usage out to a local variable. Change-Id: I7a7ff6dec49467e4b5c58d27a231c74e6e1c5437 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * MergedReftable: Remove unnecessary semicolonDavid Pursehouse2019-12-051-1/+1
| | | | | | | | | | Change-Id: I67d2b8ba3cd8f94363cea864918c8ed6026f2d18 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Suppress API error for RefDatabase.hasFastTipsWithSha1()Matthias Sohn2019-12-051-0/+12
| | | | | | | | | | | | | | | | | | This method was added in stable-5.6 after 5.6 RC1 was tagged. It's shown as an API error when using 5.6.0 RC1 as the API baseline for master. This suppression can be removed when 5.6 is released which will serve as the API baseline for 5.7. Change-Id: Ic6359fe59ed2d2a9431583b0854ec86bbac76880 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Remove API filters which became obsolete after bumping version to 5.7.0Matthias Sohn2019-12-051-134/+0
| | | | | | | | Change-Id: I00b8d3e2e1023794f24d9447e3b0214c50353838 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add missing @since tag for ReceivePack#receiveWithExceptionPropagationMatthias Sohn2019-12-051-0/+1
| | | | | | | | Change-Id: Ie64abc3e5bcf6dbaecfa8f2cb50796703ebd1f39 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Prepare 5.7.0-SNAPSHOT buildsMatthias Sohn2019-12-0574-455/+455
| | | | | | | | | | Change-Id: I7efa0cd08dee711d6fefc3e6bb478a3cb11fe85c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge branch 'stable-5.6'Matthias Sohn2019-12-0529-30/+165
|\| | | | | | | | | | | | | | | | | | | | | | | * stable-5.6: Introduce RefDatabase#hasFastTipsWithSha1 Update Orbit to R20191126223242 for 2019-12 Prepare 5.6.0-SNAPSHOT builds JGit v5.6.0.201912041214-rc1 Prepare 5.6.0-SNAPSHOT builds JGit v5.6.0.201911271000-m3 Change-Id: Id33b054131bbcd27a0ae7200f564775049698d2c
| * Introduce RefDatabase#hasFastTipsWithSha1Han-Wen Nienhuys2019-12-049-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | The reftable format supports fast inverse (SHA1 => ref) queries. If the ref database does not support fast inverse queries, it may be advantageous to build a complete SHA1 to ref map in advance for multiple uses. To let applications decide, this function indicates whether the inverse map is available. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Idaf7e01075906972ec21332cade285289619c2b3
| * Update Orbit to R20191126223242 for 2019-12Matthias Sohn2019-12-0419-29/+29
| | | | | | | | Change-Id: I205d4f4a529f34c15a1afb4c791088a8e22986f0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 5.6.0-SNAPSHOT buildsMatthias Sohn2019-12-0474-105/+105
| | | | | | | | | | Change-Id: I5e737ff7f262fdd43fc975a0b3594c8b33919663 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v5.6.0.201912041214-rc1v5.6.0.201912041214-rc1Matthias Sohn2019-12-0474-105/+105
| | | | | | | | | | Change-Id: I5ed21fbc5f83096bf0b79f2aa751db415cbcc7e8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 5.6.0-SNAPSHOT buildsMatthias Sohn2019-11-2774-105/+105
| | | | | | | | | | Change-Id: I1e52d2dfb202b87ecb9d0273deaa2c8d8ce1864e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v5.6.0.201911271000-m3v5.6.0.201911271000-m3Matthias Sohn2019-11-2774-106/+106
| | | | | | | | | | Change-Id: I3810892c2bed947e4dfaa615a7b4d93eeb46abb9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge changes I1f968649,Ied678797Terry Parker2019-12-023-41/+13
|\ \ | | | | | | | | | | | | | | | * changes: UploadPackServlet: Use uploadWithExceptionPropagation GitSmartHttpTools: Do not use sideband when sending an error
| * | UploadPackServlet: Use uploadWithExceptionPropagationMasaya Suzuki2019-12-022-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | As UploadPackErrorHandler's Javadoc says, UploadPackServlet should have called uploadWithExceptionPropagation and let UploadPackErrorHandler to handle the exception. Fix UploadPackServlet. Change-Id: I1f9686495fcf3ef28598ccdff3e6f76a16c8bca3 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
| * | GitSmartHttpTools: Do not use sideband when sending an errorMasaya Suzuki2019-12-021-38/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | Unlike ReceivePack, the V0/V1 UploadPack response does not support sideband except for the packfile parts. By sending an error in a sideband packet, the JGit client says "Expected ACK/NACK, got: ...". Use an error packet always. The recent Git clients will understand it better than out-of-context sideband packets. Change-Id: Ied6787973d3b6860c0b95c7910d4e4312bb7a184 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | server: Add a custom error handlerMasaya Suzuki2019-12-023-28/+117
| | | | | | | | | | | | | | Same as UploadPack, add a custom error handler. Change-Id: I9c708aa5a22e01214c1d997fa6f72f4b8bf814f0 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | transport: Add methods that do not handle exceptionsMasaya Suzuki2019-12-021-10/+44
| | | | | | | | | | | | | | | | | | Same as UploadPack. These methods do not handle exceptions and the caller can handle them. This makes it possible to customize the error handling. Change-Id: Ia5203f80133cb5b3e5d754859b4167ac920eaf14 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | transport: Let users specify an error handler for unpacking a pack fileMasaya Suzuki2019-12-022-1/+48
| | | | | | | | | | | | | | | | | | Currently, there's no way for a user to customize the error handler for the exception happened during unpacking an incoming pack file. Create an error handler class and let them specify one. Change-Id: Id07638ee58c88e1365181c3ddd17ee0266f3934d Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | ReceivePack: Use try-with-resources for PostReceiveHookMasaya Suzuki2019-12-021-25/+22
| | | | | | | | | | | | | | | | | | | | | | Instead of dropping a second exception, use try-with-resources so that exception thrown by a hook is attached as a suppressed exception. This removes a need of holding an exception that is thrown while unpacking an incoming packfile. Change-Id: I74d8b944931abbf53d9d1ae5db2e889639fba027 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | transport: Consolidate status reporting codeMasaya Suzuki2019-12-021-96/+96
| | | | | | | | | | | | | | | | | | BaseReceivePack#sendStatusReport anyway needs to know CAPABILITY_REPORT_STATUS. By moving this flag to BaseReceivePack, simplify the status reporting code. Change-Id: Iaa0878b1fc13057b687a7f01d25c85fd78c0423e Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | transport: Add ReceiveCommandErrorHandlerMasaya Suzuki2019-12-022-17/+111
| | | | | | | | | | | | | | | | | | | | | | | | This gives a chance to handle an exception for a user. For example, when an IOException is thrown while executing `walk.parseAny(cmd.getNewId())`, it's always handled as REJECTED_MISSING_OBJECT. However, IOException can mean a Git storage IO error. By introducing an error handler class, a user can add a custom error handler for these cases. Change-Id: I3e03a536e1d8e137cb0f6e596d71642e72adde9e Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | transport: Move exception handler to the callerMasaya Suzuki2019-12-021-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | Move exception handling code to the caller side. This is a preparation for adding a custom error handler that is similar to UploadPack. Note that `catch (Throwable t)` will not affect the exception spec since Java will do an analysis of rethrown exceptions. See https://docs.oracle.com/javase/8/docs/technotes/guides/language/catch-multiple.html. Change-Id: I973a63d4b079c2cd1402afb3f2956e18b7d5a00c Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | transport: Move handling code to the caller sideMasaya Suzuki2019-12-022-11/+13
|/ | | | | | | | This removes a raw IOException at one level. Later we'll add a custom exception handling mechanism like UploadPack. Change-Id: I52a7423798c97b032d848351be8b6f144776b017 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* Merge "ReceivePack: Open visibility for some methods"Jonathan Nieder2019-11-261-2/+10
|\
| * ReceivePack: Open visibility for some methodsIvan Frade2019-11-261-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This partially reverts Ic6bb5e66. It made private some methods in ReceivePack that were protected before. At least two of those methods (#init and #receivePackAndCheckConnectivity) are used by out-of-tree subclasses for tracing and testing. Make ReceivePack#init() and ReceivePack#receivePackAndCheckConnectivity protected again to allow tracing and testing. Change-Id: I7ff22c091fbfc2d94009c449d58e7c5ac9f4f759 Signed-off-by: Ivan Frade <ifrade@google.com>
* | JGit pgm: Format blame output to match canonical gitThomas Wolf2019-11-272-31/+52
| | | | | | | | | | | | | | | | | | | | 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-278-98/+256
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge branch 'stable-5.5'David Pursehouse2019-11-263-5/+7
|\ | | | | | | | | | | | | | | | | * stable-5.5: Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl Bazel: Add missing newlines at end of BUILD files Change-Id: Ie32c3bae056fb0745892e6c20ad37d4994542d96 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Merge branch 'stable-5.4' into stable-5.5David Pursehouse2019-11-263-5/+7
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.4: Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl Bazel: Add missing newlines at end of BUILD files Change-Id: I3dd2554cbad5bb224c2799b6b133fe91ab10abc3 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * Merge branch 'stable-5.3' into stable-5.4David Pursehouse2019-11-263-5/+7
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.3: Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl Bazel: Add missing newlines at end of BUILD files Change-Id: I21878c42fd9abf7d858b534300df0fffe4bad431 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | * Merge branch 'stable-5.2' into stable-5.3David Pursehouse2019-11-263-5/+7
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.2: Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl Bazel: Add missing newlines at end of BUILD files Change-Id: Ie5e66f2e26c057c81101b0d110f91ea479eb362d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | * Merge branch 'stable-5.1' into stable-5.2David Pursehouse2019-11-263-5/+7
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl Bazel: Add missing newlines at end of BUILD files Change-Id: Ic1dc84a6c4a1cf430d329627642583fd6e0d0eaa Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | * Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzlDavid Pursehouse2019-11-261-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I80456f74bc17a1ebb0248fce8050a4cb07bf18f1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | * Bazel: Add missing newlines at end of BUILD filesDavid Pursehouse2019-11-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I11afc45141da988e28382898246995f6b45eb09c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | Upgrade maven-enforcer-plugin to 3.0.0-M3David Pursehouse2019-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie6b090ada9bcb36e018b0f991c09307f79655ba4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>