Commit Graph

9718 Commits

Author SHA1 Message Date
Robin Rosenberg d80569955e Don't crash if we try to load the config for a MockSystemReader
Instead do nothing.  For now, save() will fail and the config
file is set to null, which may surprise some calling tests.

Change-Id: I1c65f8b1131569da01b4ef33678d813565521fbb
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-12-21 16:36:53 -08:00
Igor Fedorenko 53f3632f60 Use Tycho version 0.6.0
Changed Tycho version from 0.6.0-SNAPSHOT to 0.6.0 (i.e. release).
SNAPSHOT versions are transient and should only be used for testing
purposes only. Also removed now unnecessary <pluginRepositories/>
element from JGit parent pom.xml file.

Change-Id: Ie386b2dbcba43c1ccec10465978d12d6829c6150
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2009-12-20 20:46:28 +01:00
Mykola Nikishov 21b6f3434e Method to get a 'humanish' name from a path
Change-Id: Iec0688232bd59d4626111d77633109918e8e1df3
Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2009-12-19 00:47:06 +01:00
Mykola Nikishov f8f75f8a52 Ignore target/ folder and compile.org.eclipse.jgit.xml
target/ is for Maven build output
compile.org.eclipse.jgit.xml is generated on Export - Deployable Features

Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I557a95792fd45c3cfe37098e057c1e70660b3308
2009-12-12 21:26:58 +01:00
Igor Fedorenko 96c7f75fad Flipped jgit.core to manifest-first maven-3/tycho build
Change-Id: I6005134a45046d16e323a2f9b2815831cdbe15e0
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
2009-12-08 13:23:50 +01:00
Mykola Nikishov 7eef835ad5 Replace a hard-coded default remote's name with a constant
Change-Id: I4e369382b8a83a5c0772462d1b176b1e23910ada
2009-11-29 19:31:01 +02:00
Shawn O. Pearce 6f06be9bc2 tools/version.sh: Update embedded version numbers in build products
We can now use `tools/version.sh --release` to update the MANIFEST.MF
and Maven POM files with the current version number of this project,
so they appear in any build product created.

The counterpart --snapshot option be used to reset files to use
their natural *-SNAPSHOT and *.qualifier state during development.

We use a simple Bourne shell script with Perl calls because we
must edit both Maven pom.xml and OSGi bundle MANIFEST.MF in order
to store the correct data for our parallel build systems.  In the
future we should use a native Java solution which relies upon JGit
to compute the `git describe` portion.

Until we tag our first official release a "tagged snapshot" can be
made by creating an artifical annotated tag first:

  git tag -a -m "initial contribution" v0.5.1 046198cf5f21e5a63e8ec0ecde2ef3fe21db2eae
  tools/version.sh --release

Resulting in a version string like "0.5.1.50-ge16af83".

Change-Id: Ic2bbae75bf96fc8831324c62c2212131277f70e4
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-17 10:25:14 -08:00
Christian Halstrick b0772d7a5c Add performance tests for MyersDiff
Add some tests which make sure that the diff algorithm really behaves in the
promised O(N*D) manner. This tests compute diffs between multiple big chunks
of data, measure time for computing the diffs and fail if the measured times
are off O(N*D) by more than a factor 10

Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Change-Id: I8e1e0be60299472828718371b231f1d8a9dc21a7
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2009-11-05 00:27:21 +01:00
Shawn O. Pearce ddefff9875 Use a more specific Bugzilla URL
This URL filters the search results within the entire Eclipse.org
Bugzilla server to only this that are open and pertain to our
project.  It also sets up the "File a new bug" link to send any
new issue in our direction.

Change-Id: I5d50a2e7d0b34efb386492aedfe28f4ae67f92bc
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-04 08:57:44 -08:00
Shawn O. Pearce 8e901f44a0 Use JUnit 3.8.2 under CQ 3589
CQ 3589 was submitted to request permission to use JUnit 3.8.2
from Orbit.  We don't redistribute JUnit but we compile against it
and do redistribute a test support JAR (org.eclipse.jgit.junit)
that would depend upon it if someone were to develop their own
application code and also wish to write unit tests with JUnit.

