summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Qualify post 0.10 buildsMatthias Sohn2010-12-1730-192/+192
| | | | | Change-Id: Ifcb8fdea95286779c8aea6bf4d7647e8c1c98d63 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-0.10'Matthias Sohn2010-12-1730-192/+192
|\
| * Qualify post 0.10.1 buildsstable-0.10Matthias Sohn2010-12-1730-192/+192
| | | | | | | | | | Change-Id: I320f1f739f3689daf11d532a55ae1133785aec8e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit 0.10.1v0.10.1Matthias Sohn2010-12-1730-192/+192
| | | | | | | | | | Change-Id: I4a46d35d354193e5d4f28ef7dfae75944be8ffcf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | DirCacheCheckout: fix getToBeDeleted()Mathias Kinzler2010-12-161-1/+1
| | | | | | | | | | | | | | This wrongly returns the same as getConflicts() Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com> Change-Id: Id37c625458fc5a9b3987f05b684620e24fdfe852
* | Merge "Do not rely on filemode differences in case of symbolic links"Shawn Pearce2010-12-152-9/+34
|\ \
| * | Do not rely on filemode differences in case of symbolic linksPhilipp Thun2010-12-142-9/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When checking whether a file in the working tree has been modified - WorkingTreeIterator.isModified() - we should not trust the filemode in case of symbolic links, but check the timestamp and also the content, if requested. Without this fix symlinks will always be shown in EGit as modified files on Windows systems. Change-Id: I367c807df5a7e85e828ddacff7fee7901441f187 Signed-off-by: Philipp Thun <philipp.thun@sap.com>
* | | Save StoredConfig after modificationsShawn O. Pearce2010-12-158-20/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the Config is changed, it should be saved back to its local file. This ensure that a future call to getConfig() won't wipe out the edits that were just made. Change-Id: Id46d3f85d1c9b377f63ef861b72824e1aa060eee Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Reduce calls to Repository.getConfigShawn O. Pearce2010-12-157-24/+32
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each time getConfig() is called on FileRepository, it checks the last modified time of both ~/.gitconfig and $GIT_DIR?config. If $GIT_DIR/config appears to have been modified, it is read back in from disk and the current config is wiped out. When mutating a configuration file, this may cause in-memory edits to disappear. To avoid that callers need to avoid calling getConfig until after the configuration has been saved to disk. Unfortunately the API is still horribly broken. Configuration should be modified only while a lock is held on the configuration file, very similar to the way a ref is updated via its locking protocol. But our existing API is really broken for that so we'll have to defer cleaning up the edit path for a future change. Change-Id: I5888dd97bac20ddf60456c81ffc1eb8df04ef410 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Support GIT_SSH=tortoiseplinkShawn O. Pearce2010-12-151-1/+1
| | | | | | | | | | | | | | | | | | The tortoiseplink command does not understand -batch, even though it smells like the putty plink command that does use it. Don't add -batch if GIT_SSH is tortoiseplink. Change-Id: I638532a02faa2caf8c39d482094e7ff4f4ec7e78 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Correct plink -batch optionShawn O. Pearce2010-12-151-1/+1
| | | | | | | | | | | | | | | | | | When GIT_SSH is set to use plink, the correct option name is "-batch" and not "--batch". This was a typo introduced when we added support for plink via GIT_SSH. Change-Id: I391660e38f5d208bba11e3f2a8f25922de2af878 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Remove remaining uses of FileWriterShawn O. Pearce2010-12-132-20/+6
| | | | | | | | | | | | | | | | | | FileWriter uses the platform default encoding, which might not be UTF-8. JGit prefers UTF-8 everywhere for string encodings, so make the unit tests more predictable by ensuring use of UTF-8. Change-Id: I75bb9f962ee230b73ca3a942bffd7a8a28674ba5 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Simplify NoteParser use of prefix.length()Shawn O. Pearce2010-12-131-9/+9
| | | | | | | | | | | | | | | | | | | | Sasa pointed out we only ever use the length here, so instead of holding onto the AbbreviatedObjectId, lets just hold onto the length as a primitive int. Change-Id: I2444f59f9fe5ddcaea4a3537d3f1064736ae3215 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> CC: Sasa Zivkov <zivkov@gmail.com>
* | Fix HTTP digest authenticationShawn O. Pearce2010-12-131-16/+52
|/ | | | | | | | | | | | | JGit's internal implementation of the HTTP digest authentication method wasn't conforming to RFC 2617 (HTTP Authentication: Basic and Digest Access Authentication), resulting in authentication failures when connecting to a digest protected site. The code now more accurately matches section 3.2.2 (The Authorization Request Header) from the standards document. Change-Id: If41b5c2cbdd59ddd6b2dea143f325e42cd58c395 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* File utilities for creating directoriesMatthias Sohn2010-12-134-5/+166
| | | | | | | | | | | | | | The java.io.File methods for creating directories report failure by returning false. To ease proper checking of return values provide utility methods wrapping mkdir() and mkdirs() which throw IOException on failure. Also fix the tests to store test data under a trash folder and cleanup after test. Change-Id: I09c7f9909caf7e25feabda9d31e21ce154e7fcd5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* DiffFormatter: Use IndexDiffFilter to speed up working treeShawn O. Pearce2010-12-101-15/+27
| | | | | | | | | If DiffFormatter is asked to compare the index to the working tree, it can go faster by using the cached stat information to compare the two entries rather than relying on SHA-1 computation alone. Change-Id: Icb21c15b8279ee8cee382e5e179e0cf8903aee4d Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Rebase: abort on unknown/unsupported command in git-rebase-todoMathias Kinzler2010-12-102-4/+20
| | | | | | | | | | | | | This is needed to ensure interoperability with the command line: if the git-rebase-todo file was created manually (by git rebase -i in the command line), and any commands other than pick are used (reword, edit, fixup, squash) JGit must abort as it does not understand these commands yet. The same is true if an unknown command is found (e.g. due to a typo); this is the same behavior as shown by the command line. Change-Id: I2322014f69460361f7fc09da223e8a5c31f100dd Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* Merge "IndexPack: Remove blob-streaming size threshold"Shawn Pearce2010-12-092-9/+1
|\
| * IndexPack: Remove blob-streaming size thresholdroberto2010-12-092-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always use streaming (for SHA-checksum & collision detection) when indexing whole blobs, regardless of their size. Positives: * benefits of bugfix #312868 will apply to all runtimes, without additional conf for mem-constrained JVMs (5MB huge for some) * no byte array allocation (re-uses readBuffer instead of allocating new full-size array) * mildly better overall performance (given the usual blob-does-not-need-collision-checking case) * removes unnecessary code Negative: * doubles the disk IO for a blob comparision (comparitively rare occurance) I perf-tested a range of threshold sizes against a random selection of packfiles I found on my harddrive, the results are here: https://spreadsheets.google.com/ccc?key=tLCQElyyd2RKN9QevfvgwGQ&hl=en_GB#gid=1 My interpretation of the results is that the streaming size threshold isn't beneficial (actually seems to be very slightly detrimental) -so we should just get rid of it. This tallies with some of the comments Shawn & I had for the default value of streamFileThreshold in the review for I862afd4c: http://egit.eclipse.org/r/#patch,sidebyside,2040,2,org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java The perf-test code is here: https://gist.github.com/735402 It's a bit scruffy but basically does 10 runs (in randomised order) for each threshold size on various packfiles, waiting a second between each pack-indexing to allow GC to catch up. I know it's not perfect - proper perf testing is hard to do :-)
* | Merge "Add option to skip deletion of non-existing files"Chris Aniszczyk2010-12-092-0/+103
|\ \
| * | Add option to skip deletion of non-existing filesMatthias Sohn2010-12-102-0/+103
| | | | | | | | | | | | | | | | | | | | | For convenience provide an option to skip deletion of non-existing files. Also add some tests for deletion methods in FileUtils. Change-Id: I33e355cfcdc19367d50208150ee49a4a06394890 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Add further unit tests for IndexDiffFilter"Chris Aniszczyk2010-12-091-22/+519
|\ \ \
| * | | Add further unit tests for IndexDiffFilterPhilipp Thun2010-12-091-22/+519
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change contains a bunch of unit tests for the newly introduced IndexDiffFilter. With these tests the code coverage of IndexDiffFilter.include() is now 100%, i.e. every special case is tested at least once. Change-Id: Ib248d1cd16084f9c8e099006af151814c63c5941 Signed-off-by: Philipp Thun <philipp.thun@sap.com>
* | | | Merge "Simplify logic in StrategySimpleTwoWayInCore"Chris Aniszczyk2010-12-091-7/+3
|\ \ \ \ | |_|/ / |/| | |
| * | | Simplify logic in StrategySimpleTwoWayInCoreShawn O. Pearce2010-12-091-7/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Sasa and I were reviewing this code today and Sasa pointed out we can simplify the conflict logic, as the two cases (subtree and file) are logically identical. Change-Id: Ie0d40b2dd15605785eff453a846b1d20a2d021fc Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Reviewed-by: Sasa Zivkov <zivkov@gmail.com>
* / / Rebase: fix wrong update if original HEAD after Merge+SkipMathias Kinzler2010-12-092-16/+66
|/ / | | | | | | | | | | | | | | | | | | Rebase would update the original HEAD to the wrong commit when "skipping" the last commit after a merged commit. Includes a test for the specific situation. Change-Id: I087314b1834a3f11a4561f04ca5c21411d54d993 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* | Add a performance optimized variant of the ANY_DIFF filterChristian Halstrick2010-12-094-3/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a treewalk walks also over index and the workingtree then the IndexDiffFilter filter can be used which works much faster then the semantically equivalent ANY_DIFF filter. This is because this filter can better avoid computing SHA-1 ids over the content of working-tree files which is very costly. This fix will significantly improve the performance of e.g. EGit's commit dialog. Change-Id: I2a51816f4ed9df2900c6307a54cd09f50004266f Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Philipp Thun <philipp.thun@sap.com>
* | Implement rebase --continue and --skipMathias Kinzler2010-12-095-143/+728
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For --continue, the Rebase command asserts that there are no unmerged paths in the current repository. Then it checks if a commit is needed. If yes, the commit message and author are taken from the author_script and message files, respectively, and a commit is performed before the next step is applied. For --skip, the workspace is reset to the current HEAD before applying the next step. Includes some tests and a refactoring that extracts Strings in the code into constants. Change-Id: I72d9968535727046e737ec20e23239fe79976179 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com> Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* | JGit Build: use jetty 7.1.6Jens Baumgart2010-12-093-19/+27
| | | | | | | | | | | | | | Jetty 7.1.6 is used because this version is also available in P2. Change-Id: I410fbca8592cac6e58c651c4d086573820e777a5 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
* | IndexDiff: Remove unnecessary changesExist flagShawn O. Pearce2010-12-081-8/+7
| | | | | | | | | | | | | | | | | | Instead of setting a boolean when a difference record is found, return false from diff() only if all of the collections are empty. When all of them are empty, no difference was found. Change-Id: I555fef37adb764ce253481751071c53ad12cf416 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | IndexDiff: Use isModified() when comparing index-worktreeShawn O. Pearce2010-12-082-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | The isModified() is more efficient because it can skip over files that are stat clean, without needing to scan them. This is useful to efficently work on paths that were already staged and thus differ between HEAD and the index, but not between the index and the working tree. Change-Id: I4418202e612f0571974e0898050d987c6c280966 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | IndexDiff: Clean up tree-index compare for staged filesShawn O. Pearce2010-12-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When comparing the ObjectIds for two tree entries its faster to use the raw buffer compares over allocating ObjectIds and then performing equals on their contents. However, this also needs to consider the raw modes. It is possible for a path to change modes but not ObjectId (e.g. making a file executable), and in this case its still a staged change to report back to the caller. Change-Id: I1a267254c04b3273a97f63c71d1e6718cd9d2fa8 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | IndexDiff: Fix getAssumeUnchanged()Shawn O. Pearce2010-12-081-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | If the caller really needs the list of files that are flagged as assume-unchanged (aka assume-valid in the DirCache), we should give them the complete list and not just those that we wrongly identified as being modified during diff(). This change is necessary because diff() is slightly broken and is discovering differences on files that it shouldn't have considered. Change-Id: Ibe464c1a0e51c19dc287a4bc5348b7b07f4d840b Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | IndexDiff: Correct Javadoc for getUntracked() methodShawn O. Pearce2010-12-081-1/+1
| | | | | | | | | | Change-Id: I5f26c40dec5f0e4a47413af033dbedb0c252dd20 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | IndexDiff: Remove always true not-subtree checkShawn O. Pearce2010-12-081-7/+4
| | | | | | | | | | | | | | | | | | The TreeWalk is configured to be recursive, which means subtrees are never presented to the application. Therefore the working tree file mode can never be a subtree/subdirectory at this point in the code. Change-Id: Ie842ddc147957d09205c0d2ce87b25c566862fd9 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | IndexDiff: Always use TreeWalk.getPathString()Shawn O. Pearce2010-12-081-9/+8
| | | | | | | | | | | | | | | | | | Instead of asking the individual iterators for their path string, use the TreeWalk's generic getPathString() method. Its just as fast because it uses the path of the current matching iterator. Change-Id: I9b827fbbafce1c78f09d5527cdc64fbe9022a16e Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | IndexDiff: Simplify allocation of filter listShawn O. Pearce2010-12-081-2/+1
| | | | | | | | | | | | | | | | | | We add either 3 or 4 filters. If we are adding only 3 filters, allocating the array for 4 isn't a huge waste of memory, but it does simplify our code. Change-Id: I7df29b414f6d5cfcf533edb1405083e6fcec32cf Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Clarify WorkingTreeOptions and filemode usageShawn O. Pearce2010-12-0810-123/+51
|/ | | | | | | | | | | | | | | | | | | | | | To improve runtime performance, caching the WorkingTreeOptions inside of the Config object using the Config.SectionParser API allows the WorkingTreeOptions to be accessed more efficiently whenever a FileTreeIterator is constructed for the Repository. Instead of passing the filemode handling option into isModified(), the WorkingTreeIterator should always honor whatever setting has been configured in this repository, as defined by its own copy of the WorkingTreeOptions. This simplifies all of the callers as they no longer need to lookup core.filemode on their own. A few locations were changed from always using a hardcoded "true" on the file mode to passing what is actually configured in the repository. This is a behavior change, but corrects what should be considered to be bugs as the core.filemode variable wasn't always being used. Change-Id: Idb176736fa0dc97af372f1d652a94ecc72fb457c Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* IndexPack: Use streaming for large whole blobsShawn O. Pearce2010-12-082-6/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | When indexing large blobs that are stored whole (non-delta form), avoid allocating the entire blob in memory and instead stream it through the SHA-1 checksum computation. This reduces the size of memory required by IndexPack when processing very big blobs, such as a 500 MiB uncompressable binary. If the large blob already exists in the local repository, its contents needs to be compared byte-for-byte after the entire pack has been indexed, to ensure there isn't an unexpected SHA-1 collision which may result in later data corruption. This compare is performed as a streaming compare, again avoiding the large object allocation. This change doesn't improve on memory utilization for large objects stored as deltas. The change also doesn't improve handling for any large commits, trees or annotated tags. There isn't much to be done here for those objects, because they need to be passed down to the ObjectChecker as a byte[]. Fortunately it isn't common for these object types to be that large, Bug: 312868 Change-Id: I862afd4cb78013ee033d4ec68c067b1774a05be8 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com> CC: Roberto Tyley <roberto.tyley@guardian.co.uk>
* Merge "Refactor IndexPack to use InputStream for inflation"Chris Aniszczyk2010-12-081-59/+122
|\
| * Refactor IndexPack to use InputStream for inflationShawn O. Pearce2010-12-071-59/+122
| | | | | | | | | | | | | | | | | | | | | | By inflating with an InputStream like API, it is possible to stream through large objects rather than allocating the entire thing as a byte[]. This change only refactors the inflation code within IndexPack to use a streaming interface. Change-Id: I5a84b486901c2cf63fa6a3306dd5fb5c53b4056b Signed-off-by: Shawn O. Pearce <spearce@spearce.org> CC: Roberto Tyley <roberto.tyley@guardian.co.uk>
* | Removed unread parametersChristian Halstrick2010-12-083-28/+20
| | | | | | | | | | | | | | | | | | | | Some method parameters in WorkingTreeIterator are never used. Remove them. Especially the removal of the FS parameter in isModified() simplifies upcoming performance optimizations. Change-Id: I7c449589283a4a6b6e23f2586cd784febdca8bcd Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Introduce http test bundleJens Baumgart2010-12-0832-59/+810
| | | | | | | | | | | | | | | | | | | | Introduce a http test bundle to make this functionality available for EGit tests. A simple http server class is provided. The jetty version was updated to a version that is also available via p2 (needed in EGit UI tests). Change-Id: I13bfc4c6c47e27d8f97d3e9752347d6d23e553d4 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Remove empty iterator from TreeWalkShawn O. Pearce2010-12-0721-36/+12
|/ | | | | | | | | | | | | | | | | Its confusing that a new TreeWalk() needs to have reset() invoked on it before addTree(). This is a historical accident caused by how TreeWalk was abused within ObjectWalk. Drop the initial empty tree from the TreeWalk and thus remove a number of pointless reset() operations from unit tests and some of the internal JGit code. Existing application code which is still calling reset() will simply be incurring a few unnecessary field assignments, but they should consider cleaning up their code in the future. Change-Id: I434e94ffa43491019e7dff52ca420a4d2245f48b Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* [findbugs] Do not ignore exceptional return valueMatthias Sohn2010-12-0722-57/+79
| | | | | | | | | | java.io.File.delete() reports failure as an exceptional return value false. Fix the code which silently ignored this exceptional return value. Also remove some duplicate deletion helper methods. Change-Id: I80ed20ca1f07a2bc6e779957a4ad0c713789c5be Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Provide file utilities for file deletionMatthias Sohn2010-12-073-1/+133
| | | | | | | | | | | Provide file helper methods in a reusable utility class to replace many local implementations. java.io.File has some methods reporting failure by returning false. We prefer to throw IOException on failure so that callers can't forget checking the return value. Change-Id: I430c77b5d2cffcf8b47584326ad4817a7291845e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Clean up Init API"Chris Aniszczyk2010-12-071-13/+13
|\
| * Clean up Init APIChris Aniszczyk2010-12-071-13/+13
| | | | | | | | | | | | | | Static accessors should come before a constructor. Change-Id: Iee1051ce4f2038f19a08741e7a3a33f06a97a3c0 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Avoid NPE in InitChris Aniszczyk2010-12-071-2/+5
|/ | | | | | | | We should grab the repository directory from the command to avoid an NPE if no git directory is passed in via the CLI. Change-Id: I649467c6d84bbc0d26a070d0d4ff1e6f81fd5bad Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Merge "Rebase Interoperability third part: handle stop upon conflict"Chris Aniszczyk2010-12-071-1/+26
|\