| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DfsPackFile.PackIndexes interface doesn't cache anything and assumes
that the caller will keep the loaded references. When the DFS cache
implementation needs a primary index to create the reverse
index, it invokes its own getIndex method, skipping the reference hold
by the caller and potentially triggering reloads.
Pass the primary index as parameter in #getReverseIndex(), so the
caller can reuse its reference.
Change-Id: I1f310eecea73d8f1afc1fb94d40cd94cccdb5996
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
| |
Change-Id: I2ecf5f6c220e88dcc3ec2bf132e71156cf0fe622
Signed-off-by: kylezhao <kylezhao@tencent.com>
Signed-off-by: youtirsin <brocodzhang@tencent.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BlameResult disables the blame cache in the generator, just in case
the generator is setup for a reverse blame (where we cannot use the
cache). This prevents the use of the cache by defaut in the Blame cli.
The generator already takes care of disabling the cache in reverse
blames, so this is unnecessary. Remove the forced disable and let the
generator decide when it can use the cache.
Change-Id: I451b46c3b88c83025276150253a5396ea59b9f54
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
getWhen() is deprecated in PersonIdent.
Move to the new getWhenAsInstant(). Take the change to use Instant for
the lastRepackTime.
Change-Id: Ib641211e7bbf8ff6947d81910c24b2640fbdb4e7
|
|/
|
|
|
|
|
| |
Replace calls to deprecated methods in PersonIdent with their new
versions.
Change-Id: I8ca92df1de77e3a16d89ef4b97c77a6662555560
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
using an AtomicReference isn't necessary since we just set or get the
field and there is no set based on a get.
Change-Id: I83bcfed73ed63ab69af80675f6002e67cadc13e8
|
|
|
|
| |
Change-Id: I163957653b075f1f05a6219f4d23b340588ffcbd
|
|
|
|
| |
Change-Id: I7651613c33803daf00882a543dbf0c3f836110fa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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>
|
| | | |\ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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 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
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fixes errorprone error [OperatorPrecedence], see
https://errorprone.info/bugpattern/OperatorPrecedence
Change-Id: I3086ac0238bcf4661de6a69b1c133a4f64a3a8d4
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
and reduce indentation.
Change-Id: I60a6f721eed051d67aa385a143e2bd3a950485f7
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
and suppress nls warnings.
Change-Id: I33be306f4d5894e81fce7b2b34fdff30313417de
|
| | | | |
| | | | |
| | | | |
| | | | | |
Change-Id: I849d0a3ff07bb53e93112eb716a6537cf2419290
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | | |
index"
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
and fix boxing warnings.
Change-Id: Ia9b4deba7892256639c53bac5d7b62f1fbb01389
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|