aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stable-6.3' into stable-6.4Matthias Sohn2023-02-201-0/+14
|\ | | | | | | | | | | | | | | | | | | * stable-6.3: Fix getPackedRefs to not throw NoSuchFileException Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: I1073098fb06eabafdb3c5e7fcf44d55b86a1b152
| * Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2023-02-201-0/+14
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: Fix getPackedRefs to not throw NoSuchFileException Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: I765c7302ce84a6a9c28fdef29da2bfaa49477c6e
| | * Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2023-02-161-0/+14
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: Fix getPackedRefs to not throw NoSuchFileException Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: Id32683d5f506e082d39af269803bccee0280cc27
| | | * Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2023-02-161-0/+14
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: I876a38c2de8b7d5eaacd00e36b85599f88173221
| | | | * Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2023-02-161-0/+14
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: I423f410578f5bbe178832b80fef8998a5372182c
| | | | | * Add pack options to preserve and prune old pack filesMatthias Sohn2023-02-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the options - pack.preserveOldPacks - pack.prunePreserved This allows to configure in git config if old packs should be preserved during gc and pruned during the next gc. The original implementation in 91132bb0 only allows to set these options using the API. Change-Id: I5b23ab4f317d12f5ccd234401419913e8263cc9a
* | | | | | Merge branch 'stable-6.3' into stable-6.4Matthias Sohn2023-02-013-3/+25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: Shortcut during git fetch for avoiding looping through all local refs FetchCommand: fix fetchSubmodules to work on a Ref to a blob Silence API warnings introduced by I466dcde6 Allow the exclusions of refs prefixes from bitmap PackWriterBitmapPreparer: do not include annotated tags in bitmap BatchingProgressMonitor: avoid int overflow when computing percentage Speedup GC listing objects referenced from reflogs FileSnapshotTest: Add more MISSING_FILE coverage Change-Id: Iefcf5d832bd0087c1027876f2200689e1150abce
| * | | | | Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2023-02-013-3/+25
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: Shortcut during git fetch for avoiding looping through all local refs FetchCommand: fix fetchSubmodules to work on a Ref to a blob Silence API warnings introduced by I466dcde6 Allow the exclusions of refs prefixes from bitmap PackWriterBitmapPreparer: do not include annotated tags in bitmap BatchingProgressMonitor: avoid int overflow when computing percentage Speedup GC listing objects referenced from reflogs FileSnapshotTest: Add more MISSING_FILE coverage Change-Id: I2ff386d9a096277360e6c7bd5535b49984620fb3
| | * | | | Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2023-02-013-3/+25
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: Shortcut during git fetch for avoiding looping through all local refs FetchCommand: fix fetchSubmodules to work on a Ref to a blob Silence API warnings introduced by I466dcde6 Allow the exclusions of refs prefixes from bitmap PackWriterBitmapPreparer: do not include annotated tags in bitmap BatchingProgressMonitor: avoid int overflow when computing percentage Speedup GC listing objects referenced from reflogs FileSnapshotTest: Add more MISSING_FILE coverage Change-Id: Iff2fba026b49463016015b2fae1a42cf76ee2dbb
| | | * | | Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2023-02-013-3/+25
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: Shortcut during git fetch for avoiding looping through all local refs FetchCommand: fix fetchSubmodules to work on a Ref to a blob Silence API warnings introduced by I466dcde6 Allow the exclusions of refs prefixes from bitmap PackWriterBitmapPreparer: do not include annotated tags in bitmap BatchingProgressMonitor: avoid int overflow when computing percentage Speedup GC listing objects referenced from reflogs FileSnapshotTest: Add more MISSING_FILE coverage Change-Id: Ib5055f2f3b8a313c178d6f6c7c5630285ad5a726
| | | | * | Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2023-02-013-3/+25
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Shortcut during git fetch for avoiding looping through all local refs FetchCommand: fix fetchSubmodules to work on a Ref to a blob Silence API warnings introduced by I466dcde6 Allow the exclusions of refs prefixes from bitmap PackWriterBitmapPreparer: do not include annotated tags in bitmap BatchingProgressMonitor: avoid int overflow when computing percentage Speedup GC listing objects referenced from reflogs FileSnapshotTest: Add more MISSING_FILE coverage Change-Id: I58ad4c210a5e7e5a1ba6b22315b04211c8909950
| | | | | * Allow the exclusions of refs prefixes from bitmapLuca Milanesio2023-01-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running a GC.repack() against a repository with over one thousands of refs/heads and tens of millions of ObjectIds, the calculation of all bitmaps associated with all the refs would result in an unreasonable big file that would take up to several hours to compute. Test scenario: repo with 2500 heads / 10M obj Intel Xeon E5-2680 2.5GHz Before this change: 20 mins After this change and 2300 heads excluded: 10 mins (90s for bitmap) Having such a large bitmap file is also slow in the runtime processing and have negligible or even negative benefits, because the time lost in reading and decompressing the bitmap in memory would not be compensated by the time saved by using it. It is key to preserve the bitmaps for those refs that are mostly used in clone/fetch and give the ability to exlude some refs prefixes that are known to be less frequently accessed, even though they may actually be actively written. Example: Gerrit sandbox branches may even be actively used and selected automatically because its commits are very recent, however, they may bloat the bitmap, making it ineffective. A mono-repo with tens of thousands of developers may have a relatively small number of active branches where the CI/CD jobs are continuously fetching/cloning the code. However, because Gerrit allows the use of sandbox branches, the total number of refs/heads may be even tens to hundred thousands. Change-Id: I466dcde69fa008e7f7785735c977f6e150e3b644 Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
| | | | | * BatchingProgressMonitor: avoid int overflow when computing percentageMatthias Sohn2023-01-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cloning huge repositories I observed percentage of object counts turning negative. This happened if lastWork * 100 exceeded Integer.MAX_VALUE. Change-Id: Ic5f5cf5a911a91338267aace4daba4b873ab3900
| | | | | * Speedup GC listing objects referenced from reflogsMatthias Sohn2023-01-231-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GC needs to get a ReflogReader for all existing refs to list all objects referenced from reflogs. The existing Repository#getReflogReader method accepts the ref name and then resolves the Ref to create a ReflogReader. GC calling that for a huge number of Refs one by one is very slow. GC first gets all Refs in bulk and then calls getReflogReader for each of them. Fix this by adding another getReflogReader method to Repository which accepts a Ref directly. This speeds up running JGit gc on a mirror clone of the Gerrit repository from 15:36 min to 1:08 min. The repository used in this test had 45k refs, 275k commits and 1.2m git objects. Change-Id: I474897fdc6652923e35d461c065a29f54d9949f4
* | | | | | Merge branch 'stable-6.3' into stable-6.4Matthias Sohn2023-01-052-0/+27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: Introduce core.trustPackedRefsStat config Fix documentation for core.trustFolderStat Change-Id: I18d9fc89c9ac1ef069dcefa7d7f992a28539ccf3
| * | | | | Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2023-01-052-0/+27
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: Introduce core.trustPackedRefsStat config Fix documentation for core.trustFolderStat Change-Id: I48b6c095ac62dc859829d6fef45325accbb0a144
| | * | | | Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2023-01-052-0/+27
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: Introduce core.trustPackedRefsStat config Fix documentation for core.trustFolderStat Change-Id: Ic78630f74c72624932a384eed52ef79ae1eff3e5
| | | * | | Introduce core.trustPackedRefsStat configKaushik Lingarkar2023-01-052-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we always read packed-refs file when 'trustFolderStat' is false. Introduce a new config 'trustPackedRefsStat' which takes precedence over 'trustFolderStat' when reading packed refs. Possible values for this new config are: * always: Trust packed-refs file attributes * after_open: Same as 'always', but refresh the file attributes of packed-refs before trusting it * never: Always read the packed-refs file * unset: Fallback to 'trustFolderStat' to determine if the file attributes of packed-refs can be trusted Folks whose repositories are on NFS and have traditionally been setting 'trustFolderStat=false' can now get some performance improvement with 'trustPackedRefsStat=after_open' as it refreshes the file attributes of packed-refs (at least on some NFS clients) before considering it. For example, consider a repository on NFS with ~500k packed-refs. Here are some stats which illustrate the improvement with this new config when reading packed refs on NFS: trustFolderStat=true trustPackedRefsStat=unset: 0.2ms trustFolderStat=false trustPackedRefsStat=unset: 155ms trustFolderStat=false trustPackedRefsStat=after_open: 1.5ms Change-Id: I00da88e4cceebbcf3475be0fc0011ff65767c111 Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
* | | | | | Merge branch 'stable-6.3'Matthias Sohn2022-11-161-0/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Fix API breakage caused by extracting WorkTreeUpdater Extract Exception -> HTTP status code mapping for reuse Don't handle internal git errors as an HTTP error Ignore IllegalStateException if JVM is already shutting down Allow to perform PackedBatchRefUpdate without locking loose refs Change-Id: Ib58879be292c54a2a7f4936ac0986997985c822b
| * | | | | Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2022-11-161-0/+7
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Ignore IllegalStateException if JVM is already shutting down Change-Id: I9c1576011c11b4ff8f453d18d9e786cee59860fa
| | * | | | Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2022-11-161-0/+7
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Ignore IllegalStateException if JVM is already shutting down Change-Id: Ie433c46a01a0f33848d54ecf99b30a44ca01e286
| | | * | | Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2022-11-161-0/+7
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Ignore IllegalStateException if JVM is already shutting down Change-Id: I176419026c3f4fdd8ebd34c61468c1ec3482ff45
| | | | * | Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2022-11-161-0/+7
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Ignore IllegalStateException if JVM is already shutting down Change-Id: I40105336f0b9e593a8a2c242a9557f854c274fdc
| | | | | * Add option to allow using JDK's SHA1 implementationMatthias Sohn2022-11-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change If6da9833 moved the computation of SHA1 from the JVM's JCE to a pure Java implementation with collision detection. The extra security for public sites comes with a cost of slower SHA1 processing compared to the native implementation in the JDK. When JGit is used internally and not exposed to any traffic from external or untrusted users, the extra cost of the pure Java SHA1 implementation can be avoided, falling back to the previous native MessageDigest implementation. Bug: 580310 Change-Id: Ic24c0ba1cb0fb6282b8ca3025ffbffa84035565e
* | | | | | ObjectReader: New #isNotLargerThan methodIvan Frade2022-10-181-0/+33
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partial clones filter the objects to send by size calling ObjectReader#getObjectSize per object. This method reads the object from storage to get the size, which can be expensive. Offer a #isNotLargerThan method. The default implementation reads the object, but subclasses can override it with more efficient lookups (e.g. adding an index). isNotLargerThan gives implementors more options to optimize than getObjectIndex (e.g. can be implemented storing only object over certain size). Change-Id: Iefd4b1370cb9144f15cc0391286aeeb365e6ea87
* | | | | Provide default shallowCommits getter and setter in ObjectDatabaseRonald Bhuleskar2022-08-081-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I649db9ae679ec2606cf7c530b040f8b6b93eb81a added a default implementation for getShallowCommits and setShallowCommits to DfsObjDatabase, for the convenience of any implementers that define subclasses. But we forgot that some implementers inherit from ObjectDatabase directly instead. Move the default getter and setter to the base class so that such callers do not need source changes to unbreak their build. This also lets us update the api_filters to reflect that this is no longer an API-breaking change. Change-Id: I5dcca462eb306e511e57907b7d9264d51b3f3014
* | | | | Fetch: add support for shallowRobin Müller2022-07-312-2/+30
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for shallow cloning. The CloneCommand and the FetchCommand now have the new methods setDepth, setShallowSince and addShallowExclude to tell the server that the client doesn't want to download the complete history. Bug: 475615 Change-Id: Ic80fb6efb5474543ae59be590ebe385bec21cc0d
* | | | Fixed since tags added for new merge constantsAndrey Loskutov2022-05-301-4/+4
| | | | | | | | | | | | | | | | | | | | Bug: 356832 Change-Id: I70197522675de0e9b53399ee3d9ed3f10312ff6b
* | | | Add command line support for "git mergetool"Andre Bossert2022-05-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see: https://git-scm.com/docs/git-mergetool see: https://git-scm.com/docs/git-config * add command line support for "git mergetool" * add option handling for "--tool-help", "--tool=<mytool>", "--[no-]prompt", "--[no-]gui" * handle prompt * add MergeTools * add pre-defined mergetools * print merge actions --> no execute, will be done later Bug: 356832 Change-Id: I6e505ffc3d03f75ecf4bba452a25d25dfcf5793f Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
* | | | Add config reader for user-defined mergetoolsAndre Bossert2022-05-251-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see: https://git-scm.com/docs/git-mergetool see: https://git-scm.com/docs/git-config * add config reader for user-defined mergetools * merge.tool * merge.guitool * mergetool.prompt * mergetool.keepBackup * mergetool.keepTemporaries * mergetool.writeToTemp * mergetool.<tool>.path * mergetool.<tool>.cmd * mergetool.<tool>.trustExitCode Bug: 356832 Change-Id: Ic4f07376630713d8e06cbad284d9c72c9ecc0405 Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
* | | | De-couple ServiceLoader calls from class loadingThomas Wolf2022-04-141-14/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the holder pattern to de-couple the loading of super classes from the ServiceLoader calls to set up global instances. This prevents potential lock inversions. Bug: 579550 Change-Id: Ie8284e4d6d680ddd4cc6a486bbefe8ed00266240 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | GpgSigner: prevent class lock inversion on the default signerThomas Wolf2022-04-141-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't store the default signer in a static field of the abstract superclass GpgSigner. This many lead to a lock inversion on the class initialization locks if there are concurrent loads of the GpgSigner class and of one of its subclasses, and that subclass happens to be the one the ServiceLoader wants to load. Use the holder pattern to de-couple the loading of class GpgSigner from the ServiceLoader call. Bug: 579550 Change-Id: Ifac0ea0c8985a09fe0518d0dabc072fafd6db907 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | CommitConfig: add support for core.commentCharThomas Wolf2022-03-262-2/+111
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Provide access to the core.commentChar git config, and provide a utility method to determine an unused comment character if the setting is "auto". Bug: 579325 Change-Id: I1ec7e4deffea6ac5929a8538a624d73bb59e4ecc Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | IndexDiff: use tree filter also for SubmoduleWalkThomas Wolf2022-03-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The only uses of IndexDiff.setFilter() in JGit and EGit set a path filter. Passing the filter on to the SubmoduleWalk gives the desired result, which is consistent with command-line git. Bug: 565251 Change-Id: I8eca1ed73eb1d237b8785f369352f72af9e0e168 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | Describe: add support for core.abbrev config optionMatthias Sohn2022-03-024-0/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If core.abbrev is unset or "auto" estimate abbreviation length like C git does: - Estimate repository's object count by only considering packed objects, round up to next power of 2 - With the order of 2^len objects, we expect a collision at 2^(len/2). But we also care about hex chars, not bits, and there are 4 bits per hex. So all together we need to divide by 2; but we also want to round odd numbers up, hence adding one before dividing. - For small repos use at least 7 hexdigits - If object database fails to determine object count use 7 hexdigits as fallback If it is set to "no" do not abbreviate object-ids. Otherwise set it to the configured value capped to the range between 4 and length of an unabbreviated object-id. Change-Id: I425f9724b69813dbb57872466bf2d2e1d6dc72c6
* | | Add a typed config getter for integers confined to a rangeMatthias Sohn2022-03-022-0/+53
| | | | | | | | | | | | | | | | | | Use Integer#MIN_VALUE to denote unset option. Change-Id: I4d65f2434013111f25520c0ed2b9a9dc8123c6cf
* | | PersonIdent: Add ctors that accept Instant in addition to DateDavid Ostrovsky2022-03-021-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | Error Prone is flagging Date-API as obsolete and recommends to migrate to Instant and LocalDate. Given that more JGit users starting to migrate to new Time API, offer ctors that accept Instant type and also add new getter that returns when attribute as Instant type. Change-Id: I64a36bf40f191495c6889c1dff314ede06848880
* | | PushCommand: determine remote from git config if not givenThomas Wolf2022-02-142-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ConfigConstants and expose branch.<name>.pushRemote in the BranchConfig. Use the branch configuration and remote.pushDefault if no remote is given explicitly. If nothing is configured, fall back to "origin". Bug: 578676 Change-Id: I6bb141ff02c8b04980ec34b26ef248b72614c3c9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | Support for git config push.defaultThomas Wolf2022-02-091-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | Enhance the (unused!?) PushConfig; include a PushDefault enumeration. Add simple tests for this PushConfig. Bug: 351314 Change-Id: Ibc5656a2a1fccf70d00c5e15de8ed3dd8add6337 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | Introduce a constant for the length of an abbreviated hash stringSebastian Schuberth2022-02-032-1/+12
| | | | | | | | | | | | | | | Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io> Change-Id: I196d58a813f7caa1965af4cf8e2f977ed4cdc350
* | | Provide git config commit.cleanupThomas Wolf2022-01-312-0/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an enumeration for the possible values, and a method to resolve the "default" value. Give CommitConfig a static method to process a text according to a given clean-up mode and comment character. (The core.commentChar is not yet handled by JGit; it's hard-coded as #.) Bug: 553065 Change-Id: If6e384522275f73b713fbc29ffcaa1753c239dea Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | Add config reader for user-defined difftoolsAndre Bossert2021-12-081-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see: http://git-scm.com/docs/git-difftool * add config reader for user-defined difftools * diff.tool * diff.guitool * difftool.prompt * difftool.trustExitCode * difftool.<tool>.path * difftool.<tool>.cmd * add pre-defined difftools * implemented "git difftool --tool-help" to verify config reader and pre-defined difftools Bug: 356832 Change-Id: Idde8fddbef61f3378ee565c6321570b3962d0e1d Signed-off-by: Andre Bossert <andre.bossert@siemens.com> Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
* | | Merge branch 'stable-6.0'Matthias Sohn2021-11-282-7/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: FS: debug logging only if system config file cannot be found FS: debug logging only if system config file cannot be found Update .factorypath used by annotation processor for benchmarks Use maven-compiler-plugin's release tag instead of source and target Don't use deprecated Repository#getAllRefs in Repository Don't use deprecated Repository#getAllRefs in FileRepository RevListTest: fix warning that method parameter hides field 'git' Implement RecordingLogger based on org.slf4j.Logger Let ObjectDatabase implement AutoClosable Change-Id: Ie6b3cfa66b319033d4448dcf20362b753c0e9d7c
| * | Don't use deprecated Repository#getAllRefs in RepositoryMatthias Sohn2021-11-251-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also expose the potentially IOException thrown by RefDatabase#getRefs. Hence the following methods now potentially throw IOException: - Repository#getAllRefsByPeeledObjectId Bug: 534731 Change-Id: Id6956ff112560e6314d4335238494708346f2338
| * | Don't use deprecated Repository#getAllRefs in FileRepositoryMatthias Sohn2021-11-251-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also expose the potentially IOException thrown by RefDatabase#getRefs. Hence the following methods now potentially throw IOException: - AdvertiseRefsHook#advertiseRefs - ReceivePack#setAdvertisedRefs - Repository#getAdditionalHaves Bug: 534731 Change-Id: I85bc6ce5815d40be5f80042c53f4663072d96be5
| * | Let ObjectDatabase implement AutoClosableMatthias Sohn2021-11-241-1/+2
| | | | | | | | | | | | | | | Bug: 549777 Change-Id: I09846a0e063aafa77de7e76dbc16c6a67d13b5e5
* | | Add command line support for "git difftool"Andre Bossert2021-11-251-0/+28
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | see: http://git-scm.com/docs/git-difftool * add command line support for "jgit difftool" * show supported commands with "jgit difftool --help" * added "git difftool --tool-help" to show the tools (empty now) * prepare for all other commands Bug: 356832 Change-Id: Ice0c13ef7953a20feaf25e7746d62b94ff4e89e5 Signed-off-by: Andre Bossert <andre.bossert@siemens.com> Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
* | Fix missing @since 6.0 tagThomas Wolf2021-11-221-0/+1
| | | | | | | | | | | | CommitConfig.getCommitTemplateContent() has changed API. Change-Id: If72ed79c43c167b99f356b69cc095d6bbf4d66e8 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | Support commit.template config propertyJulian Ruppel2021-11-221-3/+14
| | | | | | | | | | | | | | | | | | | | | | Fixes an issue that commit template file could not be found if it has a relative path instead of absolute path. Relative path is probably common if git config --local is used. Bug: 446355 Change-Id: I8ddf2be672647be825fd9c01af82809d31bb8356
* | Factor out parsing git-style size numbers to StringUtilsThomas Wolf2021-10-302-38/+7
| | | | | | | | | | | | | | | | | | | | | | Move the code to parse numbers with an optional 'k', 'm', or 'g' suffix from the config file handling to StringUtils. This enables me to re-use it in EGit, which has duplicate code in StorageSizeFieldEditor. As this is generally useful functionality, providing it in the library makes sense. Change-Id: I86e4f5f62e14f99b35726b198ba3bbf1669418d9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>