| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
In following changes we introduce a cache for the Blame CLI and it
should follow the XDG standard for the location.
Add support for XDG_CACHE_HOME following the XDG_CONFIG_HOME pattern.
Change-Id: I622f7eb7ff942fafdb5c5da877d1fb1507d5e482
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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
|
|\
| |
| |
| |
| |
| | |
* changes:
DirCacheCheckout.preScanOneTree: consider mode bits
Merge: improve handling of case-variants
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| | |
Need to make DirCacheVersions public otherwise Config#allValuesOf cannot
invoke its #values method via introspection.
Change-Id: Id11a6fdbe7ce3d84f04bf47e98746424dcc761b4
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
which return null if the option is not configured.
Change-Id: I0d444b396458f49712e35ef32427dc45ee3f8ec8
|
|
|
|
|
|
|
| |
The local variable `comment` is null if the option core.commentChar is
unset.
Change-Id: I907dabff395f75b3a6367446389df395b28f027a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current implementation throws an exception when a submodule is
updated for which the 'gitdir' still exists but the 'worktree' is
missing. The current implementation tries to clone the submodule but
fails as the 'gitdir' is not empty.
The commit adds:
- a check if the 'gitdir' is empty
- if the 'gitdir' is not empty:
- create a new '.git' file linking to the existing 'gitdir'
- fetch the submodule
- checkout the submodule unconditionally (ignore any configured
update mode)
- if the submodule is cloned checkout the submodule unconditionally
(ignore any configured update mode)
This change mimics the behavior of cgit.
Bug: jgit-79
Change-Id: Iffc8659d2a04d866a43815c78c7760c0f3d82640
|
|
|
|
|
|
| |
Don't accept short ref names anymore which is more predictable.
Change-Id: I5e7323c610c68b25facd6f2286456716d8e6cf1a
|
|
|
|
|
|
| |
instead use Repository.getRefDatabase().getReflogReader().
Change-Id: I5e66a512c12e11d0ec3275fffde4adb8483430f2
|
|
|
|
|
|
|
|
|
|
|
|
| |
to fix broken abstraction in FileRepository#getReflogReader(String).
How to get a ReflogReader depends on the chosen RefDatabase
implementation, hence the #getReflogReader methods should be there.
This also fixes a bug in FileRepository#getReflogReader(Ref) which
didn't work if FileReftableDatabase was used as RefDatabase since it
always returned the implementation only suitable for RefDirectory.
Change-Id: I0859990f9390ab96596b6c344966c687dfbbf167
|
|
|
|
|
|
|
| |
since it's using java.util.Timezone. Instead promote usage of #getZoneId
which uses ZoneId from the preferred java.time API.
Change-Id: I15dee551a81acf0b8aafdbfcfcf200c0d38069f4
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
The PersonIdent(PersonIdent,Date) constructor must create a copy with
the same author/email/timezone but different time. When we changed
the implementation to the new Instant/ZoneId version, we forgot to
pass the timezone. This made fail some tests downstream.
Pass the timezone when constructing the copy.
Change-Id: Iaa979e6dbaa3c55d4c4d2040068ab8b03163cd4e
|
|
|
|
|
|
|
|
|
|
|
|
| |
In [1], the @since tag of #getZoneId was updated to 7.1 by
mistake. The implementation of the method is different but the API
hasn't changed.
Revert the tag to 6.1, when the method was introduced.
[1] https://gerrithub.io/c/eclipse-jgit/jgit/+/1204142/9/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
Change-Id: If71d763ac28d4ec02bfebb1e65f56227f44e027d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From errorprone: Date has a bad API that leads to bugs; prefer
java.time.Instant or LocalDate.
Replace the long with milliseconds and int with minutes offset with an
Instant and a ZoneOffset. Create new constructors and deprecate
variants with Date, milliseconds and minute offsets.
When comparing instances of PersonIdent truncate the timestamp precision
to 1 second since git commit timestamps are persisted with 1 second
precision [1].
[1] https://git-scm.com/docs/git-commit#Documentation/git-commit.txt-Gitinternalformat
Change-Id: Id4ba1f108e1ba0bfcdd87ba37c67e2d3cc7d254f
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* stable-7.0:
ResolveMerger: Allow setting the TreeWalk AttributesNodeProvider
Add Union merge strategy support
Change-Id: I15674134f4c73ac2de514d4fac4a36fca7ed7b07
|
| | |\
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* stable-6.10:
ResolveMerger: Allow setting the TreeWalk AttributesNodeProvider
Add Union merge strategy support
Change-Id: I0d768d793effd1deabb4807446a4f8c10a82ad74
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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 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
|
|\ \ \ \
| |/ / /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Ensure that the method still throws an IllegalArgumentException for
malformed input or if the String contains unmappable characters.
Change-Id: I6a340aa1af60c315272ff13b6bf2041ba30c94ca
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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>
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The options have the field but it isn't loaded from the config. This
forces a workaround downstream.
Read the option from the config, as the others.
Change-Id: I7720812e0577d8f45f6b7f5b8495a8b64729125e
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
Change-Id: I14e78bcd4bbdb491bcc44a53ff19609b79c0831b
|
| |
| |
| |
| | |
Change-Id: I473dff6bdc23cfb126d22e18c168390a0e21301d
|
| |
| |
| |
| | |
Change-Id: I1c16196bba00a5d0f54c10261cc08185305ba4a3
|
| |
| |
| |
| | |
Change-Id: I89f42db2b9dabee18d4220457436b9f9b6340f50
|
| |
| |
| |
| | |
Change-Id: I4e5f96696b57512488f48e66a82760b2e8671878
|
| |
| |
| |
| | |
Change-Id: If2d3c1a96560e0bc5e352bdbcab4c191cbed1a42
|
| |
| |
| |
| | |
Change-Id: I3521ba8f8456160bd18ccb22c7d4a131aaac4ff2
|
| |
| |
| |
| | |
Change-Id: I5bd8d0c292151bfa58325d51ef51928715871cf1
|
| |
| |
| |
| | |
Change-Id: I72544d2b3c85b8f96c2b8f94b86fb9b362f09475
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some storages return data in a convenient ByteBuffer wrapper, but
there is no straigh-forward method to read ObjectIds from it.
Add ObjectId#fromRaw(ByteBuffer) to read object ids from byte buffers.
Change-Id: Ia3b244005e4d9a613294f5ad9dab3b8e7bc3d7df
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a big API-breaking change cleaning up the signing interfaces.
Initially, these interfaces were GPG/OpenPGP-specific. When EGit added
new signers and signature verifiers that called an external GPG
executable, they were found inadequate and were extended to be able to
pass in the GpgConfig to get access to the "gpg.program" setting.
With the introduction of X.509 S/MIME signing, it was discovered that
the interfaces were still not quite adequate, and the "Gpg" prefix on
the class names were confusing.
Since 7.0 is a major version bump, I'm taking this chance to overhaul
these interfaces from ground up.
For signing, there is a new Signer interface. With it goes a
SignerFactory SPI interface, and a final Signers class managing the
currently set signers. By default, signers for the different signature
types are created from the signer factories, which are discovered via
the ServiceLoader. External code can install its own signers, overriding
the default factories.
For signature verification, exactly the same mechanism is used.
This simplifies the setup of signers and signature verifiers, and makes
it all more regular. Signer instances just get a byte[] to sign and
don't have to worry about ObjectBuilders at all. SignatureVerifier
instances also just get the data and signature as byte[] and don't have
to worry about extracting the signature from a commit or tag, or about
what kind of signature it is.
Both Signers and SignatureVerifiers always get passed the Repository
and the GpgConfig. The repository will be needed in an implementation
for SSH signatures because gpg.ssh.* configs may need to be loaded
explicitly, and some of those values need the current workspace
location.
For signature verification, there is exactly one place in core JGit in
SignatureVerifiers that extracts signatures, determines the signature
type, and then calls the right signature verifier.
Change RevTag to recognize all signature types known in git (GPG, X509,
and SSH).
Change-Id: I26d2731e7baebb38976c87b7f328b63a239760d5
Signed-off-by: Thomas Wolf <twolf@apache.org>
|
| |
| |
| |
| | |
Change-Id: Ie56e7d8f2defe10a87565056a1763288d5b1e1a6
Signed-off-by: Thomas Wolf <twolf@apache.org>
|
| |
| |
| |
| | |
Change-Id: I1ea31c1f0735b7c8fd09fbedc413d613e4baa803
Signed-off-by: Thomas Wolf <twolf@apache.org>
|
| |
| |
| |
| |
| |
| | |
Git version 2.34 and later supports signing commits and tags with SSH keys. This means gpg.format now supports "ssh" as a value.
Change-Id: Iee1e5a68a816bec149a17a73a6916d2884a54163
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Based on deritative work done in Andre's work in [1].
This change focuses on adding support for reading the repository
state when branches are checked out using git's worktrees.
I've refactored original work by removing all unrelevant
changes which were mostly around refactoring to extract
i.e. constants which mostly created noise for a review.
I've tried to address original review comments:
- Not adding non-behavioral changes
- "HEAD" should get resolved from gitDir
- Reftable recently landed in cgit 2.45,
see https://github.com/git/git/blob/master/Documentation/RelNotes/2.45.0.txt#L8
We can add worktree support for reftable in a later change.
- Some new tests to read from a linked worktree which
is created manually as there's no write support.
[1] https://git.eclipse.org/r/c/jgit/jgit/+/163940/18
Change-Id: Id077d58fb6c09ecb090eb09d5dbc7edc351a581d
|
|\ \
| | |
| | |
| | | |
extensions"
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Parse configurations for tables containing a set of extensions,
defined in [core "dfs.*"] sections.
Parse configurations for cache tables according to configurations
defined in [core "dfs.*"] git config sections for sets of
extensions. The current [core "dfs"] is the default to any
extension not listed in any other table.
Configuration falls back to the defaults defined in the
DfsBlockCacheConfig.java file when not set on each cache
table configuration.
Sample format for individual cache tables:
In this example:
1. PACK types would go to the "default" table
2. INDEX and BITMAP_INDEX types would go to the
"multipleExtensionCache" table
3. REFTABLE types would go to the "reftableCache" table
[core "dfs"] // Configuration for the "default" cache table.
blockSize = 512
blockLimit = 100
concurrencyLevel = 5
(...)
[core "dfs.multipleExtensionCache"]
packExtensions = "INDEX BITMAP_INDEX"
blockSize = 512
blockLimit = 100
concurrencyLevel = 5
(...)
[core "dfs.reftableCache"]
packExtensions = "REFTABLE"
blockSize = 512
blockLimit = 100
concurrencyLevel = 5
(...)
Change-Id: I0e534e6d78b684832e3d3d269cee2590aa0f1911
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
DfsPackFile always uses the object size index if available. That is
the desired final state, but for a safe rollout, we should be able to
disable using the object size index.
Add an option (dfs.useObjectSizeIndex) to enable/disable the usage of
the object size index. False by default.
This changes the default from true to false. It only makes a different
for the DFS stack when writing of the index was explicitely
enabled. This is an optimization, so it shouldn't cause any
regression. Operators can restore previous behaviour setting
"dfs.useObjectSizeIndex" to true.
Change-Id: I44bf5a57e3942a4ecfe66d58bfa9175e99f96fcc
|
|/
|
|
| |
Change-Id: If6cabae76d7b38ce26fca534da6fe13973ebbf4f
|