| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| | |
* stable-7.2:
Fix: Close the "preserved" PackDirectory
Change-Id: If9f2cd1278aad72f6ca7cae72fbd6b9f5ec66bc8
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
* stable-7.1:
Fix: Close the "preserved" PackDirectory
Change-Id: I82f138f134fe09717e2e024b3c87971140f01b29
|
| | |\
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* stable-7.0:
Fix: Close the "preserved" PackDirectory
Change-Id: Icd3f79322f8c021e18fd5c881cd9f2a406230fa8
|
| | | |\
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* stable-6.10:
Fix: Close the "preserved" PackDirectory
Change-Id: Ie0ecfd8178ef4e2eef6a29d46be5645648fe88f3
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This has been missing since the feature was first added in commit
6167641834e28f8ad322f8fde60866b339bfb7fe.
It's possible we could be more aggressive and close soon after
attempting to get an object from the preserved packs, but for concurrent
misses that might cause thrashing. More likely it would be safe to
attempt closing after successfully restoring a preserved pack. A follow
up change should attempt that.
Change-Id: I87d61007bcc3d03fc86bd18465ca66a2e6f697a1
|
|\| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* stable-7.2:
Use the same ordering/locking in delete() as C git
Change-Id: I0b583cd218c39b1dc0726ae82da86eca58cc81eb
|
| |\| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* stable-7.1:
Use the same ordering/locking in delete() as C git
Change-Id: Id52c938b041604162dca9162726bfb594e96f5d1
|
| | |\| |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* stable-7.0:
Use the same ordering/locking in delete() as C git
Change-Id: I2c38321ee410d9ec60481d56315710beaebd393a
|
| | | |\|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* stable-6.10:
Use the same ordering/locking in delete() as C git
Change-Id: I0d06e39d06315e0b9e770bdf79164779d98f9f50
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Following the examples of cgit, lock packed-refs *before* checking for
existance of refs in it [1] and *keep the lock* until the loose ref (if
any) is removed [2]. The packed-refs lock is kept even when no
packed-refs update is required [3] so that somebody else doesn't pack a
reference that we are trying to delete.
This fixes a concurrency issue that happens on projects with a
substantial amount of refs(>~500k) where packing takes long enough for a
ref deletion to be triggered half way through it. Not locking the
packed-refs file before checking if the refs exists is not safe, as it
opens up situations where loose refs are repacked in memory and locked
on disk, but before the lock is released and packed-refs is flushed to
disk, a ref is deleted.
As packed-refs was NOT locked while checking wether a ref existed in it,
the current content on disk was read, which was about to be overwritten
and did not contain the ref about to be deleted. As the delete doesn't
see the ref in the current, on-disk, version of packed refs, it skips
processing altogether and moves on, correctly, deleting only the
associated loose ref and leaving the packed one behind.
Once the new packed-refs, containing the ref that was just deleted, was
commited to disk, the ref would come back to life.
Therefore, the packed-refs needs to be locked before checking if it
contains a ref or not in the same way the C implementation of Git does
at [1].
There are tradeoffs, though, in this decision, which will reduce the
parallelism of deleting loose refs and performing the refs repacking,
which happens very often in certain JGit implementations like Gerrit
Code Review. Before this change, repacking of refs and removal of loose
refs unrelated to the in-flight repacking was possible without involving
any locking; after this change, all loose refs removals have to wait for
the packing of refs to be completed, even though the repacking and the
refs removals were completely unrelated and their namespaces disjoint.
See more details on the test's performance results and the associated
tradeoffs in the Issue jgit-152.
NOTE: This delete ref locking logic was incorrect regardless of how the
packing of the refs is implemented. Making decisions if the pack
transaction is needed or not on an unlocked resource is racy and also
flagged as bug at [1].
[1]https://github.com/git/git/blob/master/refs/packed-backend.c#L1590
[2]https://github.com/git/git/blob/master/refs/files-backend.c#L3261
[3]https://github.com/git/git/blob/master/refs/files-backend.c#L2943
Bug: jgit-152
Change-Id: I158ec837904617c5fdf667e295ae667b2f037945
|
| | |\| |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* stable-7.0:
Prepare 7.0.2-SNAPSHOT builds
JGit v7.0.1.202505221510-r
Prepare 6.10.2-SNAPSHOT builds
JGit v6.10.1.202505221210-r
AmazonS3: Do not accept DOCTYPE and entities
ManifestParser: Do not accept DOCTYPE and entities
Change-Id: I4506e4bf51225000418b15bf09df3287be26242a
|
| | | |\|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* stable-6.10:
Prepare 6.10.2-SNAPSHOT builds
JGit v6.10.1.202505221210-r
AmazonS3: Do not accept DOCTYPE and entities
ManifestParser: Do not accept DOCTYPE and entities
Change-Id: I699d57974d9ef2428355c59194c6becbc16828b7
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This follows OWASP recommendations in
https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html
Change-Id: I3d47debf14d95c8189d51256b4eb2ba991279452
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
These open the door for XXE attacks [1] and manifest do not need them.
[1] https://en.wikipedia.org/wiki/XML_external_entity_attack
Change-Id: Ia79971e1c34afaf287584ae4a7f71baebcb48b6a
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
to avoid unnecessary computations if the task getting
FileStoreAttributes asynchronously timed out, cancelled or failed with
another exceptions.
Change-Id: I127a3e2f3710fc5a8742c61f513576ee2d84baed
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The reader iterates the packs looking for the best representation of
an object. It does so using the primary and reverse indexes of the
pack. This direct use of the indexes prevent the pack to be more
clever and use the multipack index in these operations.
Move finding objects in the pack and the representation to the pack
itself. Now the pack can decide how to implement it (e.g. using the
multipack index).
Change-Id: Ief0f2384ab395557c2533990f7b3c532a88d7ac9
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This method doesn't seem to be used.
Change-Id: I9b7a25aa7bd99b461bb79a0d25c61a1fd6d40e64
|
|\| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* stable-7.2:
Prepare 7.2.2-SNAPSHOT builds
JGit v7.2.1.202505142326-r
AmazonS3: Do not accept DOCTYPE and entities
ManifestParser: Do not accept DOCTYPE and entities
Change-Id: I2a56d92735c003d7d61147743409a24e1539ad55
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This follows OWASP recommendations in
https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html
Change-Id: I3d47debf14d95c8189d51256b4eb2ba991279452
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
These open the door for XXE attacks [1] and manifest do not need them.
[1] https://en.wikipedia.org/wiki/XML_external_entity_attack
Change-Id: Ia79971e1c34afaf287584ae4a7f71baebcb48b6a
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If "core.trustTablesListStat" is set to "after_open" to ensure file
attributes are refreshed on NFS refreshing only the attributes of the
tables.list file is not sufficient since then NFS may not detect new
reftable files (stored in the same refs/reftable/ directory) which may
cause FileNotFoundExceptions. Fix this by refreshing attributes of the
refs/reftable/ directory.
Change-Id: I7e07834fd7628a07ed644cb2740101a749d433bb
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The filesystem layout of reftables is fixed in the reftable
specification hence the constructor
FileReftableStack(File tablesListFile, File reftableDir,
@Nullable Runnable onChange, Supplier<Config> configSupplier)
should not allow to pass the path of the tables.list file independently
from the refs/reftable/ directory containing both the tables.list file
and the reftable files. Hence remove the path of the tables.list file
from its argument list and instead set it inside the constructor.
Use reftableDir instead of tablesListFile.getParentFile().
Also rename FileReftableStack.stackPath to tablesListFile which is
easier to understand and remove the useless return value of
FileReftableDatabase#convertFrom which was unused and always returned
null.
Change-Id: If1efba5d49d979d99a86871996abe550422d8945
|
|\ \ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The #timeof method returned
- the commit time in seconds since the epoch for RevCommits
- the tagger time in milliseconds since the epoch for annotated tags
Fix this by converting commit time to milliseconds to ensure consistent
timestamp comparison of tags and commits.
Change-Id: I91621da19c234fe823788d85e4077750cb5cba1a
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
We turned this off to debug something else and it created
significantly bigger packs that spammed the storage. There is no
reason to allow duplicates while inserting in a pack, so lets remove
completely the option.
The setter is not used and the variable is always true.
Change-Id: I978049dce30c33b7aa650d3ddef9430cbef764fa
|
|/ / / / /
| | | | |
| | | | |
| | | | | |
Change-Id: I0972121aaba6fd05f733d3ec62515e00c30530c7
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This code was introduced recently and the license header says Google
Inc. where it should be Google LLC.
Change-Id: If3d4f992bdcd165cfba356b4f9721c4605017dda
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The code establishing the PackExt from the file name uses endsWith, i
think to cover for the x.<ext> and x.old-<ext> cases. This doesn't
work if we add the "midx" case, as "midx".endsWith("idx").
Check explicitely that the extension maches itself or with the old-
prefix. We rather keep the "midx" as file extension for upstream
compatibility.
Change-Id: I25d0e850b9df17ed99d776b397560774bc402d39
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is useful later, in GC, to write the size of the stream in the
pack description.
Change-Id: Ic3d759c1120ef2fde77b432d33c46ba1791d954b
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Errorprone pointed out that adding with int and casting to long at the
end could overflow.
Mark one of the operands as long to do the addition directly as long
and avoid the overflow risk.
Change-Id: I12449af90c84044a04e6dbd0978ff48d0ea33674
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Cosmetic changes.
Change-Id: I5f4d463cbb4e256d068369efc798c1c00f17c18c
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We need a size estimation to store this ref in the DfsBlockCache.
Change-Id: I974099cf66a66d09320a795638abfeac506da2c1
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|