summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
Commit message (Collapse)AuthorAgeFilesLines
* Add API checking using clirrMatthias Sohn2011-12-151-0/+20
| | | | | | | | | | | | | | | | | | In order to generate API reports run: mvn clirr:clirr The reports are generated to the folder target/site/clirr-report.html under the respective project. In order to check API compatibility and fail the build on incompatible changes run: mvn clirr:check For now we compare the API against the latest release 1.1.0.201109151100-r. Bug: 336849 Change-Id: I21baaf3a6883c5b4db263f712705cc7b8ab6d888 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Kevin Sawicki <kevin@github.com>
* Fix ResolveMerger not to add paths with FileMode 0Christian Halstrick2011-12-111-7/+75
| | | | | | | | | | | | | | | | | | | When ResolveMerger finds a path where it has to do a content merge it will try the content merge and if that succeeds it'll add the newly produced content to the index. For the FileMode of this new index entry it blindly copies the FileMode it finds for that path in the common base tree. If by chance the common base tree does not contain this path it'll try to add FileMode 0 (MISSING) to the index. One could argue that this can't happen: how can the ResolveMerger successfully (with no conflicts) merge two contents if there is no common base? This was due to another bug in ResolveMerger. It failed to find out that for two files which differ only in the FileMode (e.g. 644 vs. 755) it should not try a content merge. Change-Id: I7a00fe1a6c610679be475cab8a3f8aa4c08811a1 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Throw API exception when MergeCommand hits checkout conflicts Matthias Sohn2011-12-082-3/+24
| | | | | | | | | | | When MergeCommand hit checkout conflicts it did throw an internal JGit exception org.eclipse.jgit.errors.CheckoutConflictException instead of org.eclipse.jgit.api.errors.CheckoutConflictException which it declares to throw. Hence translate the internal exception to the exception declared in the API. Bug: 327573 Change-Id: I1efcd93a43ecbf4a40583e0fc9d8d53cffc98cae Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix history rendering not to occupy too many lanesChristian Halstrick2011-12-061-0/+2
| | | | | | | | | | | There was a bug in history rendering which caused jgit to use too many lanes in case lanes get repositioned. Looking at commit 90c11cbaeb83ee9b02238cbd2c0e5bcf68068772 in JGit was one example. Vadim Dmitriev found the problem and the solution. Bug: 365460 Change-Id: I6024265b7a593dcfd4fc612d0baf6652a0092ff4 Also-by: Vadim Dmitriev <dmgloss@mail.ru> Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* Fix History renderingChristian Halstrick2011-12-041-30/+42
| | | | | | | | | There was the possibility that during history rendering we draw a lane "trough" a passed commit. Vadim Dmitriev found that out in bug 335818. I added the needed check to that block of code where it was missing. Bug: 335818 Change-Id: Ic944193b2aca55ff3eb0235d46afa60b7896aa0f Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* Merge "RepositoryState: add method canAmend"Christian Halstrick2011-11-301-0/+18
|\
| * RepositoryState: add method canAmendJens Baumgart2011-11-281-0/+18
| | | | | | | | | | | | | | | | The method canAmend was added to RepositoryState. It returns true if amending the HEAD commit is allowed in the current repository state. Change-Id: Idd0c4eea83a23c41340789b7b877959b457d951e Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
* | Merge "Always checkout master when it matches the advertised HEAD"Shawn Pearce2011-11-281-0/+6
|\ \
| * | Always checkout master when it matches the advertised HEADKevin Sawicki2011-11-281-0/+6
| | | | | | | | | | | | | | | | | | | | | This parallels the CGit behavior of always using refs/heads/master when it matches the remote advertised HEAD commit. Change-Id: I5a5cd1516b58d116e334056aba1ef7990697ec30
* | | Merge "Implement Serializable interface in ReflogEntry"Shawn Pearce2011-11-281-1/+5
|\ \ \
| * | | Implement Serializable interface in ReflogEntryKevin Sawicki2011-11-281-1/+5
| |/ / | | | | | | | | | Change-Id: Idf798dd3981bef3dc9e17c13c12809f89089e96f
* / / Remove calls to printStackTrace in catch blocksKevin Sawicki2011-11-283-6/+1
|/ / | | | | | | Change-Id: I7a4179f10a4841e80b6546e1e7662cab71eac5e9
* | Merge "Reset SSH connection and credentials on "Auth fail""Shawn Pearce2011-11-262-20/+55
|\ \
| * | Reset SSH connection and credentials on "Auth fail"Matthias Sohn2011-11-272-20/+55
| |/ | | | | | | | | | | | | | | | | | | | | When SSH user/password authentication failed this may have been caused by changed credentials on the server side. When the SSH credentials of a user change the SSH connection needs to be re-established and credentials which may have been stored by the credentials provider need to be reset in order to enable prompting for the new credentials. Bug: 356233 Change-Id: I7d64c5f39b68a9687c858bb68a961616eabbc751 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* / Don't iterate over advertised refs when HEAD is nullKevin Sawicki2011-11-261-3/+3
|/ | | | | | | Moves the check from inside the loop to outside the loop and returns immediately if the HEAD advertisded ref is null Change-Id: I539da6cafb4f73610b8e00259e32bd4d57f4f4cc
* Adapt merge message to C Git for remote-tracking branchRobin Stocker2011-11-231-2/+2
| | | | | | | | | | | | | Commit 13931236b9ee2895a98ffdbdacbd0f895956d8a8 in C Git (2011-11-02) changed the message format: -Merge remote branch 'origin/foo' +Merge remote-tracking branch 'origin/foo' This change does the same in EGit to be consistent. Change-Id: I7d9c5afa95771dbfe6079b5f89a10b248fee0172 Signed-off-by: Robin Stocker <robin@nibor.org>
* Guard against null branch in PullCommandKevin Sawicki2011-11-223-1/+7
| | | | | | | | Throw a NoHeadException when Repository.getFullBranch returns null Bug: 351543 Change-Id: I666cd5b67781508a293ae553c6fe5c080c8f4d99 Signed-off-by: Kevin Sawicki <kevin@github.com>
* Support adding all refs to LogCommandKevin Sawicki2011-11-221-0/+19
| | | | | Bug: 353310 Change-Id: Ifa2e7ed58c7f2bdfe3aafbd500b5a38c1f94c2ec Signed-off-by: Kevin Sawicki <kevin@github.com>
* Merge "Provide merge result when revert command fails"Shawn Pearce2011-11-221-0/+22
|\
| * Provide merge result when revert command failsKevin Sawicki2011-11-211-0/+22
| | | | | | | | | | | | | | This allows callers to determine why the revert did not complete successfully Change-Id: Ie44bb8523cac388b63748bc69ebdd3c3a3665d06 Signed-off-by: Kevin Sawicki <kevin@github.com>
* | maxObjectSizeLimit for receive-pack.Sasa Zivkov2011-11-225-2/+147
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ReceivePack (and PackParser) can be configured with the maxObjectSizeLimit in order to prevent users from pushing too large objects to Git. The limit check is applied to all object types although it is most likely that a BLOB will exceed the limit. In all cases the size of the object header is excluded from the object size which is checked against the limit as this is the size of which a BLOB object would take in the working tree when checked out as a file. When an object exceeds the maxObjectSizeLimit the receive-pack will abort immediately. Delta objects (both offset and ref delta) are also checked against the limit. However, for delta objects we will first check the size of the inflated delta block against the maxObjectSizeLimit and abort immediately if it exceeds the limit. In this case we even do not know the exact size of the resolved delta object but we assume it will be larger than the given maxObjectSizeLimit as delta is generally only chosen if the delta can copy more data from the base object than the delta needs to insert or needs to represent the copy ranges. Aborting early, in this case, avoids unnecessary inflating of the (huge) delta block. Unfortunately, it is too expensive (especially for a large delta) to compute SHA-1 of an object that causes the receive-pack to abort. This would decrease the value of this feature whose main purpose is to protect server resources from users pushing huge objects. Therefore we don't report the SHA-1 in the error message. Change-Id: I177ef24553faacda444ed5895e40ac8925ca0d1e Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Add missing '' characters around quoted variables"Shawn Pearce2011-11-181-6/+6
|\
| * Add missing '' characters around quoted variablesKevin Sawicki2011-11-181-6/+6
| | | | | | | | | | | | | | | | Double ' characters are needed for variables to appear in single quotes. Variables surrounded with a s single ' will not be replaced when formatted Change-Id: I0182c1f679ba879ca19dd81bf46924f415dc6003 Signed-off-by: Kevin Sawicki <kevin@github.com>
* | Fix duplicate objects in "thin+cached" packs from DFSShawn O. Pearce2011-11-181-25/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DfsReader must offer every representation of an object that exists on the local repository when PackWriter asks for them. This is necessary to identify objects in the thin pack part that are also in the cached pack that will be appended onto the end of the stream. Without looking at all alternatives, PackWriter may pack the same object twice (once in the thin section, again in the cached base pack). This may cause the command line C version to go into an infinite loop when repacking the resulting repository, as it may see a delta chain cycle with one of those duplicate copies of the object. Previously the DfsReader tried to avoid looking at packs that it might not care about, but this is insufficient, as all versions must be considered during pack generation. Change-Id: Ibf4a3e8ea5c42aef16404ffc42a5781edd97b18e
* | Do not write edge objects to the pack streamShawn O. Pearce2011-11-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider two objects A->B where A uses B as a delta base, and these are in the same source pack file ordered as "A B". If cached packs is enabled and B is also in the cached pack that will be appended onto the end of the thin pack, and both A, B are supposed to be in the thin pack, PackWriter must consider the fact that A's base B is an edge object that claims to be part of the new pack, but is actually "external" and cannot be written first. If the object reuse system considered B candidates fist this bug does not arise, as B will be marked as edge due to it existing in the cached pack. When the A candidates are later examined, A sees a valid delta base is available as an edge, and will not later try to "write base first" during the writing phase. However, when the reuse system considers A candidates first they see that B will be in the outgoing pack, as it is still part of the thin pack, and arrange for A to be written first. Later when A switches from being in-pack to being an edge object (as it is part of the cached pack) the pointer in B does not get its type changed from ObjectToPack to ObjectId, so B thinks A is non-edge. We work around this case by also checking that the delta base B is non-edge before writing the object to the pack. Later when A writes its object header, delta base B's ObjectToPack will have an offset == 0, which makes isWritten() = false, and the OBJ_REF delta format will be used for A's header. This will be resolved by the client to the copy of B that appears in the later cached pack. Change-Id: Ifab6bfdf3c0aa93649468f49bcf91d67f90362ca
* | Use long for more object counts in PackWriterShawn O. Pearce2011-11-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | Packs can contain up to 2^32-1 objects, which exceeds the range of a Java int. Try harder to accept higher object counts in some cases by using long more often when we are working with the object count value. This is a trivial refactoring, we may have to make even more changes to the object handling code to support more than 2^31-1 objects. Change-Id: I8cd8146e97cd1c738ad5b48fa9e33804982167e7
* | Search for annotated tag reuse firstShawn O. Pearce2011-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Annotated tags are relatively rare and currently are scheduled in a pack file near the commits, decreasing the time it takes to resolve client requests reading tags as part of a history traversal. Putting them first before the commits allows the storage system to page in the tag area, and have it relatively hot in the LRU when the nearby commit area gets examined too. Later looking at the tree and blob data will pollute the cache, making it more likely the tags are not loaded and would require file IO. Change-Id: I425f1f63ef937b8447c396939222ea20fdda290f
* | Correct progress monitor on "Getting sizes:" phaseShawn O. Pearce2011-11-181-2/+2
| | | | | | | | | | | | | | | | | | This counter always was running 1 higher, because it incremented after the queue was exhausted (and every object was processed). Move increments to be after the queue has provided a result, to ensure we do not show a higher in-progress count than total count. Change-Id: I97f815a0492c0957300475af409b6c6260008463
* | Refactor DfsReader selection of cached packsShawn O. Pearce2011-11-181-3/+6
|/ | | | | | | | | Make the code more clear with a simple refactoring of the boolean logic into a method that describes the condition we are looking for on each pack file. A cached pack is possible if there exists a tips collection, and the collection is non-empty. Change-Id: I4ac42b0622b39d159a0f4f223e291c35c71f672c
* Merge changes I366435e2,I64577f8fShawn Pearce2011-11-182-1/+8
|\ | | | | | | | | | | * changes: [findBugs] Silence returning null for StringUtils.toBooleanOrNull() [findBugs] Prefer short-cut logic as it's more performant
| * [findBugs] Silence returning null for StringUtils.toBooleanOrNull()Matthias Sohn2011-11-161-0/+7
| | | | | | | | | | | | | | | | As the method name and its javadoc clearly state that this method can return null we can ignore this FindBugs warning. Change-Id: I366435e26eda5d910f5d1a907db51f08efd4bb8c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * [findBugs] Prefer short-cut logic as it's more performantMatthias Sohn2011-11-161-1/+1
| | | | | | | | Change-Id: I64577f8fd19ee0d2d407479cc70e521adc367f37 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Keep track of a static collection of all PackWriter instancesDave Borowitz2011-11-141-0/+52
| | | | | | | | | | | | | | | | | | Stored in a weak concurrent hash map, which we clean up while iterating. Usually the weak reference behavior should not be necessary because PackWriters should be released with release(), but we still want to avoid leaks when dealing with broken client code. Change-Id: I337abb952ac6524f7f920fedf04065edf84d01d2
* | Estimate the amount of memory used by a PackWriterDave Borowitz2011-11-141-3/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Memory usage is dominated by three terms: - The maximum memory allocated to each delta window. - The maximum size of a single file held in memory during delta search. - ObjectToPack instances owned by the writer. For the first two terms, rather than doing complex instrumentation of the DeltaWindows, we just overestimate based on the config parameters (though we may underestimate if the maximum size is not set). For the ObjectToPack instances, we do some rough byte accounting of the underlying Java object representation. Change-Id: I23fe3cf9d260a91f1aeb6ea22d75af8ddb9b1939
* | Add an object encapsulating the state of a PackWriterDave Borowitz2011-11-143-14/+108
|/ | | | | | | | Exposes essentially the same state machine to the programmer as is exposed to the client via a ProgressMonitor, using a wrapper around beginTask()/endTask(). Change-Id: Ic3622b4acea65d2b9b3551c668806981fa7293e3
* Merge "Implement DirCacheEntry.toString() to ease debugging"Christian Halstrick2011-11-111-0/+10
|\
| * Implement DirCacheEntry.toString() to ease debuggingMatthias Sohn2011-11-101-0/+10
| | | | | | | | | | Change-Id: I9aa1b5817a18fb340411f47b25b6711d533590fd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add detection of untracked folders to IndexDiffFilterJens Baumgart2011-11-102-3/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decorators need to know whether folders in the working tree contain only untracked files. This change enhances IndexDiffFilter to report such folders. This works only together with treewalks which operate in default traversal mode. For treewalks which process entries in postorder mode (files are walked before their parent folder is walked) this detection doesn't work. Bug: 359264 Change-Id: I9298d1e3ccac0aec8bbd4e8ac867bc06a5c89c9f Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | [blame] Fix blame following renames in non-toplevel directoriesCarsten Pfeiffer2011-11-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | Mark the treeWalk as recursive; otherwise following renames only works for toplevel files. Bug: 302549 Change-Id: I70867928eadf332b0942f8bf6877a3acb3828c87 Signed-off-by: Carsten Pfeiffer <carsten.pfeiffer@gebit.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | Support a configured credentials provider in LsRemoteCommandKevin Sawicki2011-11-106-216/+192
|/ | | | | | | | | | | | Refactored the three common transport configuration options: credentials provider, timeout, and transport config callback into a new TransportCommand base class which is now extended by all commands that use a Transport object during execution. Bug: 349188 Change-Id: I90c2c14fb4e3cc4712905158f9047153a0c235c2 Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Merge changes Ibb3467f7,I2af99903Robin Rosenberg2011-11-101-36/+42
|\ | | | | | | | | | | * changes: Always use try/finally around DfsBlockCache.clockLock DfsBlockCache: Fix NPE when evicting empty cell
| * Always use try/finally around DfsBlockCache.clockLockShawn O. Pearce2011-11-081-35/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | Any RuntimeException or Error in this block will leave the lock held by the caller thread, which can later result in deadlock or just cache requests hanging forever because they cannot get to the lock object. Wrap everything in try/finally to prevent the lock from hanging, even though a RuntimeException or Error should never happen in any of these code paths. Change-Id: Ibb3467f7ee4c06f617b737858b4be17b10d936e0
| * DfsBlockCache: Fix NPE when evicting empty cellShawn O. Pearce2011-11-081-1/+1
| | | | | | | | | | | | | | | | | | The cache starts with a single empty Ref that has no data, as the clock list does not support being empty. When this Ref is removed, the size has to be decremented from the associated DfsPackKey, which was previously null. Make it always be non-null. Change-Id: I2af99903e8039405ea6d67f383576ffa43839cff
* | Kill GitIndexRobin Rosenberg2011-11-093-1111/+0
| | | | | | | | | | | | | | | | | | | | A few places were still using GitIndex. Replacing it was fairly simple, but there is a difference in test outcome in ReadTreeTest.testUntrackedConflicts. I believe the new behavior is good, since we do not update neither the index, not the worktree. Change-Id: I4be5357b7b3139dded17f77e07a140addb213ea7 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | Deprecate GitIndex more by using only DirCache internally.Robin Rosenberg2011-11-092-0/+2
|/ | | | | | | | | | | | | | | | This includes merging ReadTreeTest into DirCacheCheckoutTest and converting IndexDiffTest to use DirCache only. The GitIndex specific T0007GitIndex test remains. GitIndex is deprecated. Let us speed up its demise by focusing the DirCacheCheckout tests to using DirCache instead. This also add explicit deprecation comments to methods that depend on GitIndex in Repository and TreeEntry. The latter is deprecated in itself. Change-Id: Id89262f7fbfee07871f444378f196ded444f2783 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Merge "Do not resolve path using cygwin unless told to"Shawn Pearce2011-11-041-5/+8
|\
| * Do not resolve path using cygwin unless told toRobin Rosenberg2011-10-281-5/+8
| | | | | | | | | | | | | | | | | | | | | | The system property jgit.cygpath must be set to true in order for cygwin's cygpath to be used to translate path from cygwin namespace to Windows namespace. The cygwin path translation should be considered deprecated. Bug: 353389 Change-Id: I2b5234c0ab936dac67d1e232f4cd28331bf3226d Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | Merge changes ↵Shawn Pearce2011-11-0439-0/+8103
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Icea2572d,I2633e472,I207c0c93,I10cee76c,Ifd78e8ce,I890b5fcc,Ia0b01f5d,Iec524abd * changes: DfsBlockCache: Update hits to not include contains() Add a listener for changes to a DfsObjDatabase's pack files Expose the reverse index size in the DfsPackDescription Add a DfsPackFile method to get the number of cached bytes Expose the list of pack files in the DfsBlockCache Add a DFS repository description and reference it in each pack Clarify the docstring of DfsBlockCache.reconfigure() DFS: A storage layer for JGit
| * | DfsBlockCache: Update hits to not include contains()Colby Ranger2011-11-041-12/+23
| | | | | | | | | | | | | | | | | | | | | Also expose the underlying hit and miss counters, in addition to the hit ratio. Change-Id: Icea2572d62e59318133b0a88848019f34ad70975
| * | Add a listener for changes to a DfsObjDatabase's pack filesDave Borowitz2011-11-043-3/+131
| | | | | | | | | | | | | | | | | | | | | Intended for cross-request use, so only refers to DfsRepositoryDescriptions rather than DfsRepositorys. Change-Id: I2633e472c9264d91d632069f608d53d4bdd0fc09