aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Handle the tilde notation (~user) of git urlRobin Rosenberg2010-07-152-0/+50
| | | | | | | | | When the path is prefixed with ~ the URI parser thought about this as /~. Strip the / if the next character is the tilde. Bug: 307017 Change-Id: I58203e5617956b46d83e8987d1f8042beddffac3 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Merge changes I104cd62f,I1d0238b4Shawn Pearce2010-07-133-11/+30
|\ | | | | | | | | | | * changes: Internationalize RepositoryState descriptions Say that commit is allowed during bisect
| * Internationalize RepositoryState descriptionsRobin Rosenberg2010-07-103-9/+28
| | | | | | | | | | Change-Id: I104cd62f3e89acf010b1d40a2b08e7f68f63bb85 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
| * Say that commit is allowed during bisectRobin Rosenberg2010-07-101-2/+2
| | | | | | | | | | | | | | C Git allows this and it is quite handy. Change-Id: I1d0238b43fca931ad2079649fb7b431e2815c351 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | Fix ReadTreeTestChristian Halstrick2010-07-131-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After refactoring ReadTreeTest the tests failed for filesystems with coarse modification time granularity. This is fixed by explicitly telling the repo to reread the index after we build a new index. Additionally the test testDirectoryFileSimple was simplified by using buildTree() instead of misusing GitIndex to construct trees. Change-Id: I20d2f097491e4cc8c657a696beabc7026b485017 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add compatibility with gitignore specificationsCharley Wang2010-07-1321-3/+1616
|/ | | | | | | | | | | | | | | This patch adds ignore compatibility to jgit. It encompasses exclude files as well as .gitignore. Uses TreeWalk and FileTreeIterator to find nodes and parses .gitignore files when required. The patch includes a simple cache that can be used to save results and avoid excessive gitignore parsing. CQ: 4302 Bug: 303925 Change-Id: Iebd7e5bb534accca4bf00d25bbc1f561d7cad11b Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com> Signed-off-by: Stefan Lay <stefan.lay@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Allow ReadTreeTest to test arbitrary Checkouts"Christian Halstrick2010-07-092-117/+244
|\
| * Allow ReadTreeTest to test arbitrary CheckoutsChristian Halstrick2010-07-092-117/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ReadTreeTest was hardcoded to test WorkDirCheckout. Since we want alternative checkout implementations (especially DirCacheCheckout) this class has been refactored so that the tests can be reused to test other implementations The following changes have been done: - abstract methods for checkout and prescanTwoTrees have been introduced. Parameters are only the two trees. As index we will implicitly use the current index of the repo. - whenever tests needed a manipulated index before checkout and prescanTwoTrees it was ensured that the correct index was persisted (before we could use not-persisted instantiations of GitIndex passed as parameters to checkout, prescanTwoTrees - abstract methods for getting updated, conflicting, removed entries resulting from the last checkout, prescanTwoTrees have been introduced - an implementation for all these abstract methods using WorkDirCheckout has been added - method to assert a certain state of the index and the working tree has been added Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Change-Id: Icf177cf8043487169a32ddd72b6f8f9246a433f7
* | Add support for updateNeeded flag in DirCacheEntryMatthias Sohn2010-07-091-0/+22
|/ | | | | Change-Id: If06ff41d9ccd422afbc79ecbc3cfdf8bb2508dcd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix javadoc typos in JGit APIStefan Lay2010-07-083-7/+7
| | | | | | | There were some small errors which made it difficult to read the JavaDoc. Change-Id: Ib3b34353465162adebaca3514d596d0edf5aea51 Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* Deprecate all of the older Tree related codeShawn O. Pearce2010-07-0721-7/+152
| | | | | | | | | We want to get rid of these APIs, because they don't perform as well as DirCache/TreeWalk, or don't offer nearly as many features. Bug: 319145 Change-Id: I2b28f9cddc36482e1ad42d53e86e9d6461ba3bfc Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Fix comparison of nanosecondsStefan Lay2010-07-061-1/+1
| | | | | | | | NB.decodeInt32(info, base + 4) already returns nanoseconds. Therefore it must not be divided by 1000000. Change-Id: Ie8f5c4a03f984d98935dccedc2b1ba4457094899 Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* Clean up LICENSE fileShawn O. Pearce2010-07-022-41/+78
| | | | | | | | | | | | | | | We used our LICENSE file to describe both the license of the package, and also the header template that should appear at the start of all Java files we create. This creates a confusing situation for readers who just want to consume the package, because our file header template starts off in the middle of a sentence. Move our template header to a separate file, and reformat the text of the license to be something more readable by a person reviewing the project's terms of use. Change-Id: If318e64c06683ea14e0240914c2d057c9199ce98 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Fix missing flush in StreamCopyThreadDmitry Neverov2010-06-301-14/+12
| | | | | | | | | | | | | | | | | | | | It is possible that StreamCopyThread will not flush everything from it's src to it's dst. In most cases StreamCopyThread works like this: in loop: n = src.read(buf); dst.write(buf, 0, n); and when we want to flush, we interrupt() StreamCopyThread and it flushes everything it wrote to dst. The problem is that our interrupt() could interrupt reading. In this case we will flush everything we wrote to dst, but not everything we wrote to src. Change-Id: Ifaf4d8be87535c7364dd59b217dfc631460018ff Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Added check for binary files while diffingJeff Schumacher2010-06-292-6/+38
| | | | | | | | | Added a check in Diff to ensure that files that are most likely not text are not line-by-line diffed. Files are determined to be binary by checking the first 8000 bytes for a null character. This is a similar heuristic to what C Git uses. Change-Id: I2b6f05674c88d89b3f549a5db483f850f7f46c26
* Merge "Update build to use Tycho 0.9.0"Matthias Sohn2010-06-291-1/+1
|\
| * Update build to use Tycho 0.9.0Matthias Sohn2010-06-291-1/+1
| | | | | | | | | | Change-Id: I589267e6cfd0514383c2a3da51c9b7a659f77844 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge changes Ie56301aa,Ic2f79e85Shawn Pearce2010-06-2811-2/+1103
|\ \ | |/ |/| | | | | | | * changes: Added further support for whitespace ignoring during diff Added support for whitespace ignoring
| * Added further support for whitespace ignoring during diffJeff Schumacher2010-06-287-2/+663
| | | | | | | | | | | | | | | | | | Added code to support ignoring leading, trailing, and changed whitespace when performing a diff operation. I also added command line options to Diff to enable the various whitespace ignoring methods. These match the flags for git diff. Change-Id: Ie56301aafad59ee3f0fe5de62719f5023cd702c8
| * Added support for whitespace ignoringJeff Schumacher2010-06-284-0/+440
| | | | | | | | | | | | | | | | | | | | | | | | | | JGit did not have support for skipping whitespace when comparing lines in RawText objects. I added a subclass of RawText that skips whitespace in its equals and hashCode methods. I used a subclass rather than adding functionality into RawText so that performance would not be impacted by extra logic. This class only supports ignoring all whitespace. Others will follow that allow other forms of whitespace ignoring. Change-Id: Ic2f79e85215e48d3fd53ec1b4ad13373dd183a4a
* | UploadPack: Avoid unnecessary flush in smart HTTPShawn O. Pearce2010-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Under smart HTTP the biDirectionalPipe flag is false, and we return back immediately at this point in the negotiation process. There is no need to flush the stream to the client, the request is over and it will be automatically flushed out by the higher level servlet that invoked us. Avoiding flush here allows us to only use flush after a progress message is sent during pack generation. Change-Id: Id0c8b7e95e3be6ca4c1b479e096bed6b0283b828 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Add MutableObjectId.copyFrom(AnyObjectId)Shawn O. Pearce2010-06-232-10/+16
| | | | | | | | | | | | | | | | | | | | | | This simplifies the PackIndex code, which is trying to quickly copy an existing ObjectId into a MutableObjectId. Rather than having the PackIndex violate the ObjectId's internals, expose a copy from function similar to the other ones for copying from raw byte arrays or hex formatted strings. Change-Id: I142635cbece54af2ab83c58477961ce925dc8255 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Expose AnyObjectId compareTo(byte[]) and compareTo(int[])Shawn O. Pearce2010-06-231-2/+24
| | | | | | | | | | | | | | | | | | | | Storage systems can use these implementations to compare a passed AnyObjectId with a stored representation of an ObjectId in the canonical network byte order format. This can be useful to do a binary search, or just linear scan, over an encoded storage file. Change-Id: I8c72993c4f4c6e98d599ac2c9867453752f25fd2 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Expose RefWriter constructor taking RefListShawn O. Pearce2010-06-231-2/+7
| | | | | | | | | | | | | | | | | | An implementation might prefer to use the RefList type here, and RefList is part of our public API. Expose the constructor so callers who have a RefList can take advantage of the existing sorting. Change-Id: I545867f85aa2c479d2d610024ebbe318144709c8 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Expose RefUpdate constructor to any subclassShawn O. Pearce2010-06-231-1/+10
| | | | | | | | | | | | | | | | | | | | | | When we finally move RefDirectory to the new storage.file package, its associated RefDirectoryUpdate will need visiblity to this constructor in order to initialize itself. This is true of any other repository implementation, so make it protected rather than package level visible. Change-Id: If838aec9baeb80ee2f12dcbca717657c725a9242 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Expose repository change event constructorsShawn O. Pearce2010-06-232-2/+14
| | | | | | | | | | | | | | | | | | | | | | Repository implementations outside of .lib need to be able to create these events and deliver them to listening application code. Expose and document the constructors so that they are visible when we move FileRepository into storage.file.FileRepository. Change-Id: I7fb6e8f4f5fdab683c5ebb5267673aa6d5b560bb Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | isValidRefName: Inline the forbidden ref suffix of ".lock"Shawn O. Pearce2010-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Git reference name must never end with ".lock", as it would confuse any existing C client that tries to obtain a clone of the repository over the network. Even if the repository isn't on a local filesystem, it still should ban that suffix. Because I plan to move LockFile to storage.file and make it a private implementation detail of the local file system storage model, we can't rely on its package level SUFFIX field here. Making it public probably won't work long-term either, as I also plan to pull storage.file into its own separate project that depends on the core library. So, just inline the constant here. Its as foribidden as ":" is. Change-Id: If85076861baeacc183b82696375a13e935ba8836 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Remove pack stream from PackWriterTestShawn O. Pearce2010-06-231-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This stream was used only to determine how many bytes had been written thus far. Except we're always dumping it into a simple ByteArrayOutputStream, which also knows that. Drop the dependency on the pack stream and use ByteArrayOutputStream directly. This lets us later move this test into the new storage.file package without dragging along the pack stream that is an internal implementation detail of PackWriter, which is more general than just the file storage layer. Change-Id: I291689c0b1ed799270c213ee73b710b2637fb238 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Remove pointless setOldObjectId in testShawn O. Pearce2010-06-231-1/+0
| | | | | | | | | | | | | | | | | | | | Setting this value is pointless, because its automatically set by the refs.newUpdate call that created the update operation. The API is protected by default, because application level code, including this test, should not be calling it. Change-Id: I8867a4e8007892e2bd44a05d7dec619081081943 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Remove speed tests based on mapCommitShawn O. Pearce2010-06-233-301/+0
|/ | | | | | | | | | The mapCommit API is being deprecated because it doesn't run very fast. Leaving tests around to test how fast it is relative to C Git isn't instructive. Remove them, which should help aid the transition away from the mapCommit API. Change-Id: I27e1c844610d7da5b2c44b33a00602706973c9cc Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Change default target platform for maven build to galileoMatthias Sohn2010-06-191-1/+1
| | | | | | | | Starting with 0.9 we do no longer support ganymede. http://dev.eclipse.org/mhonarc/lists/egit-dev/msg01277.html Change-Id: Ibf40342f67d9706e86336748f15d10ea47278096 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Fix line endings"Shawn Pearce2010-06-1810-63/+81
|\
| * Fix line endingsMatthias Sohn2010-06-1810-63/+81
| | | | | | | | | | | | | | | | Some sources had dos line endings. Also configure all projects to use unix line endings and UTF-8 text encoding. Change-Id: I8fc9a1dbb219ffa91d1b3011b3b11b7e48e74ca7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge ""Bare" Repository should not return working directory."Shawn Pearce2010-06-165-26/+363
|\ \
| * | "Bare" Repository should not return working directory.Mathias Kinzler2010-06-165-26/+363
| |/ | | | | | | | | | | | | | | | | If a repository is "bare", it currently still returns a working directory. This conflicts with the specification of "bare"-ness. Bug: 311902 Change-Id: Ib54b31ddc80b9032e6e7bf013948bb83e12cfd88 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* / Make ObjectId, RefSpec, RemoteConfig, URIish serializableAndrew Bayer2010-06-164-6/+37
|/ | | | | | | Modifications to various classes in order to allow serialization for use of JGit in Hudson's git plugin. Change-Id: If088717d3da7483538c00a927e433a74085ae9e6
* Merge "tools/version.sh: Use backup files on Win32"Matthias Sohn2010-06-151-5/+6
|\
| * tools/version.sh: Use backup files on Win32Shawn O. Pearce2010-06-141-5/+6
| | | | | | | | | | | | | | | | | | | | Windows doesn't permit us to edit a file in-place with Perl. So create backup files when we perform the edit, and remove them when we are done. This is a tad slower on POSIX systems, but is much more portable. Change-Id: I429c7d698924cb32e709363f5da82f7232bbdab2 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Merge "Add missing @Override tags in AlternateRepositoryDatabase"Chris Aniszczyk2010-06-151-0/+3
|\ \
| * | Add missing @Override tags in AlternateRepositoryDatabaseShawn O. Pearce2010-06-141-0/+3
| |/ | | | | | | Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Allow to read configured keysMathias Kinzler2010-06-152-0/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, there is no way to read the content of the Git Configuration in a way that would allow to list all configured values generically. This change extends the Config class in such a way as to being able to get a list of sections and to get a list of names for any given section or subsection. This is required in able to implement proper configuration handling in EGit (show all the content of a given configuration similar to "git config -l"). Change-Id: Idd4bc47be18ed0e36b11be8c23c9c707159dc830 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* | Merge changes ↵Shawn Pearce2010-06-1413-57/+136
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | I53f71dc0,I3a899a3a,I3e8bd245,Ie7c9db83,If396326e,I6f4cf8da,I3bf96dd0,I3a2a43a1,I292fe88c,Ia1cf40cf * changes: git-servlet: Fix comparing uploadFactory with the wrong DISABLED instance Prefer static inner classes Override equals for SwingLane since super class PlotLane defines it Make sure a Stream is closed upon errors in IpLogGenerator Make constant static in RebuildCommitGraph Make inner classes static in http code Cache filemode in GitIndex Remove unused parent field in PlotLane Removed unused repo field in WorkDirCheckout Extend DiffFormatter API to simplify styling
| * git-servlet: Fix comparing uploadFactory with the wrong DISABLED instanceRobin Rosenberg2010-06-141-1/+1
| | | | | | | | | | Change-Id: I53f71dc0e3c68839da5ff5a2e0f3eeb8340e4793 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
| * Prefer static inner classesRobin Rosenberg2010-06-131-3/+3
| | | | | | Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
| * Override equals for SwingLane since super class PlotLane defines itRobin Rosenberg2010-06-131-0/+4
| | | | | | Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
| * Make sure a Stream is closed upon errors in IpLogGeneratorRobin Rosenberg2010-06-131-28/+32
| | | | | | Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
| * Make constant static in RebuildCommitGraphRobin Rosenberg2010-06-131-1/+1
| | | | | | Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
| * Make inner classes static in http codeRobin Rosenberg2010-06-133-3/+3
| | | | | | | | | | | | Static classes are preferrable to keep unwanted dependencies away, and they have one less member field. Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
| * Cache filemode in GitIndex Robin Rosenberg2010-06-131-1/+2
| | | | | | | | | | Apparently this was the intention, but never happened Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
| * Remove unused parent field in PlotLaneRobin Rosenberg2010-06-132-4/+0
| | | | | | Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>