summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert Ie48d6556Chris Aniszczyk2011-01-311-1/+1
| | | | | | | | | | | | | This was a mistake that was missed due to historical reasons. "The first /r/ tells our Apache to redirect the request to Gerrit. The second /r/ tells Gerrit that the thing following is a Git SHA-1 and it should try to locate the changes that use that commit object. Nothing I can easily do about it now. The second /r/ is historical and comes from Gerrit 1.x days." Change-Id: Iec2dbf5e077f29c0e0686cab11ef197ffc705012 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Fix incorrect review url in IP log fileRobert Munteanu2011-01-311-1/+1
| | | | | Change-Id: Ie48d655698dc1f4cd4f00606436a57c451c13179 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Merge changes I3a74cc84,I219f864fRobin Rosenberg2011-01-293-10/+6
|\ | | | | | | | | | | * changes: [findbugs] Do not ignore exceptional return value of createNewFile() Do not create files to be updated before checkout of DirCache entry
| * [findbugs] Do not ignore exceptional return value of createNewFile()Matthias Sohn2011-01-282-9/+6
| | | | | | | | | | | | | | Properly handle return value of java.io.File.createNewFile(). Change-Id: I3a74cc84cd126ca1a0eaccc77b2944d783ff0747 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Do not create files to be updated before checkout of DirCache entryMatthias Sohn2011-01-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | DirCacheCheckout.checkoutEntry() prepares the new file content using a temporary file and then renames it to the file to be written during checkout. For files to be updated checkout() created each file before calling checkoutEntry(). Hence renaming the temporary file always failed which was corrected in exception handling by retrying to rename the file after deleting the just newly created file. Change-Id: I219f864f2ed8d68051d7b5955d0659964fa27274 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add setCredentialsProvider to PullCommandTomasz Zarna2011-01-281-0/+17
| | | | | | | | | | | | Bug: 335703 Change-Id: Id9713a4849c772e030fca23dd64b993264f28366 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Merge "ObjectIdSubclassMap: Support duplicate additions"Chris Aniszczyk2011-01-283-5/+266
|\ \
| * | ObjectIdSubclassMap: Support duplicate additionsShawn O. Pearce2011-01-283-5/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | The new addIfAbsent() method combines get() with add(), but does it in a single step so that the common case of get() returning null for a new object can immediately insert the object into the map. Change-Id: Ib599ab4de13ad67665ccfccf3ece52ba3222bcba Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Merge "Make PullCommand work with Rebase"Chris Aniszczyk2011-01-284-51/+359
|\ \ \ | |/ / |/| |
| * | Make PullCommand work with RebaseMathias Kinzler2011-01-284-51/+359
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rebase must honor the upstream configuration branch.<branchname>.rebase Change-Id: Ic94f263d3f47b630ad75bd5412cb4741bb1109ca Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* | | Merge "RebaseCommand: detect and handle fast-forward properly"Chris Aniszczyk2011-01-283-7/+139
|\| |
| * | RebaseCommand: detect and handle fast-forward properlyMathias Kinzler2011-01-283-7/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug was hidden by an incomplete test: the current Rebase implementation using the "git rebase -i" pattern does not work correctly if fast-forwarding is involved. The reason for this is that the log command does not return any commits in this case. In addition, a check for already merged commits was introduced to avoid spurious conflicts. Change-Id: Ib9898fe0f982fa08e41f1dca9452c43de715fdb6 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* | | Revert "Teach PackWriter how to reuse an existing object list"Shawn O. Pearce2011-01-283-271/+21
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f5fe2dca3cb9f57891e1a4b18832fcc158d0c490. I regret adding this feature to the public API. Caches aren't always the best idea, as they require work to maintain. Here the cache is redundant information that must be computed, and when it grows stale must be removed. The redundant information takes up more disk space, about the same size as the pack-*.idx files are. For the linux-2.6 repository, that's more than 40 MB for a 400 MB repository. So the cache is a 10% increase in disk usage. The entire point of this cache is to improve PackWriter performance, and only PackWriter performance, and only when sending an initial clone to a new client. There may be better ways to optimize this, and until we have a solid solution, we shouldn't be using a separate cache in JGit.
* / TransportHttp wrongly uses JDK 6 constructor of IOExceptionMathias Kinzler2011-01-281-2/+2
|/ | | | | | | | IOException constructor taking Exception as parameter is new for JDK 6. Change-Id: Iec349fc7be9e9fbaeb53841894883c47a98a7b29 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* [findbugs] Do not ignore exceptional return value of mkdirMatthias Sohn2011-01-2823-82/+96
| | | | | | | | | java.io.File.mkdir() and mkdirs() report failure as an exceptional return value false. Fix the code which silently ignored this exceptional return value. Change-Id: I41244f4b9d66176e68e2c07e2329cf08492f8619 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Teach PackWriter how to reuse an existing object listShawn O. Pearce2011-01-273-21/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Counting the objects needed for packing is the most expensive part of an UploadPack request that has no uninteresting objects (otherwise known as an initial clone). During this phase the PackWriter is enumerating the entire set of objects in this repository, so they can be sent to the client for their new clone. Allow the ObjectReader (and therefore the underlying storage system) to keep a cached list of all reachable objects from a small number of points in the project's history. If one of those points is reached during enumeration of the commit graph, most objects are obtained from the cached list instead of direct traversal. PackWriter uses the list by discarding the current object lists and restarting a traversal from all refs but marking the object list name as uninteresting. This allows PackWriter to enumerate all objects that are more recent than the list creation, or that were on side branches that the list does not include. However, ObjectWalk tags all of the trees and commits within the list commit as UNINTERESTING, which would normally cause PackWriter to construct a thin pack that excludes these objects. To avoid that, addObject() was refactored to allow this list-based enumeration to always include an object, even if it has been tagged UNINTERESTING by the ObjectWalk. This implies the list-based enumeration may only be used for initial clones, where all objects are being sent. The UNINTERESTING labeling occurs because StartGenerator always enables the BoundaryGenerator if the walker is an ObjectWalk and a commit was marked UNINTERESTING, even if RevSort.BOUNDARY was not enabled. This is the default reasonable behavior for an ObjectWalk, but isn't desired here in PackWriter with the list-based enumeration. Rather than trying to change all of this behavior, PackWriter works around it. Because the list name commit's immediate files and trees were all enumerated before the list enumeration itself starts (and are also within the list itself) PackWriter runs the risk of adding the same objects to its ObjectIdSubclassMap twice. Since this breaks the internal map data structure (and also may cause the object to transmit twice), PackWriter needs to use a new "added" RevFlag to track whether or not an object has been put into the outgoing list yet. Change-Id: Ie99ed4d969a6bb20cc2528ac6b8fb91043cee071 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Allow ObjectReuseAsIs to resort objects during writingShawn O. Pearce2011-01-272-3/+6
| | | | | | | | | | | | | It can be very handy for the implementation to resort the object list based on data locality, improving prefetch in the operating system's buffer cache. Export the list to the implementation was a proper List, and document that its mutable and OK to be modified. The only caller in PackWriter is already OK with these rules. Change-Id: I3f51cf4388898917b2be36670587a5aee902ff10 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* PackWriter: Use TOPO order only for incremental packsShawn O. Pearce2011-01-271-1/+4
| | | | | | | | | | | | | | | | | When performing an initial clone of a repository there are no uninteresting commits, and the resulting pack will be completely self-contained. Therefore PackWriter does not need to honor C Git standard TOPO ordering as described in JGit commit ba984ba2e0a ("Fix checkReferencedIsReachable to use correct base list"). Switching to COMMIT_TIME_DESC when there are no uninteresting commits allows the "Counting objects" phase to emit progress earlier, as the RevWalk will not buffer the commit list. When TOPO is set the RevWalk enumerates all commits first, before outputing any for PackWriter to mark progress updates from. Change-Id: If2b6a9903b536c7fb3c45f85d0a67ff6c6e66f22 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Remove getObjectsDirectory, openPack from base APIShawn O. Pearce2011-01-271-18/+0
| | | | | | | | | | | These two methods are specific to the FileRepository implementation and should not be exposed as part of the base Repository API. Now that PackParser is generic and does not require these two methods to import a pack stream into a repostiory, it is safe to remove these and get them out of the public view. Change-Id: I8990004d08074657f467849dabfdaa7e6674e69a Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Merge "Support for self signed certificate (HTTPS)"Shawn Pearce2011-01-271-1/+47
|\
| * Support for self signed certificate (HTTPS)Per Salomonsson2011-01-261-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add possibility to disable ssl verification, just as i can do with git using: git config --global http.sslVerify false To enable the feature, configure Window->Preferences->Team->Git->Configuration and add a new key/value: http.sslVerify=false When handling repos over https, JGit will then check that flag to see if security is loose and the ssl verification should be ignored. Having it implemented as a key/value makes it not too obvious in the GUI - so the user must know what he/she is doing when adding it. Being aware of the risks etc. Bug: 332487 Change-Id: I2a1b8098b5890bf512b8dbe07da41036c0fc9b72 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Hard reset should not report conflict on untracked fileMatthias Sohn2011-01-272-8/+7
| | | | | | | | | | | | | | | | | | | | | | This problem surfaced since EGit Core ResetOperationTest is failing since change I26806d21. JGit detected checkout conflict for untracked files which never were tracked by the repository. "git reset --hard" in c git also doesn't remove such untracked files. Change-Id: Icc8e1c548ecf6ed48bd2979c81eeb6f578d347bd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Rename PlotWalk.getTags() to getRefs()Roberto Tyley2011-01-261-2/+2
| | | | | | | | | | Change-Id: I170685e70d9ac09a010df69d26ec1c38bde60174 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Provide access to the Refs of a PlotCommitRoberto Tyley2011-01-261-0/+23
| | | | | | | | | | | | | | | | This information is generally useful - have followed the accessor pattern of 'children' and 'parents' Change-Id: I79b3ddd6f390152aa49e6b7a4c72a4aca0d6bc72 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Fix tests broken by fix for adding files in a network shareRobin Rosenberg2011-01-261-1/+2
| | | | | | | | | | | | | | | | | | | | The change Ie0350e032a97e0d09626d6143c5c692873a5f6a2 was not done properly. The renamed file was not write protected, and this broke a test. Bug: 335388 Change-Id: I41b2235b7677bc5fddc70dda2a56cdd2cb53ce5d Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | FetchCommand: allow to set "TagOpt"Mathias Kinzler2011-01-261-0/+16
| | | | | | | | | | | | | | This is needed for implementing Fetch in EGit using the API. Change-Id: Ibdcc95906ef0f93e3798ae20d4de353fb394f2e2 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* | Make sure not to overwrite untracked not-ignored filesChristian Halstrick2011-01-263-12/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When DirCacheCheckout was checking out it was silently overwriting untracked files. This is only ok if the files are also ignored. Untracked and not ignored files should not be overwritten. This fix adds checks for this situation. Because this change in the behaviour also broke tests which expected that a checkout will overwrite untracked files (PullCommandTest) these tests have to be modified also. Bug: 333093 Change-Id: I26806d2108ceb64c51abaa877e11b584bf527fc9 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Fixed several NPEs in the Fetch CLISasa Zivkov2011-01-261-5/+10
| | | | | | | | | | | | | | | | | | | | The Fetch command line was failing with NPE in case some options were omitted. Additionally, it was setting a negative timeout when no timeout option was used which caused HttpURLConnection to throw an IllegalArgumentException. Change-Id: I2c67e2e1a03044284d183d73f0b82bb7ff79de95 Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Fixed NLS in JGit command line interfaceSasa Zivkov2011-01-261-2/+2
| | | | | | | | | | | | | | | | | | | | There was one place where the parameter substitution wasn't done which caused text fragments like "{0}" to appear in JGits output. Bug: 325025 Change-Id: I89b881a8b5ef39f609437546310463ed4f6e1fb5 Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Fix adding files in a network shareRobin Rosenberg2011-01-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | We cannot always rename read-only files on network shares, so rename the temp file for a new loose object first, and then set it as read-only. Bug: 335388 Change-Id: Ie0350e032a97e0d09626d6143c5c692873a5f6a2 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Merge "Refactor and comment complicated if statements"Chris Aniszczyk2011-01-261-8/+35
|\ \
| * | Refactor and comment complicated if statementsChristian Halstrick2011-01-261-8/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging and enhancing DirCacheCheckout.processEntry() I found that some of if-statements where hard to read/understand. This change just splits some long if statements and adds more comments explaining in which state we are. This change is only a preparation for followup commits which introduce checks for untracked+ignored files. Change-Id: I670ff08310b72c858709b9e395f0aebb4b290a56 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* | | Merge "MergeCommand should create missing branches"Chris Aniszczyk2011-01-261-2/+25
|\| |
| * | MergeCommand should create missing branchesChristian Halstrick2011-01-261-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If HEAD exists but points to an not-existing branch the merge command should silently create the missing branch and check it out. This happens if you pull into freshly initalized repo. HEAD points to refs/heads/master but refs/heads/master doesn't exist. If you know merge a commit X into HEAD then the branch master should be created (pointing to X) the working tree should be updated to reflect X. That is achieved by checkout with one tree only (HEAD is missing). A test for this functionality will come the the next proposal in PullCommandTest. Change-Id: Id4a0d56d944e0acebd4b3157428bb50bd3fdd872 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* | | Merge "Make setCredentialsProvider more convenient to use"Chris Aniszczyk2011-01-262-2/+10
|\ \ \
| * | | Make setCredentialsProvider more convenient to useMathias Kinzler2011-01-262-2/+10
| |/ / | | | | | | | | | | | | Change-Id: I984836ea7d6a67fd2d1d05f270afa7c29f30971c Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* / / Remove unneeded interface from test classChristian Halstrick2011-01-261-12/+0
|/ / | | | | | | | | Change-Id: Ia876fda0d4cf91b5326d48014e88503de93a1f38 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* | Permit disabling birthday attack checks in PackParserShawn O. Pearce2011-01-251-11/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reading a repository for millions of missing objects might be very expensive to perform, especially if the repository is on a network filesystem or some other costly RPC backend. A repository owner might choose to accept some risk in return for better performance, so allow disabling collision checking when receiving a pack. Currently there is no way for an end-user to disable this feature. This is intentional, because it is generally *NOT* a good idea to skip this check. Instead this feature is supplied for storage implementations to bypass the default checking logic, should they have their own custom routines that is just as effective but can be handled more efficiently. Change-Id: I90c801bb40e86412209de0c43e294a28f6a767a5 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Ensure all deltas were resolved in a packShawn O. Pearce2011-01-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a pack uses OFS_DELTA only (e.g. its an initial push to a repository) and PackParser's implementation is broken such that the delta chain that hangs below a particular object offset is empty, the entryCount won't match the expected objectCount. Fail fast rather than claiming the stream was parsed correctly. The current implementation is not broken as described above. I broke the code when I implemented my own new subclass of PackParser (which incorrectly mucked with the object offset information), leading me to discover this consistency check was missing. Change-Id: I07540f0ae1144ef6f3bda48774dbdefb8876e1d3 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Refactor IndexPack to not require local filesystemShawn O. Pearce2011-01-2519-1506/+2224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By moving the logic that parses a pack stream from the network (or a bundle) into a type that can be constructed by an ObjectInserter, repository implementations have a chance to inject their own logic for storing object data received into the destination repository. The API isn't completely generic yet, there are still quite a few assumptions that the PackParser subclass is storing the data onto the local filesystem as a single file. But its about the simplest split of IndexPack I can come up with without completely ripping the code apart. Change-Id: I5b167c9cc6d7a7c56d0197c62c0fd0036a83ec6c Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Parse RevCommit bodies before calling RevFilter.include()Jesse Greenwald2011-01-252-1/+120
| | | | | | | | | | | | | | | | | | | | RevFilter.include()'s documentation promises the RevCommit's body is parsed before include is invoked. This wasn't always true if the commit was parsed once, had its body discarded, the RevWalk was reset() and started a new traversal. Change-Id: Ie5cafde09ae870712b165d8a97a2c9daf90b1dbd Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Allow to set a CredentialsProvider on relevant API commandsMathias Kinzler2011-01-252-0/+22
| | | | | | | | | | | | | | | | This is needed for commands that use Transport internally. Change-Id: I9417c85255b160723968c647063b9c7e05995ea4 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Exposed the constructor of Note classSasa Zivkov2011-01-256-67/+83
|/ | | | | | | | | | | | | | | Additionally, defined the NoteMap.getNote method which returns a Note instance. These changes were necessary to enable implementation of the NoteMerger interface (the merge method needs to instantiate a Note) and to enable direct use of NoteMerger which expects instances of Note class as its paramters. Implementing creation of code review summary notes in Gerrit [1] will make use of both of these features. [1] https://review.source.android.com/#change,20045 Change-Id: I627aefcedcd3434deecd63fa1d3e90e303b385ac Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Merge "Build http.server source JAR"Chris Aniszczyk2011-01-211-0/+20
|\
| * Build http.server source JARShawn O. Pearce2011-01-201-0/+20
| | | | | | | | | | Change-Id: I459de081fd518abfa50dd812c68eed4d1c7f8a0b Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Introduce metaData compare between working tree and index entriesChristian Halstrick2011-01-213-32/+81
| | | | | | | | | | | | | | | | | | | | | | Instead of offering only a high-level isModified() method a new method compareMetadata() is introduced which compares a working tree entry and a index entry by looking at metadata only. Some use-cases (e.g. computing the content-id in idBuffer()) may use this new method instead of isModified(). Change-Id: I4de7501d159889fbac5ae6951f4fef8340461b47 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Add progress reporting to IndexDiffRobin Rosenberg2011-01-211-1/+94
| | | | | | | | | | | | Change-Id: I4f05bdb0c58b039bd379341a6093f06a2cdfec6e Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Fix misc spelling errors in comments and method namesRobin Rosenberg2011-01-174-17/+17
| | | | | | | | | | Change-Id: I24552443710075856540696717ac4068dfe6a7f2 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | Merge "File utility for creating a new empty file"Matthias Sohn2011-01-164-0/+40
|\ \ | |/ |/|
| * File utility for creating a new empty fileMatthias Sohn2011-01-144-0/+40
| | | | | | | | | | | | | | | | | | | | The java.io.File.createNewFile() method for creating new empty files reports failure by returning false. To ease proper checking of return values provide a utility method wrapping createNewFile() throwing IOException on failure. Change-Id: I42a3dc9d8ff70af62e84de396e6a740050afa896 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>