summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: Reuse local variable for current DirCacheEntryRobin Rosenberg2011-09-081-9/+9
| | | | | | | | Since we already have assigned i.getDirCacheEntry() to dce, use dce instead. Change-Id: I107713ad0b356516d75c29203f945b056bad3ac7 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Prepare post v1.1.0.201109071825-rc3 buildsMatthias Sohn2011-09-0840-49/+49
| | | | | Change-Id: I1244f6639263d156a6f9e4530167e5eb1826a535 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v1.1.0.201109071825-rc3v1.1.0.201109071825-rc3Matthias Sohn2011-09-0840-49/+49
| | | | | Change-Id: I1b989d3101272632eacabe25a0b111ad0ff5bb3b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use commit message best practices for Mylyn Commit templateMatthias Sohn2011-09-0538-0/+133
| | | | | | | | | | We should use a template for Mylyn commit messages that matches with our guidelines for commit messages. http://wiki.eclipse.org/EGit/Contributor_Guide#Commit_message_guidelines Bug: 337401 Change-Id: I05812abf0eb0651d22c439142640f173fc2f2ba0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix the names in the reflog for checkoutsRobin Rosenberg2011-09-051-4/+10
| | | | | | | | | | We were diverging from the reference implementation. Always use the ref we checkout to as the to-branch the reflog and avoid the refs/heads both in the from-name and to-name. Change-Id: Id973d9102593872e4df41d0788f0eb7c7fd130c4 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add a helper for parsing branch switch info out of a reflog entryRobin Rosenberg2011-09-053-1/+108
| | | | | | Change-Id: I91c7e08c4afd2562df2226887a933d93c78a0371 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove workarounds for fixed Tycho bugsMatthias Sohn2011-09-051-2/+0
| | | | | | | | | This removes the workaround for Tycho bug - http://issues.sonatype.org/browse/TYCHO-313 which has been fixed. Change-Id: I54a8de885ae3e6c45a778171dad6f6e5e9322114 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Define os/ws/arch environments for tycho buildMatthias Sohn2011-09-051-1/+28
| | | | | | | | | Explicitly define os/ws/arch environments for target-platform-configuration to make build platform independent. Change-Id: If43f5ee573c9abaa0359ea2386477b379012e834 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [blame] Reset rename detector before computing renames.Kevin Sawicki2011-09-011-0/+1
| | | | | | Bug: 354507 Change-Id: I5e9c65a082d9dee1e87536c5cf2a8de75efa6a33 Signed-off-by: Kevin Sawicki <kevin@github.com>
* Prepare post-v1.1.0.201109011030-rc2 buildsMatthias Sohn2011-09-0140-50/+50
| | | | Change-Id: I8dda83cdbe88beba4a480df9846848bf3aceb9e2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v1.1.0.201109011030-rc2v1.1.0.201109011030-rc2Matthias Sohn2011-09-0140-50/+50
| | | | | Change-Id: Ie6d65fe45ad92c813ce3a227729aa43681922249 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use the appropriate constant for ".git"Robin Rosenberg2011-08-272-2/+2
| | | | | | | | | | We have two constants with the same content. DOT_GIT is intended for the git repository below the work tree, while DOT_GIT_EXT is the ".git" directory extension usually associated with bare repositories. Change-Id: I0946b4beb2d1c3af289ddbbb5641d2f4e4c49d3f Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Tolerate zlib deflation with window size < 32KbRoberto Tyley2011-08-251-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit currently identifies loose objects as 'corrupt' if they've been deflated using a window size less than 32Kb, because the isStandardFormat() function doesn't recognise the header byte as a zlib header. This patch makes the method tolerant of all valid window sizes (15-bit to 8-bit) - but doesn't sacrifice it's accuracy in distingushing the standard loose-object format from the experimental (now abandoned) format. It's based on a patch which has been merged into C-Git master branch: https://github.com/git/git/commit/7f684a2aff636f44a506 On memory constrained systems zlib may use a much smaller window size - working on Agit, I found that Android uses a 4KB window; giving a header byte of 0x48, not 0x78. Consequently all loose objects generated by the Android platform appear 'corrupt' :( It might appear that this patch changes isStandardFormat() to the point where it could incorrectly identify the experimental format as the standard one, but the two criteria (bitmask & checksum) can only give a false result for an experimental object where both of the following are true: 1) object size is exactly 8 bytes when uncompressed (bitmask) 2) [single-byte in-pack git type&size header] * 256 + [1st byte of the following zlib header] % 31 = 0 (checksum) As it happens, for all possible combinations of valid object type (1-4) and window bits (0-7), the only time when the checksum will be divisible by 31 is for 0x1838 - ie object type *1*, a Commit - which, due the fields all Commit objects must contain, could never be as small as 8 bytes in size. Given this, the combination of the two criteria (bitmask & checksum) always correctly determines the buffer format, and is more tolerant than the previous version. References: Android uses a 4KB window for deflation: http://android.git.kernel.org/?p=platform/libcore.git;a=blob;f=luni/src/main/native/java_util_zip_Deflater.cpp;h=c0b2feff196e63a7b85d97cf9ae5bb2583409c28;hb=refs/heads/gingerbread#l53 Code snippet searching for false positives with the zlib checksum: https://gist.github.com/1118177 Change-Id: Ifd84cd2bd6b46f087c9984fb4cbd8309f483dec0
* Merge "Unwind loop that iterates over fetch connection refs."Stefan Lay2011-08-251-17/+14
|\
| * Unwind loop that iterates over fetch connection refs.Kevin Sawicki2011-08-221-17/+14
| | | | | | | | | | | | | | | | Create separate loops based on whether the ref specs collection is empty or not. Change-Id: I2861b45fe083675e12ff47f591e104f8cf6dd216 Signed-off-by: Kevin Sawicki <kevin@github.com>
* | Reassign symbolic ref list after calling put.Kevin Sawicki2011-08-241-1/+1
| | | | | | | | | | | | | | This is required since RefList.put returns a new RefList. Change-Id: I717d75d6f6154a6e0dc7cde3b72b0a59c68d955c Signed-off-by: Kevin Sawicki <kevin@github.com>
* | Merge "Fix boxing warnings in PushProcessTest"Christian Halstrick2011-08-241-7/+7
|\ \
| * | Fix boxing warnings in PushProcessTestTomasz Zarna2011-08-241-7/+7
| |/ | | | | | | Change-Id: I5114968536853fb530b8a96c10def675e39c884f
* / Use JGitText.refAlreadyExists instead of "ref exists"Tomasz Zarna2011-08-245-5/+6
|/ | | | Change-Id: I113bcf82c6292db5269271f799d09c80acc40bcd
* Throw JGit exception when ResetCommand got wrong refChristian Halstrick2011-08-212-0/+23
| | | | | | | | | | | | If the ResetCommand should reset to a invalid ref (e.g. HEAD in a repo whithout a single commit) it was throwing an NPE. This is fixed now by throwing a JGitInternalExcpeption. It would be nicer if we could throw a InvalidRefException, but this would modify our API. Bug: 339610 Change-Id: Iffcb4f2cca9f702176471d93c3a71e5cb3e700b1 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Implement server support for shallow clonesMatt Fischer2011-08-215-37/+577
| | | | | | | | | | This implements the server side of shallow clones only (i.e. git-upload-pack), not the client side. CQ: 5517 Bug: 301627 Change-Id: Ied5f501f9c8d1fe90ab2ba44fac5fa67ed0035a4 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* PackWriter: support excluding objects already in other packsShawn O. Pearce2011-08-211-1/+49
| | | | | | | | | | | | | This can be useful when implementing garbage collection and there are packs that should not be copied, such as huge packs that have a sibling ".keep" file alongside of them. Callers driving PackWriter need to initialize the list of packs not to include objects from by passing each index to excludeObjects(). Change-Id: Id7f34df69df97be406bcae184308e92b0e8690fd Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Fix ClassCastException in MergeCommandDenys Digtiar2011-08-216-51/+47
| | | | | | | | | | Test was added which reproduce the ClassCastException when ours or theirs merge strategy is set to MergeCommand. Merger and MergeCommand were updated in order to avoid exception. Change-Id: I4c1284b4e80d82638d0677a05e5d38182526d196 Signed-off-by: Denys Digtiar <duemir@gmail.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add ListTagCommand to JGit APIKetan Padegaonkar2011-08-213-2/+152
| | | | | | Bug: 355246 Change-Id: I11e019f3c19b4340ac7160ac8fcbadd52499d322 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Merge "Add DeleteTagCommand to JGit API"Chris Aniszczyk2011-08-215-0/+220
|\
| * Add DeleteTagCommand to JGit APITomasz Zarna2011-08-215-0/+220
| | | | | | | | | | | | Bug: 353226 Change-Id: I54ae237cab792742333a249eb5a774d5e1775af8 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Merge "PackWriter: Make want/have actual sets"Christian Halstrick2011-08-185-31/+113
|\ \
| * | PackWriter: Make want/have actual setsShawn O. Pearce2011-08-165-31/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During parsing these are used with contains(). If they are a List type, the contains operation is not efficient. Some callers such as UploadPack often pass a List here, so convert to Set when the type isn't efficient for contains(). Change-Id: If948ae3bf1f46e756bd2d5db14795e12ba7a6207 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Use HEAD as default ref for RefLogCommand.Kevin Sawicki2011-08-172-8/+39
| |/ |/| | | | | | | | | | | This mirrors the default command-line behavior. Change-Id: I4f819410fa6df3064c560beb3184b61fd7bb1f15 Signed-off-by: Kevin Sawicki <kevin@github.com>
* | Merge "Adds DiffEntry.scan(TreeWalk, boolean) method"Matthias Sohn2011-08-175-2/+341
|\ \
| * | Adds DiffEntry.scan(TreeWalk, boolean) methodDariusz Luksza2011-08-175-2/+341
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds method into DiffEntry class that allows to specify whether changed trees are included in scanning result list. By default changed trees aren't added, but in some cases having changed tree would be useful. Also adds check for tree count in TreeWalk and when it is different from two it will thrown an IllegalArgumentException. This change is required by egit I7ddb21e7ff54333dd6d7ace3209bbcf83da2b219 Change-Id: I5a680a73e1cffa18ade3402cc86008f46c1da1f1 Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* / Fix typo in IndexDiff.getModified() comment.Kevin Sawicki2011-08-161-1/+1
|/ | | | | | | Removes an extra instance of the word 'on'. Change-Id: Ie5f137f0dda440f5879f6d5c62ebce0431530ad7 Signed-off-by: Kevin Sawicki <kevin@github.com>
* Merge "Add DiffCommand to JGit API"Christian Halstrick2011-08-163-0/+299
|\
| * Add DiffCommand to JGit APITomasz Zarna2011-08-163-0/+299
| | | | | | | | | | Bug: 334766 Change-Id: Iea74c599a956a058608e424d0274f879bc2f064a
* | Merge changes I1ca7acb4,Ia41b7a1c,I33b65286,Ie2823724,I6b65bfb4Shawn O. Pearce2011-08-1411-92/+193
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * changes: DHT: Change DhtReadher caches to be dynamic by workload DHT: Use a proper HashMap for RecentChunk lookups DHT: Always have at least one recent chunk in DhtReader DHT: Fix NPE during prefetch DHT: Drop leading hash digits from row keys
| * | DHT: Change DhtReadher caches to be dynamic by workloadShawn O. Pearce2011-06-096-54/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of fixing the prefetch queue and recent chunk queue as different sizes, allow these to share the same limit but be scaled based on the work being performed. During walks about 20% of the space will be given to the prefetcher, and the other 80% will be used by the recent chunks cache. This should improve cases where there is bad locality between chunks. During writing of a pack stream, 90-100% of the space should be made available to the prefetcher, as the prefetch plan is usually very accurate about the order chunks will be needed in. Change-Id: I1ca7acb4518e66eb9d4138fb753df38e7254704d Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | DHT: Use a proper HashMap for RecentChunk lookupsShawn O. Pearce2011-06-091-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A linear search is somewhat acceptable for only 4 recent chunks, but a HashMap based lookup would be better. The table will have 16 slots by default and given the hashCode() of ChunkKey is derived from the SHA-1 of the chunk, each chunk will fall into its own bucket within the table and thus evaluate only 1 entry during lookup instead of 4. Some users may also want to devote more memory to the recent chunks, in which case expanding this list to a longer length will help to reduce chunk faults, but would increase search time. Using a HashMap will help this code to scale to larger sizes better. Change-Id: Ia41b7a1cc69ad27b85749e3b74cbf8d0aa338044 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | DHT: Always have at least one recent chunk in DhtReaderShawn O. Pearce2011-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RecentChunks cache assumes there is always at least one recent chunk in the maxSize that it receives from the DhtReaderOptions. Ensure that is true by requiring the size to be at least 1. Running with 0 recent chunk cache is very a bad idea, often during commit walking the parents of a commit will be found on the same chunk as the commit that was just accessed. In these cases its a good idea to keep that last chunk around so the parents can be quickly accessed. Change-Id: I33b65286e8a4cbf6ef4ced28c547837f173e065d Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | DHT: Fix NPE during prefetchShawn O. Pearce2011-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Prefetcher may have loaded a chunk that is a fragment, if the DhtReader is scanning the Prefetcher's chunks for a particular object fragment chunks will be missing the index and NPE during the findOffset() call into the index itself. Change-Id: Ie2823724c289f745655076c5209acec32361a1ea Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | DHT: Drop leading hash digits from row keysShawn O. Pearce2011-06-094-27/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally I put the first two digits of the object SHA-1 into the start of a row key to try and spread the load of objects around a DHT service. Unfortunately this tends to not work as well as I had hoped. Servers reading a repository need to contact every node in a DHT cluster if the cluster tries to evenly distribute the object rows. This is a lot of connections, especially if the cluster has many backend storage servers. If the library has an open connection limit (possibly due to JVM file descriptor limitations) it may need to open and close a lot of connections to access a repository, rather than being able to reuse the same connection to a handful of backend servers. This results in a lot of connection thrashing for some DHT type databases, and is inefficient. Some DHTs are able to operate even if part of the database space is currently unavailable. For example, a DHT service might assign some section of the key space to a node, and then fail that section over to another node when the primary is noticed as being offline. During that failover period that section of the key space is not available, but other sections hosted by other backends are still ready for service. Spreading keys all over the cluster makes it likely that any single backend being temporarily down means the entire cluster is down, rather than only some. This is a massive schema change, but it should improve relability and performance for any DHT system. Change-Id: I6b65bfb4c14b6f7bd323c2bd0638b49d429245be Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Revert "PackWriter: Do not delta compress already packed objects"Shawn O. Pearce2011-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 67b064fc9fa7418fab83957b4f4e4baf9c6e08be. The "tiny optimization" introduced by 67b0 turns out to have a big savings on wall-clock time when the object store is very slow (e.g. the DHT support in JGit), but comes with a much bigger penalty in space used by the output stream. CGit packed with 67b0 enabled is 7 MiB larger than it should be (36 MiB rather than 28/29 MiB). The much bigger Linux kernel repository gained over 200 MiB, though some of this may have been caused by a smaller window setting. Revert this patch as PackWriter should be optimizing for space used rather than time spent, since its primary use is network transfer, and that isn't free. Change-Id: I7413a9ef89762208159b4a1adc5a22a4c9245611 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Speed up ObjectWalk by 6235 objects/secShawn O. Pearce2011-08-132-114/+369
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "Counting objects" phase of packing is the most time consuming part for any server providing access to Git repositories. Scanning through the entire project history, including every revision of every tree that has ever existed is expensive and takes an incredible amount of CPU time. Inline the tree parsing logic, unroll a number of loops, and setup to better handle the common case of seeing another occurrence of an object that was already marked SEEN. This change boosts the "Counting objects" phase when JGit is acting as a server and is packing the linux-2.6 repository for its client. Compared to CGit on the same hardware, a JGit daemon server is now 21883 objects/sec faster: CGit: Counted 2058062 objects in 38981 ms at 52796.54 objects/sec Counted 2058062 objects in 38920 ms at 52879.29 objects/sec Counted 2058062 objects in 39059 ms at 52691.11 objects/sec JGit (before): Counted 2058062 objects in 31529 ms at 65275.21 objects/sec Counted 2058062 objects in 30359 ms at 67790.84 objects/sec Counted 2058062 objects in 30033 ms at 68526.69 objects/sec JGit (this commit): Counted 2058062 objects in 28726 ms at 71644.57 objects/sec Counted 2058062 objects in 27652 ms at 74427.24 objects/sec Counted 2058062 objects in 27528 ms at 74762.50 objects/sec Above the first run was a "cold server". For JGit the JVM had just started up with `jgit daemon`, and for CGit we hadn't touched the repository "recently" (but it was certainly in kernel buffer cache). The second and third runs were against the running JGit JVM, allowing timing tests to better reflect the benefits of JGit's pack and index caching, as well as any optimizations the JIT may have performed. The timings are fair. CGit is opening, checking and mmap'ing both the pack and index during the timer. JGit is opening, checking and malloc+read'ing the pack and index data into its Java heap during the timer. Both processes are walking the same graph space, and are computing the "path hash" necessary to sort objects in the object table for delta compression. Since this commit only impacts the "Counting objects" phase, delta compression was obviously not included in the timings and JGit may still be performing delta compression slower than CGit, resulting in an overall slower server experience for clients. Change-Id: Ieb184bfaed8475d6960a494b1f3c870e0382164a Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Merge "PackWriter: Only search for base objects on thin packs"Shawn O. Pearce2011-08-131-13/+22
|\ \ \
| * | | PackWriter: Only search for base objects on thin packsShawn O. Pearce2011-08-081-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A non-thin pack does not need to worry about preferred bases, the pack will be self-contained and all required delta base objects will appear within the pack itself. Obtaining the path buffer and length from the ObjectWalk to build the preferred base table is "expensive", so avoid the cost unless a thin pack is being constructed. Change-Id: I16e30cd864f4189d4304e7957a7cd5bdb9e84528 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | | blame: Implement blame on the command lineShawn O. Pearce2011-08-136-0/+371
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Command line options match the C implementation of `git blame` as closely as possible, making for a pretty complete tool. Change-Id: Ie1bd172ad9de586c3b60f0ee4a77a8f047364882 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | | Merge "Ignore missing MERGE_MSG when deleting MERGE_MSG"Shawn Pearce2011-08-131-1/+1
|\ \ \ \
| * | | | Ignore missing MERGE_MSG when deleting MERGE_MSGJens Baumgart2011-07-191-1/+1
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Repository.writeMergeCommitMsg(null) no longer fails if the MERGE_MSG file is missing. This was done to avoid CommitCommand to fail in case of a missing MERGE_MSG file. Bug: 352243 Change-Id: Iddf43533d133f8f22199ed6e2393a552670e7d1f Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
* | | | Merge "Correct comment on CloneCommand.setRemote method."Shawn Pearce2011-08-131-1/+6
|\ \ \ \
| * | | | Correct comment on CloneCommand.setRemote method.Kevin Sawicki2011-08-051-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous comment stated that the value set was used to keep track of the branch in the remote repository which was incorrect. Updated the method comment to match the format used for the PushCommand.setRemote and FetchCommand.setRemote methods. Change-Id: I11b81eb3125958af29247b485da56fd88c3bfdf5 Signed-off-by: Kevin Sawicki <kevin@github.com>
* | | | | Merge "Fix jgit rev-list --objects master"Shawn O. Pearce2011-08-131-3/+5
|\ \ \ \ \ | | |_|/ / | |/| | |