aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
Commit message (Collapse)AuthorAgeFilesLines
* SignatureUtils.toString(): allow null signature creation dateHEADmasterThomas Wolf3 days1-6/+9
| | | | | | | | | | | Some signatures may not have a "created at" timestamp, or the tool used to verify the signature does not report it. If we get none, do not report anything about the signature creation time. This can happen for instance if 'smimesign' is used for verifying x509 signatures. Change-Id: I1a63aa62ffe173e00f27e8aea539b26cd40387c0
* Merge "Merge branch 'stable-7.1'"Matthias Sohn4 days1-5/+126
|\
| * Merge branch 'stable-7.1'Matthias Sohn4 days1-5/+126
| |\ | | | | | | | | | | | | | | | | | | | | | * stable-7.1: WindowCache: share removal work among multiple threads Update target platform version in maven build to 4.32 (2024-06) Change-Id: Ic88bb210c5ea080b7553fadec2a1b8d71924365c
| | * Merge branch 'stable-7.0' into stable-7.1stable-7.1Matthias Sohn4 days1-5/+126
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: WindowCache: share removal work among multiple threads Update target platform version in maven build to 4.32 (2024-06) Change-Id: Idd6a8a2c3b5c6f53645dbe7144afb2e1e24e8ca3
| | | * Merge branch 'stable-6.10' into stable-7.0Matthias Sohn4 days1-5/+126
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: WindowCache: share removal work among multiple threads Update target platform version in maven build to 4.32 (2024-06) Change-Id: I6ca4988e9ea1e9fc6b3382b40f18f3d9db7b7acb
| | | | * WindowCache: share removal work among multiple threadsMartin Fick4 days1-5/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split the removal process into blocks so that it can be shared by multiple threads. This potential work sharing can provide 2 optimizations for removals: 1) It provides an opportunity for separate removal requests to be consolidated into one removal pass. 2) It can reduce removing thread latencies by sharing the removal work with other removing threads which otherwise might not have any work to do due to their removal request being consolidated. This makes the system more efficient and can actually reduce latencies as system load increases due to pack removals! The optimizations above are all achieved without blockng threads to wait for other threads to complete (although naturally there are some synchronization points), and while ensuring that no threads do more work than if they were the only thread available to perform a removal. Change-Id: Ic6809a8abf056299abde0f0c58c77aaf245a8df5 Signed-off-by: Martin Fick <mfick@nvidia.com>
* | | | | CommitTimeRevFilter: add missing @sinceThomas Wolf4 days1-4/+10
|/ / / / | | | | | | | | | | | | | | | | | | | | Annotate the new methods using Instant. Change-Id: I1dc4eec59b44e784bcc151bd6a28347f6fd0de03
* | | | transport: Remove usage of CommitTimeRevFilter with long and DatesIvan Frade6 days2-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [errorprone] 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). Move callers to the CommitTimeRevFilter java.time.Instant API introduced in the parent commit. Change-Id: Ib92c56ae09f1ad3df7628a8c61212eb84250700d
* | | | CommitTimeRevFilter: Move to java.time APIIvan Frade6 days1-17/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate the methods using Date and offer the equivalent as Instant. Keep an int with seconds as internal representation, as it seems more efficient to compare than Instant.before/after. Change-Id: Ie751ab5661c7dafaab58a16c219143b78092f84a
* | | | Merge branch 'stable-7.1'Matthias Sohn8 days5-55/+65
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.1: FileSnapshot: fix warnings Optionally.Hard: avoid Optional creation on every use, Pack: fix threading bug getting idx Fix potential NPE in TreeWalk#getFilterCommandDefinition Advertise "agent" capability when using protocol v2 FileSnapshot: silence "Stale file handle" exceptions Change-Id: I772dd3b3ce7f27e33c1879ce21ec024cc2f9c52a
| * | | Merge branch 'stable-7.0' into stable-7.1Matthias Sohn8 days5-53/+60
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: FileSnapshot: fix warnings Optionally.Hard: avoid Optional creation on every use, Pack: fix threading bug getting idx Fix potential NPE in TreeWalk#getFilterCommandDefinition Advertise "agent" capability when using protocol v2 FileSnapshot: silence "Stale file handle" exceptions Change-Id: I4fdea7450f27eebfa7ae08002fd51e67b58bf6bb
| | * | Merge branch 'stable-6.10' into stable-7.0stable-7.0Matthias Sohn8 days5-53/+60
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: FileSnapshot: fix warnings Optionally.Hard: avoid Optional creation on every use, Pack: fix threading bug getting idx Fix potential NPE in TreeWalk#getFilterCommandDefinition Advertise "agent" capability when using protocol v2 FileSnapshot: silence "Stale file handle" exceptions Change-Id: Ibe8bf9ad43cb1e56a5a5e4f4d9d5818334b2550a
| | | * FileSnapshot: fix warningsMatthias Sohn8 days1-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - comment empty code block - suppress non-translatable text warning Change-Id: Id49b4a56bbe5454edfe1ea8b79ceeaf51ceac370
| | | * Optionally.Hard: avoid Optional creation on every use,Martin Fick11 days1-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the getOptional() call created an new Optional for its element, and this appears to be somewhat expensive. During a time when a server is heavily loaded because of a poorly maintained repository with potentially 2K+ pack files, calls to Optionally.ofNullable() from within the getOptional() method appeared extensively in the Stacktrace. Reduce the getOptional() call overhead by storing an already created Optional of the element instead of the element itself. This trades the extra space of one extra reference for a potential speed gain in a hotspot. Since the current users of Optionally.Hard reference objects significantly larger than a single reference (and most users are likely to be, else why would they be using an Optionally?), this is likely a good tradeoff. Change-Id: I7adccc915480cbb97a43dcbe074cfb620888c936 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * Pack: fix threading bug getting idxMartin Fick11 days1-46/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When converting to Optionally, a threading bug was introduced, fix it. The Optionally class itself is not thread safe, and previously it was being called from idx() without any thread synchronization mechanism. This was because previously the variable which held the cached index was volatile. The Optionally<PackIndex> kept the volatile attribute, but that only synchronizes the reference to the Optionally, and not the element inside the Optionally. A clear() from another thread could thus be missed by the idx() call, potentially allowing the idx() call to interact poorly with the Optionally, potentially even causing a memory leak. To fix this, extend the synchronized inside the idx() method to the entire method. Then, additionally remove the now redundant Optional fetch in idx() and the no longer needed volatile. Change-Id: I6077e1aaed96c53200805b4c87a67afb49c2b373 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * Fix potential NPE in TreeWalk#getFilterCommandDefinitionNasser Grainawi13 days1-0/+3
| | | | | | | | | | | | | | | | Change-Id: Ic6f0fd26153b47b4aeeec105bac431225d9bf8bf
| | | * Advertise "agent" capability when using protocol v2Antonio Barone13 days1-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "agent" capability was not advertised by the server when executing git-upload-pack over protocol v2. This, in turn, prevented the clients from advertising its client agent too, as documented [1]: "The client may optionally send its own agent string by including the agent capability with a value Y (in the form agent=Y) in its request to the server (but it MUST NOT do so if the server did not advertise the agent capability)." When using jgit with Gerrit this had the effect of preventing the logging of the git client agent in the sshd_log. [1] https://git-scm.com/docs/protocol-v2#_agent Bug: jgit-118 Change-Id: Ifb6ea65fde020425920338f7dd9cc683fed6a4a4
| | | * FileSnapshot: silence "Stale file handle" exceptionsMartin Fick2024-12-051-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes a FileSystemException with "Stale file handle" can be thrown while creating a FileSnapshot, likely because the file or directory was deleted. Since NoSuchFileExceptions are already silenced, and the FileSnapshot already handles all IOExceptions, there is likely no value in seeing this info in the logs, treat these situation the same and silence them also. Change-Id: I922f4edf2d332cd704e60276f41a76df242f281c Signed-off-by: Martin Fick <mfick@nvidia.com>
* | | | RevertCommand: use only first line in revert commit messageThomas Wolf12 days2-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C git uses only the first line of the title paragraph of the reverted commit to build the title of the revert commit. Align the JGit behavior with that. Since git 2.43.0, a revert of a revert uses a title "Reapply "xxx"" instead of "Revert "Revert "xxx""".[1] This is _not_ implemented in this change. [1] https://github.com/git/git/commit/883cb1b8f86d Bug: jgit-117 Change-Id: I030092c6b9447bb738e6d761af5ce50df58cc6d3
* | | | Submodules: use relative paths for worktree and gitdirSimon Eder12 days5-10/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently absolute paths are used for a submodules 'worktree' and 'gitdir'. This has drawbacks if a git repository containing submodules is copied to a different location. Enable using relative paths when creating a file-based repository. Add optional relative path support to the clone and init commands, and use it in the submodule commands to generate relative paths. The new implementation mimics the cgit behavior which also uses relative paths instead of absolute ones. Bug: jgit-78 Change-Id: I31c5a938d5cbc030d273fc649c94ee0c90b4ce01
* | | | FileSnapshot: Delete malformed "catch" line (merge artifact?)Ivan Frade13 days1-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The merge of this file left an empty catch block: error: [EmptyCatch] Caught exceptions should not be ignored Delete the catch, as the exception is a subclass of the FileSystemException catched just under it. Change-Id: I78d6b1ca8152b6eee50a69d24ca987868866ba06
* | | | PersonIdent: Default to UTC in timezone parsingIvan Frade14 days1-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old method "getTimeZone(int tzOffset)" defaults to UTC if the offset is out of range, but the new "getZoneId(int tzOffset)" throws an exception. Return UTC if the offset is invalid, to keep the behavior consistent with older code. Change-Id: Iffe1980b3bd9c05ef2293635a1cbb493144afb79
* | | | RawParseUtils: Default to UTC in invalid timezonesIvan Frade14 days1-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PersonIdent used to translate invalid timezones to UTC [1], but the new java.time code just throws an exception. Also the parsing used happen on demand, but now is done in the constructor, so the exception is thrown even if the timezone is not used at all. Check the parsed timezone and default to UTC if it is out of range. [1] https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html#getTimeZone-java.lang.String- Change-Id: I90dd7d842ac8f44caef3b76d57375dead76bebde
* | | | Merge "RawParseUtils: Use java.time API to build PersonIdents"Ivan Frade2024-12-061-14/+39
|\ \ \ \
| * | | | RawParseUtils: Use java.time API to build PersonIdentsIvan Frade2024-12-051-14/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PersonIdent has deprecated the long/int constructors for the time, in favor of Instant/ZoneId. Update RawParseUtils to create PersonIdents with the new constructors. Change-Id: Ic62ff0c4219b4bd228c694e73e00a7c794e3553a
* | | | | Merge branch 'stable-7.1'Matthias Sohn2024-12-068-48/+85
|\ \ \ \ \ | |/ / / / |/| / / / | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.1: FileSnapshot: silence "Not a Directory" exceptions FileSnapshot: refactor to share error handling Mark Attribute#getValue as @Nullable Fix potential NPE in ResolveMerger#getAttributesContentMergeStrategy Fix NPE in DiffFormatter#getDiffDriver Pack: ensure packfile is still valid while still recoverable WindowCache: add bulk purge(), call from bulk sites UploadPack#implies: add missing @since tag Disable MergeToolTest#testEmptyToolName Change-Id: Ifa8df2b9e6e4ee371113b7114fe20b42333e3718
| * | | Merge branch 'stable-7.0' into stable-7.1Matthias Sohn2024-12-068-48/+85
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: FileSnapshot: silence "Not a Directory" exceptions FileSnapshot: refactor to share error handling Mark Attribute#getValue as @Nullable Fix potential NPE in ResolveMerger#getAttributesContentMergeStrategy Fix NPE in DiffFormatter#getDiffDriver Pack: ensure packfile is still valid while still recoverable WindowCache: add bulk purge(), call from bulk sites UploadPack#implies: add missing @since tag Disable MergeToolTest#testEmptyToolName Change-Id: Icb25fed5b703c6a39a64231fd8ca93c1f1a581be
| | * | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-12-068-48/+87
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: FileSnapshot: silence "Not a Directory" exceptions FileSnapshot: refactor to share error handling Mark Attribute#getValue as @Nullable Fix potential NPE in ResolveMerger#getAttributesContentMergeStrategy Fix NPE in DiffFormatter#getDiffDriver Pack: ensure packfile is still valid while still recoverable WindowCache: add bulk purge(), call from bulk sites UploadPack#implies: add missing @since tag Disable MergeToolTest#testEmptyToolName Change-Id: I854f44e76b73ae434a0d6b6ab782fd0aed72f219
| | | * Merge changes I022639c4,I1fcce5ef into stable-6.10Matthias Sohn2024-12-051-15/+20
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | * changes: FileSnapshot: silence "Not a Directory" exceptions FileSnapshot: refactor to share error handling
| | | | * FileSnapshot: silence "Not a Directory" exceptionsMartin Fick2024-12-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes a FileSystemException with "Not a Directory" can be thrown while creating a FileSnapshot, likely because the file or directory was deleted. Since NoSuchFileExceptions are already silenced, and the FileSnapshot already handles all IOExceptions, there is likely no value in seeing this info in the logs, treat these situation the same and silence them also. Change-Id: I022639c42154a0a4c71065741f023f5eb95f9b55 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | | * FileSnapshot: refactor to share error handlingMartin Fick2024-12-051-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is important to keep the exception handling for getting file attributes the same in all places in this class; put that code into a common method. Change-Id: I1fcce5efd10aa562a4e0e34d3ce94bcc83850237 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * | Merge changes I172c43ff,I2a4c5743,Icc4b8d2f into stable-6.10Matthias Sohn2024-12-053-10/+20
| | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Mark Attribute#getValue as @Nullable Fix potential NPE in ResolveMerger#getAttributesContentMergeStrategy Fix NPE in DiffFormatter#getDiffDriver
| | | | * | Mark Attribute#getValue as @NullableMatthias Sohn2024-12-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I172c43ff2e3e682f38a91ce288190245fa5d5ebe
| | | | * | Fix potential NPE in ResolveMerger#getAttributesContentMergeStrategyMatthias Sohn2024-12-051-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2a4c57438c16a0c5bc1af4c7772eaf65049911e2
| | | | * | Fix NPE in DiffFormatter#getDiffDriverMatthias Sohn2024-12-051-7/+11
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | Guard against diff attribute with a null value. Change-Id: Icc4b8d2f360ef105c6d64716cb42f2979967075b
| | | * / Pack: ensure packfile is still valid while still recoverableMartin Fick2024-12-041-1/+7
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When copyAsIs2() needs to send a large object requiring multiple read iterations — any of which could fail if the object isn't already in the WindowCache — verify first that the packfile is still valid at the latest possible moment, just before sending the header that would make recovery impossible. Change-Id: I234fd4b315b579a0506c8fbdea0c6787bdc09fcd Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * WindowCache: add bulk purge(), call from bulk sitesMartin Fick2024-12-023-21/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Purging a Pack from the WindowCache requires a linear search over all the entries in the cache, and thus is rather expensive. Since git gc often deletes more than one packfile at a time, avoid multiplying this expensive operation when possible by purging a Set of Packs when closing deleted pack files during a directory scan. Purge the Set of Packs with a single linear search of the cache. Closing the PackDirectory also cccbngljkihltghcnbiftcubdvgugdcvujkejehbjr Change-Id: Ic9b45cab57e1ef610c2e20ad392d8b45f8091f41 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * UploadPack#implies: add missing @since tagMatthias Sohn2024-12-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The method was originally introduced in 7.1 and then back ported to the stable-6.10 branch. Change-Id: I7250013227a666de44e439802d51110bba5af2b9
* | | | TreeWalk: Make a null check before dereferencing the config variable.jackdt@google.com2024-12-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gerrit finds a null pointer exception accessing the conf in some merge operations. It is not clear why, but could be related to [1] and [2] where the attributes node provider is set (instead of being null). Check if the config is there before reading the value and return null if not (as if the config didn't have the value set). The config is @Nullable so this check makes sense in any case. [1] https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1203278 [2] https://gerrit-review.git.corp.google.com/c/gerrit/+/441721 Change-Id: I2b786c0a23fa2e09fb9fe041c025d42823defb04
* | | | DiffFormatter: silence non-externalized string warningsMatthias Sohn2024-11-271-1/+1
|/ / / | | | | | | | | | Change-Id: I08488598d1cc58f17e6994cf00e74b20307ada06
* | | Merge branch 'stable-7.0'Matthias Sohn2024-11-263-143/+162
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: PackDirectory: Filter out tmp GC pack files Test advertised capabilities with protocol V0 and allow*Sha1InWant Align request policies with CGit Pack.java: Recover more often in Pack.copyAsIs2() Change-Id: Iddb994a747bc860dd9286e74190ecdd285ce6832
| * | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-11-264-156/+187
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: PackDirectory: Filter out tmp GC pack files Test advertised capabilities with protocol V0 and allow*Sha1InWant Align request policies with CGit Pack.java: Recover more often in Pack.copyAsIs2() Change-Id: Ib301efa54aaf2196d764a0fc1f91f652b4d68396
| | * Merge "Pack.java: Recover more often in Pack.copyAsIs2()" into stable-6.10Matthias Sohn2024-11-261-142/+153
| | |\
| | | * Pack.java: Recover more often in Pack.copyAsIs2()Martin Fick2024-11-111-142/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PACK class is designed to throw StoredObjectRepresentationNotAvailableException at times when it cannot find an object which previously was believed to be in its packfile and it is still possible for the caller, PackWriter.writeObjectImpl(), to retry copying the object from another file and potentially avoid causing a user facing error for this fairly common expected situation. This retry helps handle when repacking causes a packfile to be replaced by new files with the same objects. Improve copyAsIs2() to drastically make recovery possible in more situations. Once any data for a specific object, has been sent it is very difficult to recover from that object being relocated to another pack. But if a read error is detected in copyAsIs2() before sending the object header (and thus any data), then it should still be recoverable. Fix three places where we could have recovered because we hadn't sent the header yet, and adjust another place to send the header a bit later, after having read some data from the object successfully. Basically, if the header has not been written yet, throw StoredObjectRepresentationNotAvailableException to signal that this is still recoverable. These fixes should drastically improve the chances of recovery since due to unix file semantics, if the partial read succeeds, then the full read will very likely succeed. This is because while the file may no longer be open when the first read is done (the WindowCache may have evicted it), once the first read completes it will likely still be open and even if the file is deleted the WindowCache will continue to be able to read from it until it closes it. Change-Id: Ib87e294e0dbacf71b10db55be511e91963b4a84a Signed-off-by: Martin Fick <mfick@nvidia.com>
| | * | PackDirectory: Filter out tmp GC pack filesMartin Fick2024-11-222-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git repack passes a ".tmp-XXXX-" prefix to git pack-objects when repacking. git pack-objects then adds a "pack-XXXXX.pack" to this to create the name of new packfiles it writes to. PackDirectory was previously very lenient and would allow these files to be added to its list of known packfiles. Fix PackDirectory to filter these out since they are not meant to be consumed yet, and doing so can cause user facing errors. Change-Id: I072e57d9522e02049db17d3f4977df7eda14bba7 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | * | Align request policies with CGitpszlazak2024-11-211-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CGit defines the SHA request policies using a bitmask that represents which policy is implied by another policy. For example, in CGit the ALLOW_TIP_SHA1 is 0x01 and ALLOW_REACHABLE_SHA1 is 0x02, which are associated to two different bit in a 3-bit value. The ALLOW_ANY_SHA1 value is 0x07 which denotes a different policy that implies the previous two ones, because is represented with a 3-bit bitmask having all ones. Associate the JGit RequestPolicy enum to the same CGit bitmask values and use the same logic for the purpose of advertising the server capabilities. The JGit code becomes easier to read and associate with its counterpart in CGit, especially during the capabilities advertising phase. Also add a new utility method RequestPolicy.implies() which is more readable than a direct bitmask and operator. Bug: jgit-68 Change-Id: I932150dca1211ba9c8c34a523f13e84d7390063b (cherry picked from commit 1519c147948eb1108bdf45f2aeed84746dacff9c)
* | | | Add pack-refs command to the CLIYash Chaturvedi2024-11-228-42/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command can be used to optimize storage of references. For a RefDirectory database, it packs non-symbolic, loose refs into packed-refs. By default, only the references under '$GIT_DIR/refs/tags' are packed. The '--all' option can be used to pack all the references under '$GIT_DIR/refs'. For Reftable, all refs are compacted into a single table. Change-Id: I92e786403f8638d35ae3037844a7ad89e8959e02
* | | | Merge "GitTimeParser: Fix multiple errorprone and style comments"Matthias Sohn2024-11-211-15/+26
|\ \ \ \
| * | | | GitTimeParser: Fix multiple errorprone and style commentsIvan Frade2024-11-201-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code came from GitDateParser and inherited these issues. It is a good time to fix them: * Use always {} in if and fors (eclipse guide) * Use the more efficient EnumMap for the formatters * variable.equals(CONSTANT) instead of CONSTANT.equals(var) https://errorprone.info/bugpattern/YodaCondition * private constructor to prevent instantiations of a utility classes https://errorprone.info/bugpattern/PrivateConstructorForUtilityClass * methods named in camelCase * Use string.split(..., int) https://errorprone.info/bugpattern/StringSplitter * Initialize variable in first use Change-Id: I0ae70ad9befc66fa9c057af135f2b0b2dab3869a
* | | | | Merge branch 'stable-7.0'Matthias Sohn2024-11-214-14/+264
|\ \ \ \ \ | |/ / / / |/| / / / | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: DiffDriver: fix doc for rust built-in DiffDriver: fix formatting of javadoc Add numberOfObjectsSinceBitmap to RepoStatistics Support built-in diff drivers for hunk header function names Don't fail when trying to prune pack which is already gone Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap Change-Id: I98beec1186132e749a749706f399237de7d7e45e