aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
Commit message (Collapse)AuthorAgeFilesLines
* CacheRegion: fix non translatable text warningsMatthias Sohn2025-03-042-2/+7
| | | | Change-Id: I163957653b075f1f05a6219f4d23b340588ffcbd
* Ensure access to autoRefresh is thread-safeMatthias Sohn2025-03-031-6/+7
| | | | Change-Id: I7651613c33803daf00882a543dbf0c3f836110fa
* FileReftableStack: use FileSnapshot to detect modificationMatthias Sohn2025-03-033-3/+69
| | | | | | | | | | | | | | | | | | | | | | | | Reading file attributes is faster than reading file content hence use FileSnapshot to speedup detecting if FileReftableStack is up-to-date. Introduce new option "core.trustTablesListStat" allowing to configure if we can trust file attributes of the "tables.list" file to speedup detection of file modifications. This file is used to store the list of filenames of the files storing Reftables in FileReftableDatabase. If this option is set to "ALWAYS" we trust File attributes and use them to speedup detection of file modifications. If set to "NEVER" the content of the "tables.list" file is always read unconditionally. This can help to avoid caching issues on some filesystems. If set to "AFTER_OPEN" we will open a FileInputStream to refresh File attributes of the "tables.list" file before relying on the refreshed File attributes to detect modifications. This works on some NFS filesystems and is faster than using "NEVER". Change-Id: I3e288d90fb07edf4fa2a03c707a333b26f0c458d
* FileReftableDatabase: consider ref updates by another processMatthias Sohn2025-03-032-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | FileReftableDatabase didn't consider that refs might be changed by another process e.g. using git (which started supporting reftable with version 2.45). Add a test creating a light-weight tag which is updated using git running in another process and assert that FileReftableDatabase recognizes the tag modification. FileReftableStack#addReftable checks if the stack is up-to-date while it holds the FileLock for tables.list, if it is not up-to-date the RefUpdate fails with a LOCK_FAILURE to protect against lost ref updates if another instance of FileReftableDatabase or another thread or process updated the reftable stack since we last read it. If option `reftable.autoRefresh = true` or `setAutoRefresh(true)` was called check before each ref resolution if the reftable stack is up-to-date and, if necessary, reload the reftable stack automatically. Calling `setAutoRefresh(true)` takes precedence over the configured value for option `reftable.autoRefresh`. Add a testConcurrentRacyReload which tests that updates still abort ref updates if the reftable stack the update is based on was outdated. Bug: jgit-102 Change-Id: I1f9faa2afdbfff27e83ff295aef6d572babed4fe
* BlameRegionMerger: report invalid regions with checked exception.Ivan Frade2025-02-271-1/+1
| | | | | | | | | | If the cached regions are invalid the merger throws an IllegalStateException. This is too strict. The caller can just continue working as if there was no cache. Report the error as IOException, that the caller can catch and handle. Change-Id: I19a1061225533b46d3a17936912a11000430f2ce
* Merge branch 'stable-7.1'Matthias Sohn2025-02-264-37/+27
|\ | | | | | | | | | | | | | | | | * stable-7.1: Do not load bitmap indexes during directory scans Fix calculation of pack files and objects since bitmap Pack: no longer set invalid in openFail() Change-Id: I4516cd7f39418ddbb7db381f58aadc99b6d7e40d
| * Merge branch 'stable-7.0' into stable-7.1stable-7.1Matthias Sohn2025-02-264-37/+27
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: Do not load bitmap indexes during directory scans Fix calculation of pack files and objects since bitmap Pack: no longer set invalid in openFail() Change-Id: I480a52909a7f3ee771947c0fd447433e10a9b19b
| | * Merge branch 'stable-6.10' into stable-7.0stable-7.0Matthias Sohn2025-02-264-37/+27
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: Do not load bitmap indexes during directory scans Fix calculation of pack files and objects since bitmap Pack: no longer set invalid in openFail() Change-Id: I8846ad4745a360244f81518a028fed5f07086724
| | | * Do not load bitmap indexes during directory scansstable-6.10Martin Fick2025-02-253-19/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if a bitmap index had not been loaded yet, it would get loaded during a directory scan. Loading a bitmap file can be expensive and there is no immediate need to do so during a scan. Fix this by simply setting bitmap index file names on the Packs during directory scans so that bitmaps can be lazily loaded at some later point if they are needed. This change has the side affect of no longer marking a Pack valid if it is currently invalid simply because a bitmap file has been found, as there is no valid reason to do so and this can incorrectly mark a Pack without an index, or with other issues valid. Since the initial lack of a bitmap file, or an invalid one, or the deletion of one, would not result in the Pack being marked invalid, there is no need to overturn the invalid flag when a new bitmap file is found. Change-Id: I056acc09e7ae6a0982acd81b552d524190ebb4be Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * Merge "Pack: no longer set invalid in openFail()" into stable-6.10Matthias Sohn2025-02-241-14/+16
| | | |\
| | | | * Pack: no longer set invalid in openFail()Martin Fick2025-02-141-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intention of the 'invalidate' argument in openFail() is to invalidate the Pack in certain situations. However, after moving doOpen() to a lock instead of using synchronized, the invalidation approach could also incorrectly mark an already invalid Pack valid, which was never the intention since previously invalid would only ever get set to false if it already was false. Fix this by never setting invalid in openFail(), instead set invalid explicitly before calling openFail when needed. This makes the intent clearer, and aligns better with all the existing comments already trying to explain the boolean (and some of them become obvious enough now that the comment is deleted or shortened). This is also likely faster than adding a conditional in openFail() to make 'invalidate' work properly. Change-Id: Ie6182103ee2994724cb5cb0b64030fedba84b637 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * | Fix calculation of pack files and objects since bitmapAntonio Barone2025-02-241-4/+6
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a logic issue where pack files and objects created since the most recent bitmap were incorrectly counted, ignoring their modification time. Since pack files are processed in order from most recent to oldest, we can reliably stop counting as soon as we encounter the first bitmap. By definition, all subsequent pack files are older and should not be included in the count. This ensures accurate repository statistics and prevents overcounting. Bug: jgit-140 Change-Id: I99d85fb70bc7eb42a8d24c74a1fdb8e03334099e
* | | | AddCommand: Use parenthesis to make the operator precedence explicitMatthias Sohn2025-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes errorprone error [OperatorPrecedence], see https://errorprone.info/bugpattern/OperatorPrecedence Change-Id: I3086ac0238bcf4661de6a69b1c133a4f64a3a8d4
* | | | AddCommand: implement --all/--no-allThomas Wolf2025-02-261-7/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Command-line git stages deletions if file paths are given. (i.e., --all is implied.) File paths are also optional if --update or --all (or --no-all) are given. Add a setter and getter for an "all" flag on AddCommand. Check consistency with the "update" flag in call(). Make file paths optional (imply a "." path) if update is set or if setAll() had been called. If file paths are given, set the all flag. Stage deletions if update is set, or if the "all" flag is set. Add the C git command-line options for the "all" flag to jgit.pgm.Add. Bug: jgit-122 Change-Id: Iedddedcaa2d7a2e75162454ea047f34ec1cf3660
* | | | Merge changes I83adebe5,Ibbc9ba97Matthias Sohn2025-02-253-47/+86
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * changes: DirCacheCheckout.preScanOneTree: consider mode bits Merge: improve handling of case-variants
| * | | | DirCacheCheckout.preScanOneTree: consider mode bitsThomas Wolf2025-02-091-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If only the file mode is changed, it's still a change and we must check out the entry from the commit. Bug: jgit-138 Change-Id: I83adebe563fcdb4cbe330edb44884d55ed463c2c
| * | | | Merge: improve handling of case-variantsThomas Wolf2025-02-093-42/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that on a case-insensitive filesystem a merge that includes a rename of a file from one case variant to another does not delete the file. Basically make sure that we don't delete files that we had marked under a case variant as "keep" before, and ensure that when checking out a file, it is written to the file system with the exact casing recorded in the git tree. Bug: egit-76 Change-Id: Ibbc9ba97c70971ba3e83381b41364a5529f5a5dc
* | | | | StringUtils: new #trim methodIvan Frade2025-02-251-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In [1] we could use a "trim" function to remove leading/trailing '/' from paths. [1] https://gerrithub.io/q/I1f2a07327d1a1d8149ee482bc2529b7e1a5303db Change-Id: I490e6afe5c8e6c164d07442b1b388f8a131b4c50
* | | | | DescribeCommand: remove unnecessary else clauseMatthias Sohn2025-02-251-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and reduce indentation. Change-Id: I60a6f721eed051d67aa385a143e2bd3a950485f7
* | | | | DescribeCommand: Add exclusion matches using setExclude()Jonathing2025-02-251-7/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of right now, the describe command in JGit only supports adding matches for tag inclusion. It does not support adding matches for excluding tags, which is something that can be done with git on the command line using the "--excludes" flag. This change adds a sister method to setMatches(), called setExcludes(), which does exactly that. A few preliminary tests have also been included in DescribeCommandTest. Change-Id: Id1449c7b83c42f1d875eabd5796c748507d69362 Signed-off-by: Jonathing <me@jonathing.me>
* | | | | Insert the Change-Id at the end of the footer blockBen Rohlfs2025-02-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up of change 1208616. The goal is to get even closer to consistency with Gerrit's commit-msg hook. The modified test cases were all verified against what the commit-msg hook would do with the same commit message. The substantial change is that within the footer block we are putting the Change-Id also after lines matching `includeInFooterPattern`, not just after lines matching `footerPattern`. That are lines that start either with a space or with an opening bracket. Change-Id: I39305154e653f8f5adb6b75ca0f6b349b720e9d8
* | | | | Update Change-Id insertion logic to insert after footersBen Rohlfs2025-02-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change we were inserting the Change-Id at the beginning of the footer block, but after any Bug or Issue footers. After this change we are inserting the Change-Id at the end of the footer block, but before any Signed-off-by footers. The overall goal is to stay consistent with Gerrit's commit-msg hook. Change-Id: Id3a73e901ac3c289f79941d12979459c66cb7a13
* | | | | MultiPackIndexPrettyPrinter: add missing @since tagMatthias Sohn2025-02-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and suppress nls warnings. Change-Id: I33be306f4d5894e81fce7b2b34fdff30313417de
* | | | | BlameGenerator: add @since tags to new methods and inner classIvan Frade2025-02-211-5/+11
| | | | | | | | | | | | | | | | | | | | Change-Id: I849d0a3ff07bb53e93112eb716a6537cf2419290
* | | | | BlameGenerator: cache and reuse blame resultsIvan Frade2025-02-203-5/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blame goes into the history of a file until it blames all lines. If we have a blamed version of the file in cache, we can use it to resolve the lines not blamed yet and cut the calculation earlier. When processing a candidate, check if it is in the cache and if so fill the blame from the pending regions using the information of the cached (and fully blamed) copy. The generator doesn't populate the cache itself. Callers must take the final results and put them in the cache. Change-Id: Ia99b09d6d825e96940ca4200967958923bf647c7
* | | | | Merge "midx.MultiPackIndexPrettyPrinter: pretty printer to debug multi pack ↵Matthias Sohn2025-02-191-0/+154
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | index"
| * | | | | midx.MultiPackIndexPrettyPrinter: pretty printer to debug multi pack indexIvan Frade2025-02-121-0/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prints the multipack index file in a human readable format. This helps to debug/inspect multipack indexes generated by jgit or git. Change-Id: I04f477b3763b0ecfde6f4379f267de8a609a54e7
* | | | | | blame.cache: Define interface and POJO to cache blame resultsIvan Frade2025-02-182-0/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The blame generator goes into the history of a file until it blames all lines. If the caller keeps a cache of the results, the generator could use it to shorten that walk, using the blame information of an older revision of the file to build the new blame view. Define an interface and POJO for the blame cache. Change-Id: Ib6b033ef46089bbc5a5b32e8e060d4ab0f74b871
* | | | | | Replace usage of deprecated Config#getEnum methodMatthias Sohn2025-02-177-21/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Need to make DirCacheVersions public otherwise Config#allValuesOf cannot invoke its #values method via introspection. Change-Id: Id11a6fdbe7ce3d84f04bf47e98746424dcc761b4
* | | | | | URIish: fix stack overflow in regex matchingThomas Wolf2025-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regex for a relative path used greedy matches, which could cause excessive backtracking. Simplify the regex and use a possessive quantifier to avoid backtracking at all: a relative path is a sequence (AB)*A?, where A and B are disjunct: once (AB)* has been matched, there is no need for any backtracking in the relative path. Bug: egit-80 Change-Id: Ic7865f20767d85ec1db2d0b92adcd548099eb643
* | | | | | MultiPackIndexWriter: add missing @since for new API classMatthias Sohn2025-02-141-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and fix boxing warnings. Change-Id: Ia9b4deba7892256639c53bac5d7b62f1fbb01389
* | | | | | Merge "DefaultTypedConfigGetter: Box values to avoid infinite recursion"Ivan Frade2025-02-131-13/+27
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | DefaultTypedConfigGetter: Box values to avoid infinite recursionIvan Frade2025-02-121-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Errorprone says: DefaultTypedConfigGetter.java:176: error: [InfiniteRecursion] This method always recurses, and will cause a StackOverflowError return getLong(config, section, subsection, name, defaultValue); [1] introduced new getters with boxed types to return a null when the config is not set. The getters of unboxed types should call to the boxed version, but, as the values are not explicitely boxed, they are calling to themselves. [1] https://gerrithub.io/c/eclipse-jgit/jgit/+/1207895 Change-Id: Ied45a199c8ef905e3774a17a04d91a656aa0e42b
* | | | | | midx.MultiPackIndexWriter: a writer for the multipack index formatIvan Frade2025-02-123-0/+479
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fromg git documentation[1]: While the pack-indexes provide fast lookup per packfile, this performance degrades as the number of packfiles increases, because abbreviations need to inspect every packfile and we are more likely to have a miss on our most-recently-used packfile. For some large repositories, repacking into a single packfile is not feasible due to storage space or excessive repack times. (...) The multi-pack-index (MIDX for short) stores a list of objects and their offsets into multiple packfiles. (...) Thus, we can provide O(log N) lookup time for any number of packfiles. This is a writer of the multipack index format. The test only verifies the "shape" of the file, when we get a parser we can check also the values (specially the large offset handling). On the JGit repository, the multipack index generated by this writer passes the validation of `git multi-pack-index verify`. [1] https://git-scm.com/docs/pack-format#_multi_pack_index_midx_files_have_the_following_format Change-Id: I1fca599c4ebf28154f28f039c2c4cfe75b2dc79d
* | | | | Merge "Improve configuration of trusting file attributes in FileSnapshot"Matthias Sohn2025-02-086-61/+260
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Improve configuration of trusting file attributes in FileSnapshotMatthias Sohn2025-02-066-61/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FileSnapshot relies on File attributes (which can be retrieved by the stat() function on Unix) to quickly determine if a File was modified without reading file content or listing content of a directory. On NFS this doesn't work reliably due to NFS client caching behavior. Hence we introduced the option core.trustFolderStat to control if FileSnapshot can trust File attributes to ensure we don't miss modifications on NFS. Later more specific options for handling packed and loose refs were added which also support another config value AFTER_OPEN, in addition to ALWAYS and NEVER, which refreshes File attributes by opening a FileInputStream on the file instead of reading its content and then trusts the File attributes of the refreshed File. We discussed in jgit-127 how to extend these options for other scenarios where file attributes are used to detect modifications and came to the conclusion to improve the existing trustXXX config options in the following way: - replace the not well defined "trustFolderStat" option by a general option "trustStat" which allows to configure all these scenarios with a single option - introduce a new enum TrustStat and use it for all scenarios. It has the values - NEVER don't trust File attributes - ALWAYS always trust File attributes - AFTER_OPEN open a FileInputStream on the respective file or folder to ensure its File attributes are refreshed and then trust the refreshed File attributes - INHERIT only used for specific options to signal it should inherit its value from the "trustStat" option - deprecate the old, now unused enums "TrustPackedRefsStat" and "TrustLooseRefStat" - deprecate "trustFolderStat", if set, translate it to the corresponding value of the new option "trustStat" - if both "trustFolderStat" and "trustStat" are configured the value configured for "trustStat" takes precedence and "trustFolderStat" is ignored - add one specific option for each scenario which can override the global setting - add new options "trustLooseObjectStat" and "trustPackStat" which allow to override the global setting for handling of loose objects and pack files - implement option AFTER_OPEN for "trustLooseObjectStat" and "trustPackStat" Bug: jgit-127 Change-Id: I662982258bc4494f146805875e52838394673c8f
* | | | | Merge changes I0d444b39,I907dabffMatthias Sohn2025-02-064-45/+441
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Config: add getters for primitive types without default value CommitConfig: fix potential NPE
| * | | | Config: add getters for primitive types without default valueMatthias Sohn2025-02-063-44/+440
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which return null if the option is not configured. Change-Id: I0d444b396458f49712e35ef32427dc45ee3f8ec8
| * | | | CommitConfig: fix potential NPEMatthias Sohn2025-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The local variable `comment` is null if the option core.commentChar is unset. Change-Id: I907dabff395f75b3a6367446389df395b28f027a
* | | | | midx.PackIndexMerger: Helper to iterate over n-indexesIvan Frade2025-02-031-0/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The multipack index can be build merging the individual pack indexes and handling correctly the duplicates. PackIndexMerger is a utility function that gathers n-indexes and allows to iterate as one with the correct sha1 order. It also precalculates some of the needed metadata (as count of objects without duplicates, or if offsets go over 32 bits). Change-Id: I515b70fffff4489d83834488daf975f85726ea96
* | | | | PackIndex.MutableEntry: new methods to copy its contentsIvan Frade2025-02-031-4/+32
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To build the multipack index, we will iterate over N indexes merging the results in sha1 order. With the current MutableEntry API, we need to create an instance of ObjectId to either compare and/or copy the selected entry to the multi index iterator. Allow MutableEntries to compare to each other without creating any new object, and copy their object id directly to another MutableObjectId. This allows to build other iterators with mutable entries that copy the required memory (few ints) instead of creating short-lived instances of ObjectId. Change-Id: I0c0091420d7c0847c03afdc9e73b566bb4eeba40
* | | | Merge branch 'stable-7.2'Matthias Sohn2025-02-012-29/+83
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.2: RevWalk: Add an isMergedIntoAnyCommit() method Prepare 7.2.0-SNAPSHOT builds JGit v7.2.0.202501291320-m2 Pack: separate an open/close accounting lock http.server/BUILD: expose servlet resources as target Change-Id: I285979539d57f3a079ad7902ba82fe5d17de1069
| * | | | Merge branch 'stable-7.1' into stable-7.2Matthias Sohn2025-02-012-29/+83
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.1: RevWalk: Add an isMergedIntoAnyCommit() method Pack: separate an open/close accounting lock http.server/BUILD: expose servlet resources as target Change-Id: Ie53048a5154a4a40f7c0f9da3b8b829d305ab323
| | * | | Merge branch 'stable-7.0' into stable-7.1Matthias Sohn2025-02-012-29/+83
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: RevWalk: Add an isMergedIntoAnyCommit() method Pack: separate an open/close accounting lock http.server/BUILD: expose servlet resources as target Change-Id: I25d3ffe86150d4d9e8a54634145cdbee34ea15fb
| | | * | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2025-02-012-29/+83
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: RevWalk: Add an isMergedIntoAnyCommit() method Pack: separate an open/close accounting lock http.server/BUILD: expose servlet resources as target Change-Id: Icda1b3dbc79c47d5dcc45932fe452fcf66e35657
| | | | * RevWalk: Add an isMergedIntoAnyCommit() methodMartin Fick2025-02-011-8/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RevWalk had a bulk isMergedIntoAny() method, however it worked only for Refs. Add a similar method which works for RevCommits instead. Unfortunately isMergedIntoAny() cannot be overloaded since java does not include the generic types in Collections of method signatures, so the method name needs to be more complicated to differentiate it from the existing method. Change-Id: I4f8f3a83058a186fafe3b37726e21c5074a6b8e1 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | | * Pack: separate an open/close accounting lockMartin Fick2024-12-201-21/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the open/close accounting code used whole Pack object synchronization for locking. Unfortunately, there are other unrelated methods which use whole Pack object synchronization also, mostly to avoid concurrent loading of these independent indices, and they do not touch or need to coordinate with the open/close accounting data. During heavy load when a new file appears after repacking the readFully() threads could uselessly block on threads reading the reverse index. These threads could have been reading from the Pack file instead of waiting for the reverse index to be read. Use a new lock to make this locking more fine grained to prevent the readFully() calling threads from getting blocked in beginWindowCache() while the reverse index or bitmaps are being loaded. Change-Id: I7ac9067ca10cd6d6be0ab25148d99da3ace7ba36 Signed-off-by: Martin Fick <mfick@nvidia.com>
* | | | | PackDirectory: make template variables names more readableLuca Milanesio2025-01-301-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up of I57b24ffb0b3 addressing a readability issue on the variable names of the PackDirectory.handlePackError() method. Change-Id: I877a45328e9b7026e66f300c363ea5c1625af157
* | | | | Merge "Log pruned packfiles as debug and not warn logs"Matthias Sohn2025-01-291-1/+5
|\ \ \ \ \
| * | | | | Log pruned packfiles as debug and not warn logsLuca Milanesio2025-01-291-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the regular lifecycle of a Git repository, the packfiles are constantly created and removed as part of repacking and pruning. Lower the logging of disappearing packfiles to debug level to reduce the SPAMing on logfile with warnings that should be ignored as part of the normal repository life. Change-Id: I57b24ffb0b32f7a64810cab47b5009f2bf89a6b8