Change-Id: I23b1f23e064224363585ec2f5dd62a0b4d28fb5b
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-04 08:32:50 -08:00
Matthias Sohn f3f6745e79 Remove reference to branding plugin
JGit does not contribute to the Eclipse UI hence it should not refer
to a branding plugin. See discussion on egit-dev :
http://dev.eclipse.org/mhonarc/lists/egit-dev/msg00304.html until
http://dev.eclipse.org/mhonarc/lists/egit-dev/msg00306.html

Change-Id: I9153dea60d9d1724662ca079f16528a36c295b5d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2009-11-04 01:53:09 +01:00
Code Review 9f9ea04350 Merge changes I057c782c,Idff096ce,Ic9be0280,I07014d1b,Id8a76ee7,I9080f3dd,I8c1a0eb8,Ibaf87bb5,I9e1f1f5a,I355e95fa
* changes:
  Prompt for passwords from the console in jgit command line tools
  Move AWT based SSH authenticator to ui bundle
  Refactor the cached Authenticator data out of AwtAuthenticator
  Only import the sample data packs on tests that need them
  Move T0007_Index to exttst
  Refactor RepositoryTestCase to use LocalDiskRepository instead
  Create JUnit test utilities for JGit derived sources
  Delete obsolete JarLinkUtil
  Refactor our Maven build to be modular
  Switch pgm, test to proper plugin projects
2009-11-03 14:33:09 -05:00
Code Review 2bfe561f26 Merge change Ic1c8969b
* changes:
  Use org.eclipse.egit branding plugin
2009-11-03 14:19:30 -05:00
Shawn O. Pearce 7e8dc53881 Prompt for passwords from the console in jgit command line tools
If we are on a Java 6 JVM we should have the Console class available,
unless the user has redirected /dev/null to stdin.  When there is a
console present we would prefer to use that for command line prompts
as that is what the user expects from a command line tool.

Change-Id: Ibaf87bb5540371d94d96d1b7e94ca002f752e5bd
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-02 17:55:55 -08:00
Shawn O. Pearce 27a497f83e Move AWT based SSH authenticator to ui bundle
This way SWT based applications don't wind up loading this AWT
based code when using SSH.

Change-Id: I9080f3dd029c2a087e6b687480018997cc5c5d23
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-02 17:55:55 -08:00
Shawn O. Pearce 9108035763 Refactor the cached Authenticator data out of AwtAuthenticator
This makes it easier to swap out authenticator implementations and
yet still rely upon being able to configure at least one Authenticator
instance in the JVM and program it with data obtained from outside
of the user interface.

Change-Id: I8c1a0eb8acee1d306f4c3b40a790b7fa0c3abb70
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-02 17:55:52 -08:00
Shawn O. Pearce e336bad367 Only import the sample data packs on tests that need them
Not all of our test cases really require the sample data packs,
and we are better off not using them because its hard to see exactly
what condition a test is testing when looking only at the Java code.
Clarify the dependency by only making the packs available when
there is a real need for it.

Change-Id: Id8a76ee7ee1f7efba585be4bed19a8fb5b3b3585
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-02 17:53:58 -08:00
Shawn O. Pearce b28aadf10f Move T0007_Index to exttst
This test depends upon the external git binary, and this isn't
really a pure Java test like our module tries to claim itself is.
So we move it out to exttst with other tests that require additional
external resources and/or executable code.

Change-Id: Ic9be0280c8bb50a5768336c64de794eb0a492b3d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-02 17:53:58 -08:00
Shawn O. Pearce 1e84e8ad93 Refactor RepositoryTestCase to use LocalDiskRepository instead
Change-Id: I07014d1b8cc2fab0761d644a12e4ae04f0adf3ef
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-02 17:53:58 -08:00
Shawn O. Pearce 49aac32500 Create JUnit test utilities for JGit derived sources
The LocalDiskRepositoryTestCase class is derived from the current
RepositoryTestCase code and is meant for application (or our own)
tests to subclass and access temporary repositories on the local
client disk.

