| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| |
| |
| |
| |
| |
| |
| | |
- comment empty code block
- suppress non-translatable text warning
Change-Id: Id49b4a56bbe5454edfe1ea8b79ceeaf51ceac370
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| | |
Change-Id: Ic6f0fd26153b47b4aeeec105bac431225d9bf8bf
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| |\
| | |
| | |
| | |
| | |
| | | |
* changes:
FileSnapshot: silence "Not a Directory" exceptions
FileSnapshot: refactor to share error handling
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* changes:
Mark Attribute#getValue as @Nullable
Fix potential NPE in ResolveMerger#getAttributesContentMergeStrategy
Fix NPE in DiffFormatter#getDiffDriver
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I172c43ff2e3e682f38a91ce288190245fa5d5ebe
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I2a4c57438c16a0c5bc1af4c7772eaf65049911e2
|
| | |/
| | |
| | |
| | |
| | |
| | | |
Guard against diff attribute with a null value.
Change-Id: Icc4b8d2f360ef105c6d64716cb42f2979967075b
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
The method was originally introduced in 7.1 and then back ported to the
stable-6.10 branch.
Change-Id: I7250013227a666de44e439802d51110bba5af2b9
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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)
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* stable-6.10:
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: I7f18e96cc98c56ee7c5e6256fe9e83957e733aa8
|
| | |
| | |
| | |
| | | |
Change-Id: Ic430686dc41ecbd8d8d19068416bc18ba2d94f3f
|
| | |
| | |
| | |
| | | |
Change-Id: I01da1862719b6623727deae10a706f30ee6cabbf
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Introduce a numberOfObjectsSinceBitmap that contains the number of
objects stored in pack files and as loose objects created since the
latest bitmap generation.
Note that the existing
GcNumberOfPackFilesAfterBitmapStatisticsTest.java was renamed to
GcSinceBitmapStatisticsTest.java and extended to cover also this
statistic.
Change-Id: I8ae1db142ddfcd42a5a1d6da01bc67f695562e0e
|
| |\ \ \
| | |/ /
| |/| |
| | | | |
stable-6.10
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The regexes defined for each built-in driver will be used to determine
the function name for a hunk header. Each driver can specify a list of
regexes to negate and match. They can also define pattern compilation
flags if needed. These drivers only apply to text files with unified
patch type.
Following built-in drivers have been added:
- cpp
- dts
- java
- python
- rust
Support for more languages can be added as needed to match the cgit
implementation.
Change-Id: Ice5430bfed7e4aaf9f00e52e44402479984953c5
|
| |/
| |
| |
| |
| |
| | |
As sugested in I608011462f1.
Change-Id: If66226dd7b08ae768413fa614df5dcb6b44dc118
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* stable-6.10:
Replace custom encoder Constants#encodeASCII by JDK implementation
Replace custom encoder `Constants#encode` by JDK implementation
Add `numberOfPackFilesAfterBitmap` to RepoStatistics
Enhance CommitBuilder#parent to tolerate null parent
Change-Id: If05b0d474c728b54cab9af2b7416be30b2754d1b
|
| |
| |
| |
| |
| |
| |
| |
| | |
Ensure that the method still throws an IllegalArgumentException for
malformed input or if the String contains unmappable characters.
Change-Id: I6a340aa1af60c315272ff13b6bf2041ba30c94ca
(cherry picked from commit 0fd76114e3436ac635641d06371fd8833179312d)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
(cherry picked from commit e5d2898997462e0f2409c09497ab62c6cda2dbaf)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Introduce a `numberOfPackFilesAfterBitmap` that contains the number of
packfiles created since the latest bitmap generation.
Notes:
* the `repo.getObjectDatabase().getPacks()` that obtains the list of
packs (in the existing `getStatistics` function) uses
`PackDirectory.scanPacks` that boils down to call
`PackDirectory.scanPacksImpl` which is sorting packs prior returning
them therefore the `numberOfPackFilesAfterBitmap` is just all packs
before the one that has bitmap attached
* the improved version of `packAndPrune` function (one that skips
non-existent packfiles) was introduced for testing
Change-Id: I608011462f104fc002ac527aa405f492a8a4b0c2
|
|\|
| |
| |
| |
| |
| |
| |
| | |
* stable-6.10:
ResolveMerger: Allow setting the TreeWalk AttributesNodeProvider
Add Union merge strategy support
Change-Id: I0d768d793effd1deabb4807446a4f8c10a82ad74
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a merger is created without a Repository, no
AttributesNodeProvider is created in the TreeWalk. Since mergers are
often created with a custom ObjectInserter and no repo, they skip any
lookups of attributes from any of the gitattributes files (within a
tree, in the repo info/ dir, or user/global). Since there are
potentially merge-affecting attributes in those files, callers might
want to use both a custom ObjectInserter and an AttributesNodeProvider.
Change-Id: I7997309003bbb598e1002261b3be7f2cc52066c8
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* stable-6.10:
Update Apache sshd to 2.14.0
LfsConnectionFactoryTest: remove unnecessary cast
JSchSshProtocol2Test: remove unnecessary cast
ApacheSshProtocol2Test: remove unnecessary cast
NoteMapMerger: remove unnecessary cast
Change-Id: I8fca74d88efadc827955b0a5032e6fbd72ce3e0d
|
| |
| |
| |
| | |
Change-Id: I3be4963f506529bbadc5b6dfc0b625ee85effc1f
|
|\|
| |
| |
| |
| |
| |
| | |
* stable-6.10:
AdvertisedRequestValidator: fix WantNotValidException caused by race
Change-Id: I22ec79d91136f8209a3799465db5593d83f7bea9
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
* stable-6.9:
AdvertisedRequestValidator: fix WantNotValidException caused by race
Change-Id: I662c7a76470cedf0d4c975c50c3981c1c86245f2
|
| | |\
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* stable-6.8:
AdvertisedRequestValidator: fix WantNotValidException caused by race
Change-Id: Ia5a0a4f0e900d96fa638bb9f97988ac66f4b7068
|
| | | |\
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* stable-6.7:
AdvertisedRequestValidator: fix WantNotValidException caused by race
Change-Id: I1e485422608cf55373c1d86c4c0d50c9f9f49f20
|
| | | | |\
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* stable-6.6:
AdvertisedRequestValidator: fix WantNotValidException caused by race
Change-Id: I5b7b097a4b57ec48a3ee20fc25cb0d080cc1af80
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Fetch with protocol V2 failed under the following conditions
- fetch uses bidirectional protocol (git, ssh) which uses a shortcut
to determine invalid wants
- not all wants are advertised
- race condition: wanted ref is updated during fetch by another thread
after the thread serving upload-pack determined wants and before it
checks not advertised wants
Fix this by calling
`new ReachableCommitRequestValidator().checkWants(up, wants)`
instead of throwing WantNotValidException in [1]
if this race happened in the same way like it's done for unidirectional
protocols (http) [2].
[1] https://github.com/eclipse-jgit/jgit/blob/stable-6.10/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java#L2002
[2] https://github.com/eclipse-jgit/jgit/blob/stable-6.10/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java#L2000
Bug: jgit-48
Change-Id: I32f28502923815dc49781aab5d810c9afbe7e7e6
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Change-Id: I5a6a9e398d8b81bf7bd0afbd6c82116d4472a349
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I86507936091e6f7af7588835722672ff2668a205
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Change-Id: I00241e45d947582886658fa528cc20a961fed9e6
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Change-Id: I4b3f1344f77a575b2d0e00462806eddb4e9a6b80
|