| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
The reader offers the resolve functionality to find object ids with
certain prefix. The basic implementation iterates through packs and
calls resolve in their indexes. With multipack index, we can answer
the resolve directly for all the packs included.
Offer a resolve() method and implement it in the multipack index.
Change-Id: If5679652f149a41afe568c719ba40b291ae1b917
|
|
|
|
|
|
|
|
|
|
|
| |
If a pack doesn't have data, its offsets are null, not empty. A pack
without objects is probably a pathological case, but I bumped into
this while writing other tests.
Check if the offsets are null (instead of empty) before trying to
write the ridx.
Change-Id: I8cadea086b302b2ead02a5a8d4e9e8adf85bc07b
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reader and java API to load and query a multipack index.
Note: the `multi-pack-index.v1` file used in the tests
has been created on a local repository with the
"git multi-pack-index" command [1].
[1]: https://git-scm.com/docs/git-multi-pack-index
Change-Id: I09def882e1e77e9f22c6236b0a035a1e80bc1ace
|
|
|
|
|
|
|
|
|
| |
[UnnecessaryMethodReference] This method reference is unnecessary,
and can be replaced with the variable itself.
Callable<PullResult> setup = target.pull()::call;
Change-Id: I18fa05c4367fabef8960c235f0dd27333a29df76
|
|
|
|
|
|
|
|
|
|
|
|
| |
[SelfAssertion] You are passing identical arguments to the
assertEquals method, so this assertion always passes. THIS IS LIKELY A
BUG!
See https://errorprone.info/bugpattern/SelfAssertion
Replacing assertEquals(x, x) with assertTrue(x.equals(x)).
Change-Id: I4fd631adbee35e68ab59d92a2c67d5e3c821c537
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The paths relevant for a treewalk can be defined with hierarchy of tree
filters. TreeRevFilter retrieves these paths from #getPathsBestEffort to
apply them to the ChangePathFilter (bloom filters), however the plain
list of paths cannot represent the And/Or/Not of the tree filter API
(e.g. NOT(/a/b) or AND("/a", "/b")).
Introduce a new TreeFilter method #shouldTreeWalk() to let the filters
decide whether a set of tree entries need to be tree walked or can be
discarded right away.
Create a new ChangePathTreeFilter that can use changed path filters to
determine shouldTreeWalk.
Update TreeRevFilter to use a ChangePathTreeFilter, instead of getting
paths and check the changed tree filters itself.
Signed-off-by: Xing Huang <xingkhuang@google.com>
Change-Id: I8edd0b8423f2bfb85b38d7f997f3cd8dad558bc8
|
|/
|
|
|
|
|
|
|
|
|
| |
The reflog expire time is compared with the time in the
PersonIdent. PersonIdent has moved to the java.time API and prefers
the getWhenAsInstant() method.
Use the Instant method in PersonIdent and propagate the use of Instant
to the parameter and setter.
Change-Id: I14cfdc93437971737dc7e472ca5c9885e2d37a13
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BlameGenerator is querying the cache on each candidate from the
queue. i.e. on every commit in the history that contains the path. The
cache call is expensive and, in long histories with poor cache
coverage, the blame becomes slower than without cache.
Query the cache afer we know the candidate modified the file but
before doing the actual blame. In other words, ignore the cache if the
commit doesn't modify the file.
Compared with previous code, this skips the cache for the commit that
creates the file and for the root commit (blame is that commit, so no
performance loss).
Change-Id: I0fd7279026a30505742527e84f13680b843ad4a3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* 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
|
| | |\
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* 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
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* changes:
DirCacheCheckout.preScanOneTree: consider mode bits
Merge: improve handling of case-variants
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In [1] we could use a "trim" function to remove leading/trailing '/'
from paths.
[1] https://gerrithub.io/q/I1f2a07327d1a1d8149ee482bc2529b7e1a5303db
Change-Id: I490e6afe5c8e6c164d07442b1b388f8a131b4c50
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Need to make DirCacheVersions public otherwise Config#allValuesOf cannot
invoke its #values method via introspection.
Change-Id: Id11a6fdbe7ce3d84f04bf47e98746424dcc761b4
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Following change will add many tests, all using the same "file.txt"
and they read better with a constant.
Extract it now, so we have a clean change with only new tests without
modifying the old ones.
Change-Id: Ib5de86ce434358e8ce8c0514f76010dca31bdd6b
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* changes:
Config: add getters for primitive types without default value
CommitConfig: fix potential NPE
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
which return null if the option is not configured.
Change-Id: I0d444b396458f49712e35ef32427dc45ee3f8ec8
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* 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
|
| |\| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* 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
|
| | |\|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* 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 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>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* changes:
RefDatabase#getReflogReader(String): use #exactRef to resolve refName
Deprecate Repository#getReflogReader methods
Add RefDatabase#getReflogReader methods
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
By instrumenting "LooseObjects#open" with print statements (since
debugging mocks doesn't work in Eclipse) I found that the constructor
"LooseObjects(Config, File)" which defaults "core.trustFolderStat" to
"true" isn't used when mocking LooseObjects. Hence
"core.trustFolderStat" is in fact "false" in the mocked LooseObjects
object.
Make this explicit by configuring "trustFolderStat=false" in a real
"LooseObjects" object and only mock its method "#getObjectLoader" using
a spy.
Change-Id: I2f870637db818c2e89c1c2a174bf78bd572a367a
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The expected value is the first argument and the actual value the second
argument.
Change-Id: I8416cfeaa7a14d0b863658bf133473535647fc57
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: Ic40473aecb23e22c755a9e041592886fb3c448f9
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I6cf6ed64b4029001cb5908338b60385804eb9997
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I600538d0ea7ec4377af331341b8e4e2d51a5a51d
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I63c37a0fb0f6070aba3947903e79d8ebc014f52d
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I8e1b82c76403493faa00ec1a30a6d57a695d8573
|