Change-Id: Idff096cea40a7b2b56a90fb5de179ba61ea3a0eb
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-02 17:53:58 -08:00
Shawn O. Pearce a95198580f Delete obsolete JarLinkUtil
Since we are now using the maven-shade-plugin to flatten out our
dependencies into a single stand-alone JAR we no longer need to
use our own command line utility.

Change-Id: I057c782cc66c44f11ed2ff2b4b4ca9cc82c7426a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-02 17:53:58 -08:00
Shawn O. Pearce dad52baae8 Refactor our Maven build to be modular
Drop our simple and stupid jgit.sh and instead rely upon Maven
for the command line based build.  Maven is relatively simple to
download and install, and doesn't require the entire Eclipse IDE.

To avoid too much refactoring of the current code we reuse the
existing src/ directory within each plugin, and treat each of
the existing OSGI bundles as one Maven artifact.

The command line wrapper jgit.sh no longer works in the uncompiled
state, as we don't know where to obtain our JSch or args4j from.
Developers will now need to compile it with `mvn package`, or run
our Main class from within an IDE which has the proper classpath.

Bug: 291265
Change-Id: I355e95fa92fa7502651091d2b651be6917a26805
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-02 17:53:58 -08:00
Shawn O. Pearce 5b89088f87 Switch pgm, test to proper plugin projects
This way we depend upon the MANIFEST.MF to define our classpath
and our build will act more like any other OSGI bundle build.

Change-Id: I9e1f1f5a0bccb0ab0e39e49b75fb400fea446619
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-02 17:53:29 -08:00
Shawn O. Pearce e4fc3c3566 Correct location of AmazonS3 command line client
This code belongs inside of the org.eclipse.jgit.pgm bundle
so it is executable from the command line.

In af5cb5ced938 ("Move AmazonS3 command line utility to jgit-pgm")
I accidentally moved this class into the wrong directory, probably
during some sort of rebase when I tried to pull this commit out of
its original position in an abanonded Maven refactoring series.

Change-Id: I19adafa87b70586dd44040e9dfce30f3d482ed28
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-31 17:12:31 -07:00
Mykola Nikishov cf2edb6518 Move AWT UI code to new org.eclipse.jgit.ui bundle
This new UI bundle contains the org.eclipse.jgit.awtui package,
which was moved out of the org.eclipse.jgit bundle.

org.eclipse.jgit.pgm depends on org.eclipse.jgit.ui, so we need
to update the classpath and make_jgit.sh to include it.

This move takes the awtui classes out of the Maven build, which
means we are no longer able to distribute these classes to our
downstream Maven customers.  The entire Maven package structure
needs to be overhauled so that Eclipse bundle matches 1:1 with the
Maven artifact.

Bug: https://bugs.eclipse.org/291124
Change-Id: Ibf1a9968387e3d11fdce54592f710ec4cc7f1ddb
Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-31 16:35:10 -07:00
Sasa Zivkov 99ab22c474 Don't create .git/remotes folders on init
For historical reasons JGit was creating .git/remotes folder when
initialization an empty repository.  However, this folder is never
used and the new Git repository format doesn't contain them.

