aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | SystemReader: add method to get LocalDateTimeIvan Frade2024-11-141-0/+12
|/ / / | | | | | | | | | | | | | | | | | | Using #civilNow() because in the documentation, this calendar-based representation is called "civil time". Change-Id: Iaa363e66683cb548419666068a4ffef44a776e12
* | | SystemReader#now: make it a concrete methodIvan Frade2024-11-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Abstract methods break subclasses (e.g. DelegateSystemReader in gerrit). Updating jgit and gerrit is simpler if we do not add them. I am not sure why some methods are abstract and others dont, but now() can be a concrete method. Make now() concrete. Implement it by default based on getCurrentTime(), so subclasses overriding that method get the same value. Change-Id: I697749f8cba698c5388ed13ebdc2b238d6259358
* | | [errorprone] RawText: Add parenthesis for explicit op precedenceIvan Frade2024-11-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | errorprone reports: [OperatorPrecedence] Use grouping parenthesis to make the operator precedence explicit Take the chance to fix also https://errorprone.info/bugpattern/YodaCondition in the same lines. Change-Id: I6d8f00842ef2bb24cd00fc413121b8a4e20c186b
* | | Merge "SystemReader: Give a default implementation to #getTimezoneAt()"Ivan Frade2024-11-131-6/+3
|\ \ \
| * | | SystemReader: Give a default implementation to #getTimezoneAt()Ivan Frade2024-11-131-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This abstract method forces subclasses (e.g. DelegateSystemReader in gerrit) to update their code, but there is no strong reason to make it abstract (subclasses can override it if needed). Make the method concrete using the current default implementation (which is the same in the mock). Change-Id: Id1df0d71cab1d86879adf48e782f0050d3abcfa9
* | | | RawText: improve performance of isCrLfText and isBinaryXenoAmess2024-11-131-20/+29
|/ / / | | | | | | | | | | | | | | | | | | Inline the function isBinary(byte, byte), and reduce several duplicated checks in it, for better performance. Change-Id: Ida855ed4fd7456d8fb7ed68f3af2dbfa0e25897c
* | | Merge branch 'stable-7.0'Matthias Sohn2024-11-121-3/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: Replace custom encoder Constants#encodeASCII by JDK implementation Replace custom encoder `Constants#encode` by JDK implementation Add `numberOfPackFilesAfterBitmap` to RepoStatistics Enhance CommitBuilder#parent to tolerate null parent Change-Id: I46f961144f2e3c4c57ef0f63a9c8954fee8133e9
| * | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-11-112-20/+26
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: Replace custom encoder Constants#encodeASCII by JDK implementation Replace custom encoder `Constants#encode` by JDK implementation Add `numberOfPackFilesAfterBitmap` to RepoStatistics Enhance CommitBuilder#parent to tolerate null parent Change-Id: If05b0d474c728b54cab9af2b7416be30b2754d1b
| | * Replace custom encoder Constants#encodeASCII by JDK implementationMatthias Sohn2024-11-091-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | Ensure that the method still throws an IllegalArgumentException for malformed input or if the String contains unmappable characters. Change-Id: I6a340aa1af60c315272ff13b6bf2041ba30c94ca (cherry picked from commit 0fd76114e3436ac635641d06371fd8833179312d)
| | * Replace custom encoder `Constants#encode` by JDK implementationMatthias Sohn2024-11-091-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the implementation provided in the JDK since Java 1.6 by `String#getBytes(Charset)` reduces JGit maintenance effort and improves performance. The method Constants#encode was implemented when JGit still used Java 1.5. See [1]. Kudos to Marcin for proposing to use this improvement in RefWriter [2]. I think it should be used generally. [1] https://repo.or.cz/jgit.git?a=commit;h=bfa3da225f198b19061158499b1135aff07d85b3 [2] https://eclipse.gerrithub.io/c/eclipse-jgit/jgit/+/1195180 Also-By: Marcin Czech <maczech@gmail.com> Change-Id: I361ed6286b98351a315b8a8ffc3cb845831d35b2 (cherry picked from commit e5d2898997462e0f2409c09497ab62c6cda2dbaf)
| | * Add `numberOfPackFilesAfterBitmap` to RepoStatisticsJacek Centkowski2024-11-071-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a `numberOfPackFilesAfterBitmap` that contains the number of packfiles created since the latest bitmap generation. Notes: * the `repo.getObjectDatabase().getPacks()` that obtains the list of packs (in the existing `getStatistics` function) uses `PackDirectory.scanPacks` that boils down to call `PackDirectory.scanPacksImpl` which is sorting packs prior returning them therefore the `numberOfPackFilesAfterBitmap` is just all packs before the one that has bitmap attached * the improved version of `packAndPrune` function (one that skips non-existent packfiles) was introduced for testing Change-Id: I608011462f104fc002ac527aa405f492a8a4b0c2
* | | Merge "DfsBlockCacheConfig: propagate hotmap configs to pack ext cache configs"Ivan Frade2024-11-111-0/+22
|\ \ \
| * | | DfsBlockCacheConfig: propagate hotmap configs to pack ext cache configsLaura Hamelin2024-11-081-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CacheHotMap is currently only set on the base DfsBlockCacheConfig and is not propagated down to PackExt specific caches. Because CacheHotMap is set from a method call rather than from Configs, this change sets per-PackExt CacheHotMap configs on PackExt cache configs both when DfsBlockCacheConfig#setCacheHotMap(...) is called, and when DfsBlockCacheConfig#configure(...) is called after setCacheHotMap. The outer DfsBlockCacheConfig keeps the full CacheHotMap for the same reason that the CacheHotMap config is propagated in both setCacheHotMap and configure: the order of operations setting the configuration from Configs and calling setCacheHotMap is not guaranteed. Change-Id: Id9dc32fedca99ecc83c9dc90c24d9616873a202e
* | | | Merge "Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap"Matthias Sohn2024-11-111-4/+4
|\ \ \ \
| * | | | Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmapJacek Centkowski2024-11-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As sugested in I608011462f1. Change-Id: If66226dd7b08ae768413fa614df5dcb6b44dc118
* | | | | DfsGarbageCollector: #setReflogExpire with Instant instead of DateIvan Frade2024-11-081-5/+6
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Date API is full of major design flaws and pitfalls and should be avoided at all costs. Prefer the java.time APIs, specifically, java.time.Instant (for physical time) and java.time.LocalDate[Time] (for civil time). [1] Replace the Date with Instant in the DfsGarbageCollector#setReflogExpire method. [1] https://errorprone.info/bugpattern/JavaUtilDate Change-Id: Ie98e426e63621e8bef96c31bca56aec0c8eef5a6
* / / / SystemReader: Offer methods with java.time APIIvan Frade2024-11-082-0/+75
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error prone explains: The Date API is full of major design flaws and pitfalls and should be avoided at all costs. Prefer the java.time APIs, specifically, java.time.Instant (for physical time) and java.time.LocalDate[Time] (for civil time). Add to SystemReader methods to get the time and timezone in the new java.time classes (Instant/ZoneId) and mark as deprecated their old counterparts. The mapping of methods is: * #getCurrentTime -> #now (returns Instant instead of int) * #getTimezone -> #getTimeZoneAt (returns ZoneOffset intead of int) * #getTimeZone -> #getTimeZoneId (return ZoneId instead of TimeZone) Change-Id: Ic55b2f442a40046ff0ed24f61f566fc7416471be
* | | Merge branch 'stable-7.1'Matthias Sohn2024-11-056-5/+106
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.1: Add missing @since 7.1 to UploadPack#implies ResolveMerger: Allow setting the TreeWalk AttributesNodeProvider Add Union merge strategy support Change-Id: Ib1c1725578e522c88f80f050d221a517bf012017
| * | | Add missing @since 7.1 to UploadPack#impliesMatthias Sohn2024-11-051-1/+3
| | | | | | | | | | | | | | | | Change-Id: Iabbe1f18a5022b4669a3352493c6fd35920ef25f
| * | | Merge branch 'stable-7.0' into stable-7.1Matthias Sohn2024-11-055-4/+103
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: ResolveMerger: Allow setting the TreeWalk AttributesNodeProvider Add Union merge strategy support Change-Id: I15674134f4c73ac2de514d4fac4a36fca7ed7b07
| | * | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-11-054-4/+64
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: ResolveMerger: Allow setting the TreeWalk AttributesNodeProvider Add Union merge strategy support Change-Id: I0d768d793effd1deabb4807446a4f8c10a82ad74
| | | * ResolveMerger: Allow setting the TreeWalk AttributesNodeProviderNasser Grainawi2024-11-052-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a merger is created without a Repository, no AttributesNodeProvider is created in the TreeWalk. Since mergers are often created with a custom ObjectInserter and no repo, they skip any lookups of attributes from any of the gitattributes files (within a tree, in the repo info/ dir, or user/global). Since there are potentially merge-affecting attributes in those files, callers might want to use both a custom ObjectInserter and an AttributesNodeProvider. Change-Id: I7997309003bbb598e1002261b3be7f2cc52066c8
| | | * Add Union merge strategy supportNasser Grainawi2024-11-045-4/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow users to specify the `union` strategy in their .gitattributes file in order to keep lines from both versions of a conflict [1]. [1] https://git-scm.com/docs/gitattributes.html#Documentation/gitattributes.txt-union Change-Id: I74cecceb2db819a8551b95fb10dfe7c2b160b709
| | * | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-10-231-1/+1
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: Update Apache sshd to 2.14.0 LfsConnectionFactoryTest: remove unnecessary cast JSchSshProtocol2Test: remove unnecessary cast ApacheSshProtocol2Test: remove unnecessary cast NoteMapMerger: remove unnecessary cast Change-Id: I8fca74d88efadc827955b0a5032e6fbd72ce3e0d
| | | * NoteMapMerger: remove unnecessary castMatthias Sohn2024-10-101-1/+1
| | | | | | | | | | | | | | | | Change-Id: I3be4963f506529bbadc5b6dfc0b625ee85effc1f
| * | | Prepare 7.1.0-SNAPSHOT buildsMatthias Sohn2024-10-243-4/+4
| | | | | | | | | | | | | | | | Change-Id: Ibaddbad3677636452cad4e8b7ce0a58b1a78f833
| * | | JGit v7.1.0.202410232130-m2v7.1.0.202410232130-m2Matthias Sohn2024-10-233-4/+4
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Ibae7987afb2459fa77c6b151606fbf69fc8a8f49
* | | | Merge "DfsPackCompactor: write object size index"Ivan Frade2024-11-041-0/+17
|\ \ \ \
| * | | | DfsPackCompactor: write object size indexIvan Frade2024-11-011-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the compactor is not writing the object size index for packs. As it is using PackWriter to generate the packs, it needs to explicitely call the writes of each extension. Invoke writeObjectSizeIndex in the compactor. The pack writer will write one if the configuration says so. Change-Id: I8d6bbbb5bd67bfc7dd511aa76463512b1e86a45d
* | | | | [errorprone] BaseRepositoryBuilder: Use #split(sep, limit)Ivan Frade2024-11-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | String.split(String) and Pattern.split(CharSequence) have surprising behaviour [1]. We use one of the recommended replacements: #split(sep, limit). [1] https://errorprone.info/bugpattern/StringSplitter Change-Id: Ie1cf7590bd8660d21c79c5c3c1bc2765e5d9462b
* | | | | [errorprone] Remove deprecated security managerIvan Frade2024-11-017-63/+7
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Errorprone warns about this deprecated classes. The recommendation is stop using SecurityManager all together. The Security Manager is deprecated and subject to removal in a future release. There is no replacement for the Security Manager. See JEP 411 [1] for discussion and alternatives. [1] https://openjdk.org/jeps/411 Change-Id: I3c67136e97d13cf24b85e41d94408631c26e8be8
* | | | [errorprone] RefDatabase: #getConflictingNames immutable returnIvan Frade2024-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Errorprone reports that: This method returns both mutable and immutable collections or maps from different paths. This may be confusing for users of the method. Return always an immutable collection. Change-Id: Id48f3645fd06c8bc72212af180d7d02c7e0b7632
* | | | Merge "DfsGarbageCollector: Add setter for reflog expiration time."Ivan Frade2024-10-311-0/+21
|\ \ \ \
| * | | | DfsGarbageCollector: Add setter for reflog expiration time.Saril Sudhakaran2024-10-311-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit reftable writer/compator knows how to prune the history, but the DfsGarbageCollector doesn't expose the time limit. Add a method to DfsGarbageCollector to set the reflog time limit. This value is then passed to the reftable compactor. Callers usually pass here the value from gc.reflogExpire. The reflog block length is stored in 24 bits [1], limiting the size to 16MB. I have observed that in repositories with frequent commits, reflogs hit that size in 6-12 months. [1] https://git-scm.com/docs/reftable Bug: jgit-96 Change-Id: I8b32d6d2b2e1d8af8fb7d9f86225d75f1877eb2f
* | | | | [errorprone] HttpConnection: Add missing summary in javaIvan Frade2024-10-301-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constants don't have summary and errorprone complains about it. Change-Id: Id1470ed9fd54cf7fd684045c5631acc1a8d450c2
* | | | | [errorprone] PackWriter: Fix javadoc tag in new #writeIndex methodIvan Frade2024-10-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We introduced this method recently and the javadoc is not correct: error: [InvalidInlineTag] This tag is invalid. @code{PackIndexWriter} instance to write the index Change-Id: I34ed3d8b5a121fea9b8163627b46ae4a289c9462
* | | | | [errorprone] ByteArraySet: Add summary fragment to javadocIvan Frade2024-10-301-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by error prone. Change-Id: Icaa69c37d0cde19fc605cb3f3c5f9ed9abfb37d3
* | | | | [errorprone] util.Stats: Add summary fragment to javadocIvan Frade2024-10-301-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Errorprone complains about missing summary in these javadocs. [MissingSummary] A summary fragment is required; consider using the value of the @return b lock as a summary fragment instead. * @return variance of the added values ^ (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment) Did you mean '*Returns variance of the added values.'? Change-Id: I29d633ec95c18b17cc92b069dd1a94fbb2a75c94
* | | | | Merge "PackWriter: make PackWriter.writeIndex() take a PackIndexWriter"Ivan Frade2024-10-294-24/+57
|\ \ \ \ \
| * | | | | PackWriter: make PackWriter.writeIndex() take a PackIndexWriterSam Delmerico2024-10-284-24/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the PackWriter implementation required that indexes and their extensions be writable to an OutputStream with a fixed binary format. To support more general index storage formats, allow PackWriter to accept an PackIndexWriter interface which accepts only the objects to store. This allows implementors to choose their storage format. The implementation will be provided by the DfsObjectDatabase. The DfsObjectDatabase is already responsible for providing the OutputStream that was previously used to write indexes. Having it provide a writing interface would be a natural generalization. This idea was previously implemented for PackBitmapIndex writing in https://gerrithub.io/c/eclipse-jgit/jgit/+/1177722. Change-Id: I582d2f3d25d6adb2da243d6d0d7bc405a97d6183
* | | | | | DfsInserter: Read minBytesForObjectSizeIndex only from repo configIvan Frade2024-10-291-21/+7
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In general, JGit reads the configuration it needs from the repository configuration. minBytesForObjectSizeIndex is a special case with a setter for subclasses but that is unnecessary. Remove the setter and read the conf from the repo. Make the property final and read it directly from the conf (it is clearer than parsing a whole PackConfig to read a single value). Change-Id: I8d77247452ff65e6c431fdcfebb90ed2ce40aed1
* | | | | Merge "dfs: update getBlockCacheStats to return a List of BlockCacheStats"Ivan Frade2024-10-285-26/+46
|\ \ \ \ \
| * | | | | dfs: update getBlockCacheStats to return a List of BlockCacheStatsLaura Hamelin2024-10-285-26/+46
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make available all underlying cache table stats for the used cache table implementation. The existing cache table stats implementation only allows a "global" view of the cache table statistics; it does not differentiate between all possible underlying cache tables used. This change allows callers to get the block cache stats broken down per underlying table. These cache stats are intended to be used for monitoring all cache tables independently. Existing usages of getBlockCacheStats now make use of AggregatedBlockCacheStats.fromStatsList to aggregate the list of BlockCacheStats into a single BlockCacheStats instance. Change-Id: I261b3f2849857172397657e5c674b11e09807f27
* | | | | Merge "Replace custom encoder Constants#encodeASCII by JDK implementation"Matthias Sohn2024-10-261-7/+13
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Replace custom encoder Constants#encodeASCII by JDK implementationMatthias Sohn2024-09-061-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that the method still throws an IllegalArgumentException for malformed input or if the String contains unmappable characters. Change-Id: I6a340aa1af60c315272ff13b6bf2041ba30c94ca
* | | | | Merge changes from topic "ssh-signatures"Matthias Sohn2024-10-233-13/+109
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: SSH signing: implement a SignatureVerifier SSH signing: implement a Signer SSH signing: don't require a session in PasswordProviderWrapper SSH signing: make OpenSSH pattern matching public SSH signing: prepare config ssh: add a factory for KeyPasswordProvider
| * | | | | SSH signing: make OpenSSH pattern matching publicThomas Wolf2024-10-221-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSH signing needs the same pattern matching algorithm as is used for host matching in host entries in ~/.ssh/config. So make that pattern matching available via a static method. Change-Id: Ia26f23666f323f44ce66f769fbcd6c85965eb219 Signed-off-by: Thomas Wolf <twolf@apache.org>
| * | | | | SSH signing: prepare configThomas Wolf2024-10-222-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Include the SSH specifics in the GpgConfig so that we will have access to these configs later on. Change-Id: Iad3d6f2bdb5ba879e1672368c82d367b8ccd246c Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | | Merge "PackIndexWriter: create interface to write indexes"Ivan Frade2024-10-2210-20/+65
|\ \ \ \ \ \ | | |_|/ / / | |/| | | |
| * | | | | PackIndexWriter: create interface to write indexesSam Delmerico2024-10-2210-20/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PackWriter assumes that the primary index goes to a file in a well-known format. This cannot accomodate implementations in other storages or formats (e.g. in a database). Create an interface to write the index (PackIndexWriter). This interface will be implemented by the existing pack index writer classes (PackIndexWriterV1 etc.). As the "PackIndexWriter" name was used by the previous superclass of the file writers, we rename that class to "BasePackIndexWriter". Change-Id: Ia7348395315e458fc7adc75a8db5dcb903e2a4a1