aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "Remove two "Dead store to local variable" warnings"Shawn Pearce2010-10-292-2/+1
|\ \
| * | Remove two "Dead store to local variable" warningsRobin Stocker2010-10-292-2/+1
| |/ | | | | | | Change-Id: I950de82db15c4610dc5a94f304279971daef971e
* | Merge "Use entrySet() instead of keySet()"Shawn Pearce2010-10-291-2/+3
|\ \
| * | Use entrySet() instead of keySet()Robin Stocker2010-10-291-2/+3
| |/ | | | | | | | | | | | | The value was accessed every time in the loop body with get(), so use the more efficient entrySet(). Change-Id: I91d90cbd0b0d03ca4a3db986c58b8d80d80f40a4
* | Merge "Use readFully() instead of read()"Shawn Pearce2010-10-291-1/+1
|\ \
| * | Use readFully() instead of read()Robin Stocker2010-10-291-1/+1
| |/ | | | | | | | | | | | | | | | | | | Fixes the "Method ignores results of InputStream.read()" warning. This is the only place where read() was used instead of readFully() and the return value was not checked. So it was either an oversight or should be documented. This change assumes it was an oversight. Change-Id: I859404a7d80449c538a552427787f3e57d7c92b4
* | Merge "Use Character.valueOf instead of new Character"Shawn Pearce2010-10-291-1/+1
|\ \
| * | Use Character.valueOf instead of new CharacterRobin Stocker2010-10-291-1/+1
| |/ | | | | | | | | | | | | Otherwise a new Character is allocated each time instead of using the cache. Change-Id: I648d0b012f66ba9dc46a37a390986f9c61e5a19c
* | Merge "Remove unnecessary null check"Shawn Pearce2010-10-291-2/+1
|\ \
| * | Remove unnecessary null checkRobin Stocker2010-10-291-2/+1
| |/ | | | | | | | | | | | | The field monitor is never null, it's a NullProgressMonitor when not explicitly set. Change-Id: I8ce703a32c28ce5c3455efeb7ed5f5c9a443cbef
* / Make private final field staticRobin Stocker2010-10-291-1/+1
|/ | | | | | It's used as a constant. Change-Id: Ic267e8cb5b62228de15e134cd80725df592a0171
* Merge "Fix Severe Bug in Merge Algorithm"Shawn Pearce2010-10-282-8/+30
|\
| * Fix Severe Bug in Merge AlgorithmChristian Halstrick2010-10-282-8/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described in Bug 328551 there was a bug that the merge algorithm was not always reporting conflicts when the same line was deleted and modified. This problem was introduced during commit 0c017188b4d41cc80c297e35097095026734b3d4 when reported conflicts have been checked for common pre- and suffixes. This was fixed here by better determining whether after stripping off common prefixes and suffixes from a conflicting region there is still some conflicting part left. I also added a unit test to test this situation. Bug: 328551 Change-Id: Iec6c9055d00e5049938484a27ab98dda2577afc4 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* | PullCommand: support upstream configuration for local branchesMathias Kinzler2010-10-284-33/+91
| | | | | | | | | | | | | | | | | | | | When creating a local branch based on another local branch, the upstream configuration contains "." as origin and the source branch as "merge". The PullCommand should support this by skipping the fetch step altogether and use the base branch to merge with. Change-Id: I260a1771aeeffca5b0161d1494fd63c672ecc2a6 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* | Merge "Fix FQCN of moved classes in FindBugsExcludeFilter.xml"Shawn Pearce2010-10-281-2/+2
|\ \
| * | Fix FQCN of moved classes in FindBugsExcludeFilter.xmlRobin Stocker2010-10-281-2/+2
| | | | | | | | | | | | | | | | | | | | | FindBugs would generate warnings for these even though they should be ignored. Change-Id: Ieccadbf11fd55853541c04857d8e79a4db014cb4
* | | Merge "Make AbbreviatedObjectId serializable"Shawn Pearce2010-10-281-1/+4
|\ \ \
| * | | Make AbbreviatedObjectId serializableRobin Stocker2010-10-281-1/+4
| |/ / | | | | | | | | | | | | | | | | | | AmbiguousObjectException contains an AbbreviatedObjectId and is supposed to be serializable, so it should be serializable as well. Change-Id: I8056e78aee20fdd3cb9600b52cd8ed988544293d
* | | Merge "Fix oddness check in MyersDiff for negative numbers"Shawn Pearce2010-10-281-3/+3
|\ \ \
| * | | Fix oddness check in MyersDiff for negative numbersRobin Stocker2010-10-281-3/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | It's probably not possible that these numbers are negative in the algorithm, but it's cleaner this way and gets rid of three more FindBugs warnings. Change-Id: Ifbce4e2c787fb9a7cd309c605e8d86211ef8a352
* / / Fix FindBugs and Eclipse warnings in org.eclipse.jgit.uiRobin Stocker2010-10-284-3/+13
|/ / | | | | | | Change-Id: Ie6b3ff7d470cc9b7044fd6288cbf86dcc58220eb
* | Merge "Call ProgressMonitor.update() from main thread"Shawn O. Pearce2010-10-274-36/+299
|\ \
| * | Call ProgressMonitor.update() from main threadShawn O. Pearce2010-10-274-36/+299
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't permit transient worker threads to access the underlying output stream of a ProgressMonitor, as they might get marked as the stream's writer thread. Instead proxy update events from the workers back onto the application's real work thread. This ensures that the stream only sees a single thread, and its the thread that will remain alive for the entire life cycle of the operation. This fixes IOException("Write end dead") during local repository fetch when threaded delta search is enabled. One of the transient delta search threads became the designated writer for the pipe, and when it terminated the reader end thought the writer was dead, even though the main writer thread was still executing in PackWriter. Bug: 326557 Change-Id: I01d1b20a3d7be1c0b480c7fb5c9773c161fe5c15 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Prevent endless loop of events fired by RefsDirectoryChristian Halstrick2010-10-271-0/+7
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RefsDirectory fires a RefsChangedEvent when it detect that one ref changed (new, modified, deleted). But there was a potential of wrong events beeing fired leading to a endless loop in EGit. Problem is that when calling getRefs(ALL) we don't want to report additional refs and by that we remove the additional refs from the list of "refs reported upwards last time". We fire an RefsChangedEvent because we think that the special refs are not there anymore. I fixed this by removing eventing for the additional refs. Another alternative would be to always scan also for additional refs and put them in the list of refs. But getRefs(ALL) would then remove the additional refs again. I didn't do that for performance reasons and also because I am not sure whether we want evnting for additional refs. Change-Id: Icb9398b55a8c6bbf03e38f6670feb67754ce91e0 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* | Optimize DirCacheCheckoutLluis Sanchez2010-10-261-2/+7
| | | | | | | | | | | | | | | | When checking out a tree, files that are identical to the file in the current index and working directory don't need to be updated. Change-Id: I9e025a53facd42410796eae821baaeff684a25c5 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Add option to select diff algorithm for diff commandChristian Halstrick2010-10-262-0/+19
| | | | | | | | | | | | | | | | The diff command in the pgm package was enhanced to allow choosing the diff algorithm (currently myers or histogram) Change-Id: I72083e78fb5c92868eb5d8ec512277d212a39349 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* | Merge "[findbugs] Respect exclude filter in maven build"Shawn Pearce2010-10-251-0/+1
|\ \
| * | [findbugs] Respect exclude filter in maven buildMatthias Sohn2010-10-231-0/+1
| | | | | | | | | | | | | | | Change-Id: Ic29310dc14f120ebdb49d33cbf4bd6d380ae1393 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Allow setting a filter in IndexDiff"Christian Halstrick2010-10-251-4/+21
|\ \ \
| * | | Allow setting a filter in IndexDiffJens Baumgart2010-10-251-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IndexDiff now allows to set an additional filter. This can be used e.g. for restricting the tree walk to a given set of files. Change-Id: I642de17e74b997fa0c5878c90631f6640ed70bdd Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
* | | | Add support for special symref FETCH_HEAD and MERGE_HEADChristian Halstrick2010-10-253-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RefDirectory class was not returning FETCH_HEAD and MERGE_HEAD when trying to get all refs via getRefs(RefDatabase.ALL). This fix adds constants for FETCH_HEAD and ORIG_HEAD and adds a new getter getAdditionalRefs() to get these additional refs. To be compatible with c git the getRefs(ALL) method will not return FETCH_HEAD, MERGE_HEAD and ORIG_HEAD. Change-Id: Ie114ca92e9d5e7d61d892f4413ade65acdc08c32 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* | | | [findbugs] Fix illegal format specifierMatthias Sohn2010-10-231-1/+1
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | For integral arguments the precision is not applicable, would cause a runtime exception when executed, see http://download.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html#syntax Change-Id: I4738c64c1153a8d4ef5430e15d0fe54f0a37949f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | [findbugs] Static comparator made finalMatthias Sohn2010-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | Fixing FindBugs warning MS_SHOULD_BE_FINAL. Change-Id: Ic69e6f6425e0a8950ce809eb3894f48a33e860aa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Add FindBugs and CPD to the build.Chris Aniszczyk2010-10-235-1/+158
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to use findbugs-maven-plugin:2.3.2-SNAPSHOT since otherwise build fails with maven-3.0 [1], [2]. We should switch to the release version as soon as this becomes available. [1] http://www.sonatype.com/people/2010/10/maven-3-0-has-landed/ [2] http://jira.codehaus.org/browse/MFINDBUGS-122 Bug: 327799 Change-Id: I1c57f81cf6f0450e56411881488c4ee754e458e3 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Make ObjectDirectory getPacks() work the first timeShawn O. Pearce2010-10-201-1/+4
| | | | | | | | | | | | | | | | | | | | If an object hasn't been accessed yet the pack list for a repository may not have been scanned from disk. If an application (e.g. the dumb transport servlet support code) asks for the pack list for an ObjectDirectory, we should load it immediately. Change-Id: I93d7b1bca422d905948e8e83b2afa83c8894a68b Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Update CachedObjectDirectory when inserting objectsShawn O. Pearce2010-10-174-15/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an ObjectInserter is created from a CachedObjectDirectory, we need to ensure the cache is updated whenever a new loose object is actually added to the loose objects directory, otherwise a future read from an ObjectReader on the CachedObjectDirectory might not be able to open the newly created object. We mostly had the infrastructure in place to implement this due to the injection of unpacked large deltas, but we didn't have a way to pass the ObjectId from ObjectDirectoryInserter to CachedObjectDirectory, because the inserter was using the underlying ObjectDirectory and not the CachedObjectDirectory. Redirecting to CachedObjectDirectory ensures the cache is updated. Change-Id: I1f7bdfacc7ad77ebdb885f655e549cc570652225 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | IndexPack: Make translated progress messages non-staticShawn O. Pearce2010-10-171-8/+3
| | | | | | | | | | | | | | | | These messages may need to change depending on the current thread's configured locale, and thus cannot be static. Change-Id: I96751a63852ec9c4bf6c47edadcf8752700543df Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Merge "Allow pgm Main to be extended"Matthias Sohn2010-10-171-21/+51
|\ \
| * | Allow pgm Main to be extendedShawn O. Pearce2010-10-161-21/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3rd party packages that use repository types other than FileRepository may wish to extend our pgm package and implement their own resolution scheme for repository "names" that are passed in by the --git-dir command line option. Make that possible by allowing the package to extend the Main class and override the lookup. This is primarily useful when developing new storage implementations and trying to experiment with the results, without linking all of it into the core JGit package. Change-Id: Id30e168da16341e5da43365688a63aa30c7b7e2c Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Fix possible NPE in DirCacheCheckoutChristian Halstrick2010-10-181-4/+7
|/ / | | | | | | | | | | | | | | | | There was a chance that we hit a NPE which doing a checkout with DirCacheCheckout when there is no HEAD (e.g. initial checkout). This is fixed here. Change-Id: Ie3b8cae21dcd90ba8352823ea94a700f8ee9221a Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* / Add Cherry-Pick commandChristian Halstrick2010-10-156-0/+403
|/ | | | | | | | | | | Implemented the initial version of a cherry-pick command. A correct error handling is missing (what happens if the checkout fails, the cherry-pick leads to conflicts etc). But straightforward cherry-picks works. Change-Id: I235c0eb3a7a2d5bdfe40400f1deed06f29d746e1 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add getString utility functions to RawTextShawn O. Pearce2010-10-131-2/+63
| | | | | | | | | | | These routines can be useful when debugging, because we can add an expression to the Eclipse "Expressions" panel to show the text that appears on a line. Gerrit Code Review also uses these in its own subclass of RawText in order to format patch files, so pulling it up to be part of core JGit may help other applications too. Change-Id: I20a6b112e3403ecfc1c2715ae75dcecc1a85b167 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Remove dead RawText(RawTextComparator) constructorShawn O. Pearce2010-10-135-31/+16
| | | | | | | | | | Since the introduction of HashedSequence we no longer need to supply the RawTextComparator at the time of constructing a RawText. Drop the definition from the constructor, because it doesn't make sense as part of our public API. Change-Id: Iaab34611d60eee4a2036830142b089b2dae81842 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Fix RawTextComparator reduceCommonStartEnd at empty linesShawn O. Pearce2010-10-132-0/+27
| | | | | | | | | | | | | | | | | When an empty line was inserted at the beginning of the common end part of a RawText the comparator incorrectly considered it to be common, which meant the DiffAlgorithm would later not even have it be part of the region it examines. This would cause JGit to skip a line of insertion, which later confused Gerrit Code Review when it tried to match up the pre and post RawText files for a difference that had this type of insertion. Define two new unit tests to check for this insertion of a blank line condition and correct for it by removing the LF from the common region when the condition is detected. Change-Id: I2108570eb2929803b9a56f9fb9c400c758e7156b Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Correct spelling of tests in HistogramDiffTestShawn O. Pearce2010-10-131-2/+2
| | | | | Change-Id: I003b601f384ff1213da6750dd13846367a511d0b Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Fix three-word command namesShawn O. Pearce2010-10-141-0/+1
| | | | | | | | | | | | Command names like MakeCacheTree weren't coming up with hyphens between every word, so they read "debug-make-cachetree" rather than the expected "debug-make-cache-tree". On each lowercase character reset the lastWasDash flag so the next uppercase will insert a hyphen before the next word. Change-Id: I539fabb339e60896165619c307dec71e3317b0d8 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Generate correct version for jgit source bundleMatthias Sohn2010-10-133-35/+59
| | | | | | | | | | | | | The maven 2 build for jgit source bundle didn't create a correct OSGi version string, instead of org.eclipse.jgit.source_0.10.0.<timestamp> the generated OSGi version was org.eclipse.jgit.source_0.10.0.SNAPSHOT This caused trouble when trying to install it from p2 repository. Bug: 327616 Change-Id: Ic27c763ae9a4bcbb5bd6ed9562cd98bb4da3386b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Rename method to ResolveMerger.setWorkingTreeIterator()Christian Halstrick2010-10-132-8/+8
| | | | | | | renamed an ugly methodname Change-Id: I26bda06ef64b8644fd3a555dc55dff43cdb56a71 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* DeleteBranchCommand does not clean up upstream configurationMathias Kinzler2010-10-122-8/+25
| | | | | | | | It wrongly uses the full name of the branch to remove the configuration entries but must use the shortened one. Change-Id: Ie386a128a6c6beccc20bafd15c2e36254c5f560d Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* Merge "Update Tag to use TagCommand API"Shawn Pearce2010-10-121-55/+11
|\