Removed the unnecessary remotes folder creation, it was removed from
C Git in 75c384efb52d ("Do not create $GIT_DIR/remotes/ directory
anymore") by Junio C Hamano on Dec 19 2006.  C Git hasn't made it
for almost 3 years.

Change-Id: I5473f3676a3642afdf9aaac44b7e6319c6e170b9
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-31 16:13:30 -07:00
Robin Rosenberg d4e7b70606 Move pure IO utility functions to a utility class of its own.
According the javadoc, and implied by the name of the class, NB
is about network byte order. The purpose of moving the IO only,
and non-byte order related functions to another class is to
make it easier for new contributors to understand that they
can use these functions in general and it's also makes it easier
to understand where to put new IO related utility functions

Change-Id: I4a9f6b39d5564bc8a694b366e7ff3cc758c5181b
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-31 16:09:12 -07:00
Shawn O. Pearce fad60bddbb Eclipse IDE: Automatically remove trailing whitespace on save
Our project coding conventions do not want trailing whitespace at
the end of a source code line.  Configure Eclipse to automatically
remove them when saving any Java source file.

Change-Id: I9701366b3b1240879761b30556e6ff416e969e1d
Reviewed-by: Mykola Nikishov <mn@mn.com.ua>
Reviewed-by: Alex Blewitt <alex.blewitt@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-31 14:53:29 -07:00
Alex Blewitt 4d91645e89 Remove trailing whitespace at end of line
As discussed on the egit-dev mailing list, we prefer not to have
trailing whitespace in our source code.  Correct all currently
offending lines by trimming them.

Change-Id: I002b1d1980071084c0bc53242c8f5900970e6845
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-31 14:48:44 -07:00
Matthias Sohn f3d75800a0 Correcting explanation of EDL
Change-Id: I2f65022df4e6fe9b1db87eb29e9b079543984298
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2009-10-28 14:12:07 +01:00
Matthias Sohn 8506604542 Use org.eclipse.egit branding plugin
We do not need two branding plugins for two related features
and org.eclipse.jgit is not a branding plugin.

Change-Id: Ic1c8969bbed89f693c7e11108d6baba013f71711
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2009-10-20 01:01:44 +02:00
Mykola Nikishov 5208e50b4e Add gitignore to constants
Bug: 291133
Change-Id: I24272d029cff446ffc80063870478577d628f338
Reviewed-by: Alex Blewitt <alex.blewitt@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-16 09:35:28 -07:00
Chris Aniszczyk 1a41a89e4c Refactor org.eclipse.jgit.test to be a bundle
This way dependencies are described by the MANIFEST.MF,
and the same build tools can be used to compile the tests.

Change-Id: I4dc926148410ecbadcf71b9474aeeb509691aa32
2009-10-16 09:13:35 -07:00
Matthias Sohn 3e83a9e1df Fix classpath to use jsch and args4j from orbit
All 3rd party dependencies must come from orbit to comply
with Eclipse development process.

Change-Id: Ia43892ab6d0169f8335c1a41b37e8c12e94cafe2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2009-10-12 22:25:05 +02:00
Christian Halstrick 2484ad6fe0 Add javadoc comments, remove unused code, shift comments to correct place
This change only fixes warnings of the eclipse build regarding missing javadocs.
Some comments where just missing, so they have been added. Other comments where
at the wrong (from eclipse point of view) place, so eclipse was complaining.
Also two method which existed for debugging purposes have been removed to get
rid of Eclipse warngins about unused code.
2009-10-09 16:18:59 +02:00
Code Review 4c3f90cfaa Merge change Iacb9082e into cq-diff
* changes:
  Fixed MyersDiff to be able to handle more than 100k
2009-10-08 18:45:20 -04:00
Christian Halstrick b3e4ac2622 Fixed MyersDiff to be able to handle more than 100k
MyersDiff was crashing with ArrayIndexOutOfBoundsException when
diffing huge files. This was because the snake data (begin and
end position while processing chunks of the text) was sequeezed
into a single int. But with longer texts to diff these values
exceeded the range of java int values. It is fixed by squeezing
the two ints into a long and by adding the LongList helper
class.

Change-Id: Iacb9082e1b076e994d1486aa8e512342ad7432b3
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
2009-10-09 00:35:44 +02:00
Constantine Plotnikov 982515cf10 Make the default encoding when reading commits UTF-8
When reading commits the system default encoding was used if no
encoding was specified in the commit. The patch modifies the test
to add a check that commit message was encoded correctly (the
test fails on old implementation if system encoding is not UTF-8)
and fixes Commit.decode() method to use UTF-8 if encoding is not
specified in the commit object.

Change-Id: I27101da3c2eb6edd0c4a9e4c0523e48b286e3cd5
Signed-off-by: Constantine Plotnikov <constantine.plotnikov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-08 10:19:34 -07:00
Robin Rosenberg aa08a022f1 Remove a duplicate test from T0003_Basic
In the pre-historic commit 6d87484b4dee5671a38e64a8e4990dff40a4874f
two tests became identical. Remove one of them.

Change-Id: I6182ecd4db0162d87a5f4577005b2bf4d5e8c89f

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2009-10-07 23:45:31 +02:00
Christian Halstrick 6549af4591 Fix some warnings regarding unnecessary imports and accessing static methods
My Galileo eclipse was complaining about unneeded import statements and
how static methods have been accessed in Diff.java. There was also one method
call which could be removed because he had no sideeffects and the return value
was not used. I fixed this so that there are no warnings anymore.

Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Change-Id: I48d7e01536aab1524140d72af574e3fd7149cd23
2009-10-07 15:13:18 +02:00
Johannes Schindelin a3aa43ecb1 Add the "jgit diff" command
This commit contains fixes provided by Christian Halstrick.

Bug: 291083
Eclipse-CQ: 3559
Change-Id: If8d187e70a51f31040f99098489e513791dc6415
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-06 07:43:29 -07:00
Johannes Schindelin e34865b88b Prepare RawText for diff-index and diff-files
Bug: 291083
Eclipse-CQ: 3559
Change-Id: Ia02f346a96b5f1e24f8bc9676bd428b968a41222
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-06 07:43:25 -07:00
Johannes Schindelin 1a03c864a6 Add a test class for Myers' diff algorithm
Bug: 291083
Eclipse-CQ: 3559
Change-Id: I5a10946637438052e7596489b9f9de3a0c6b2066
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-06 07:43:21 -07:00
Johannes Schindelin d8a3b4eb31 Add Myers' algorithm to generate diff scripts
Myers' algorithm is the standard way to generate diff scripts in
an efficient manner (especially memory-wise).

The source contains extensive documentation about the principal
ideas of the algorithm.

Bug: 291083
Eclipse-CQ: 3559
Change-Id: Id873e7c2c204692cb4a1a05d24b733154b9ed49c
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-06 07:43:16 -07:00
Johannes Schindelin 9c056fcace Add set to IntList
Some applications may wish to modify an int list.

Bug: 291083
Eclipse-CQ: 3559
Change-Id: Iea871443ec661230aec92397229f1eda6c74216f
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-06 07:42:49 -07:00
Code Review 6e1571d5b9 Merge changes I282ee1c6,I5700ca48,Ic243544a,Ia2cce34d,I2fd81be2
* changes:
  Move HttpSupport's configureHttpProxy to jgit-pgm
  Move AmazonS3 command line utility to jgit-pgm
  Move setupReflog test function to only test that cares
  Remove useless test005_todopack test
  Standardize the source code formatter for Eclipse
2009-10-05 17:29:56 -04:00
Shawn O. Pearce 9b48eb940a Mark JGit plugin as 0.6
Our project plan calls for us to build 0.6 as the next version,
but I forgot to also update the MANIFEST.MF for the plugin when
I edited the Maven pom.

Change-Id: Ic1a6c64374a4384a65a3dd0306adddfc73adac52
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-05 14:17:16 -07:00
Mykola Nikishov 956b12403d Add org.eclipse.jgit-feature
[sp: Externalized all strings for translation]

Change-Id: Ib3f6e58e9e1cbcbc41705b6e1be37a89ca38f1a9
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-05 14:03:08 -07:00
Shawn O. Pearce 41e4b2fed4 Move HttpSupport's configureHttpProxy to jgit-pgm
This is the last chunk of code in jgit-core which references the awtui
package.  Moving it to the only consumer in jgit-pgm allows us to move
the awtui package over to the jgit-awtui module.

Change-Id: I2fd81be2076117b2f2c5f8ed45de7f29272af6cf
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-05 12:17:11 -07:00
Shawn O. Pearce 8d5510d51c Move AmazonS3 command line utility to jgit-pgm
This removes one of the few remaining dependencies on AWTAuthenticator
from the core library.  For the most part the interface is identical to
the prior main method.  The jgit-pgm Main class already sets up the
HTTP proxy and authenticator for us, so we don't need to do that in
our new run method.

Change-Id: Ia2cce34d34c97b88214a8bd8f2cc542845e19032
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-05 12:17:11 -07:00