Commit Graph

445 Commits

Author SHA1 Message Date
Robin Rosenberg dd3181603e Extend the FS class for Java7
The most important difference is that in Java7 we have symbolic links
and for most operations in the work tree we want to operate on the link
itself rather than the link target, which the old File methods generally
do.

We also add support for the hidden attribute, which only makes sense
on Windows and exists, just since there are claims that Files.exists
is faster the File.exists.

A new bundle is only activated when run with a Java7 execution
environment. It is implemented as a fragment.

Tycho currently has no way to conditionally include optional features
based on the java version used to run the build, this means with this
change the jgit packaging build always needs to be run using java 7.

Change-Id: I3d6580d6fa7b22f60d7e54ab236898ed44954ffd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-05-04 02:01:56 +02:00
Matthias Sohn f2d0b50e0a Fix line endings
Change-Id: I61c9c173237a535da8576a9299bfd4bb29e8f56b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-05-03 16:19:07 +02:00
Jonathan Nieder 7be5cfa4d6 ArchiveCommand: Add missing @since tag
Change-Id: I9e48a1f82b747492bebb3ca65fd16f599e425e8b
2013-04-30 15:03:08 -07:00
Robin Rosenberg 46a3863f21 Merge "Cleanup imports and javadocs in ArchiveCommand" 2013-04-27 16:38:16 -04:00
Robin Rosenberg d0727fc527 Cleanup imports and javadocs in ArchiveCommand
Change-Id: Icb1cd177e791cc646636a88c67fd9399dfc7030c
2013-04-27 15:09:32 +02:00
Jonathan Nieder e3cce3e4db Delete CLIText strings previously used in iplog generator
The only callers using these strings were removed in commit
850e5bc24e (Delete the iplog generator, 2013-01-09).

Change-Id: Ia4f81b29b8d00782ee559d69de3befc0a6c4d403
2013-04-27 09:01:57 -04:00
Robin Rosenberg 687b887c68 Merge "Make the Reflog a public API again" 2013-04-27 08:56:37 -04:00
Jonathan Nieder be047307fc ArchiveCommand: Do not warn for unsupported file mode
When ArchiveCommand is invoked directly on the command line, these
warnings to stderr

	warning: mode of path/to/some/submodule ignored

are a useful hint, but in the more usual case where an archive is
being served by a server, the intended audience for that message
cannot see stderr.

Later it might be useful to accept a callback to return these warnings
out of band.

Change-Id: I22e79be69859176d85594031d67c6cb3371c4bd2
2013-04-26 14:12:42 -07:00
Jonathan Nieder b525e696d5 Add internal porcelain-style API for ArchiveCommand
One step closer to exposing archive creation functionality in a
org.eclipse.jgit.archive bundle.

Change-Id: If0ebb2417a941d9d3fc0d3f444316d0d1c494ff3
2013-04-26 14:12:42 -07:00
Shawn Pearce 543b8560ac Merge "archive: Release resources before returning" 2013-04-26 16:06:25 -04:00
Jonathan Nieder 70e494f649 archive: Release resources before returning
The only caller exits immediately after calling execute() so this
shouldn't make a difference, but it's good practice and should make it
easier to expose the functionality in a public API later.

Change-Id: Ia6cd2ce8382f1a62e576409107fc5c9a6b321fb6
2013-04-26 12:58:34 -07:00
Robin Rosenberg 9dcd8c2c90 Make the Reflog a public API again
Change-Id: I8ced7098da5b345fd9af2fdfafd1ef6a44ccee0d
2013-04-26 00:57:17 +02:00
Robin Stocker a50ed5666f status: Print conflict description for unmerged paths
Prefix unmerged paths with conflict description (e.g. "both modified:"),
the same way C Git does.

Change-Id: I083cd191ae2ad3e2460aa4052774aed6e36c2699
2013-04-19 19:55:24 +02:00
Robin Rosenberg 526b6266a5 Remove some unnecessary dependencies on FileRepostory
Change-Id: Ib6ee3a2874a7e2240aa68f4ac32d00c4d1fab5ae
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2013-04-18 15:33:50 -05:00
Matthias Sohn aa7be667bc Make recursive merge strategy the default merge strategy
Use recursive merge as the default strategy since it can successfully
merge more cases than the resolve strategy can. This is also the default
in native Git.

Change-Id: I38fd522edb2791f15d83e99038185edb09fed8e1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-04-15 21:46:12 +02:00
Christian Halstrick 266ec24d49 Merge "clean up merge squash and no-commit messages in pgm" 2013-04-09 03:09:33 -04:00
Matthias Sohn 0182e8152e Merge changes I8445070d,I38f10d62,I2af0bf68
* changes:
  Fix plugin provider names to conform with release train requirement
  Add missing @since tags for new API methods
  DfsReaderOptions are options for a DFS stored repository
2013-04-08 17:25:01 -04:00
Matthias Sohn 011f7fd27d Fix plugin provider names to conform with release train requirement
According to release train requirements [1] the provider name for all
artifacts of Eclipse projects is "Eclipse <project name>".

[1] http://wiki.eclipse.org/Development_Resources/HOWTO/Release_Reviews#Checklist

Change-Id: I8445070d1d96896d378bfc49ed062a5e7e0f201f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-04-08 23:05:36 +02:00
Tomasz Zarna b42b50fdf5 clean up merge squash and no-commit messages in pgm
Change-Id: Iffa6e8752fbd94f3ef69f49df772be82e3da5d05
2013-04-08 09:51:00 -04:00
Robin Rosenberg 59baf9148e Detect and handle a checkout conflict during merge nicely
Report the conflicting files nicely and inform the user.

Change-Id: I75d464d4156d10c6cc6c7ce5a321e2c9fb0df375
2013-04-08 05:48:09 -04:00
Tomasz Zarna 5453585773 Add the no-commit option to MergeCommand
Added also tests and the associated option for the command line Merge
command.

Bug: 335091
Change-Id: Ie321c572284a6f64765a81674089fc408a10d059
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-04-04 15:11:49 +02:00
Robin Rosenberg 65027d8bb4 Indicate initial commit on a branch in the reflog
Bug: 393463
Change-Id: I4733d6f719bc0dc694e7a6a6ad2092de6364898c
2013-04-02 21:57:17 +02:00
Tomasz Zarna 48f30b8614 Fix @since tags in JGit, version 2.4 never existed
Change-Id: Iaca88ec28b412e6b58e7b39a0762ba54b25f9471
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-03-21 18:03:20 -04:00
Shawn Pearce f32b861243 JGit 3.0: move internal classes into an internal subpackage
This breaks all existing callers once. Applications are not supposed
to build against the internal storage API unless they can accept API
churn and make necessary updates as versions change.

Change-Id: I2ab1327c202ef2003565e1b0770a583970e432e9
2013-03-18 09:30:43 -07:00
Colby Ranger be7a135e94 Break the dependency on RevObject when creating a newObjectToPack().
Update the ObjectReuseAsIs API to support creating new
ObjectToPack with only the AnyObjectId and Git object type. This is
needed to support the future pack index bitmaps, which only contain
this information and do not want the overhead of creating a temporary
object for every ObjectId.

Change-Id: I906360b471412688bf429ecef74fd988f47875dc
2013-03-04 14:43:22 -08:00
Robin Rosenberg 6cadceee16 Must use double single quotes around parameters
Change-Id: I34da782e6b9a492e3e291b36ef82f06ce8347660
2013-02-16 10:54:52 -05:00
Robin Rosenberg 29546877b1 Add the --branch flag to the jgit clone command
--branch or -b allows the user to specify which branch to checkout after
clone.

Change-Id: Ie27533e5ecb43097862a8337a27a742b501e17a5
2013-02-16 10:38:54 -05:00
Matthias Sohn ba6ae0c7ec Prepare 2.4.0-SNAPSHOT builds
Change-Id: I4ab2baeb5d598d40d5dadfccdfe75152a1b9b7bf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-02-14 00:59:25 +01:00
Matthias Sohn da59df358b Remove unused imports
These imports are unused since commit
cb349da017

Change-Id: I74ea2a17bf4976d9c74255500e5deeff18208e87
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-02-14 00:08:46 +01:00
Jonathan Nieder cb349da017 Remove unused availableRefs local from Clone.guessHEAD
This variable has been populated and never used ever since it was
introduced in v0.4.9~336 (Add "jgit clone", 2008-12-23).  Remove it
to make the function easier to understand.

Change-Id: Idb7eb80bc236a20f7385ad2d6141b4d1c5c3f1cc
2013-02-12 16:29:24 -08:00
Matthias Sohn 850e5bc24e Delete the iplog generator
It stopped working when we moved to the Eclipse foundation's Gerrit
server since it doesn't use the Gerrit internal user store but LDAP.
Instead, since 2.0, we use the Eclipse foundation's automatic IP log
generator [1] to generate IP logs for releasing jgit and egit.

[1] http://www.eclipse.org/projects/ip_log_selector.php

Change-Id: I98dc65efb62909bc0258e6c680df0c93a57e9677
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-01-09 14:21:40 +01:00
Robin Rosenberg 9e36b173a5 pgm: Attempt to detect a broken pipe and exit silently
When piping output to another program, the other pipe may exit
before we are done. An example is "jgit log|head". The result is
that errno get set to EPIPE. Unfortunately Java does not have
specific exception for this so we have to look at the exception
message and hope that the number of variants are small.

The detection here seem to work on Windows, Linux and OS X and it
seems the message is usually not localized.

Change-Id: Id6968ea7a53ae27ba5496303f1a479e41e41fdcc
2013-01-07 01:05:10 +01:00
Robin Rosenberg a57dd1c164 Declare essentially static methods as static
Change-Id: I83ca25fb569c0dbc36eb374d5437fcf2b65a6f68
2012-12-27 12:08:06 -05:00
Robin Rosenberg c310fa0c80 Mark non-externalizable strings as such
A few classes such as Constanrs are marked with @SuppressWarnings, as are
toString() methods with many liternal, but otherwise $NLS-n$ is used for
string containing text that should not be translated. A few literals may
fall into the gray zone, but mostly I've tried to only tag the obvious
ones.

Change-Id: I22e50a77e2bf9e0b842a66bdf674e8fa1692f590
2012-12-27 16:57:38 +01:00
Tomasz Zarna 03d50dc50b Add org.eclipse.jgit.pgm.Reset to commands catalog
Change-Id: I7acfd051a07be889b27cfcfc1f396d86a9f86ab2
Signed-off-by: Tomasz Zarna <tzarna@gmail.com>
2012-12-22 13:01:22 +01:00
Matthias Sohn 706f8eb9fc Prepare 2.3.0 builds
Change-Id: I0ca539e8cfe444f96c64dc56d1f0ef33b66e0cff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-21 00:48:45 +01:00
Matthias Sohn 2d78a8da97 Prepare post 2.2.0.201212191850-r builds
Change-Id: I1a0fe51c71551fcfc98f5dd435eb283fd661b77a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-21 00:31:26 +01:00
Matthias Sohn aa357c2a9f JGit v2.2.0.201212191850-r
Change-Id: Idc49f17d03886b6a1e61a94ff81e32625c8675d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-20 00:59:41 +01:00
Matthias Sohn bf0dc41362 Fix hidden field warning
Change-Id: Ic52527c32f8167db3c7bb7fa0297c86fee21da27
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-12 08:32:33 +01:00
Matthias Sohn 7b1d7ac90e Fix empty control block warnings
Change-Id: I7c546fa89f5e1933cff6648b2e03e07db61273e8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-12 08:31:45 +01:00
Robin Rosenberg 138a2b06c8 Cleanup unused import and Java 6 syntax in Archive
@Override for implementation of interface is Java 6. JGit's execution
environment is still Java 5.

Change-Id: I48d10b3bf81a60938da86e026053b2f3d5e24ad3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-12 08:30:17 +01:00
Jonathan Nieder 78009782cd archive: Add tar support
Unlike ZIP files, tar files do not treat symlinks as ordinary files
with a different mode, so tar support involves a little more code than
would be ideal.

Change-Id: Ica2568f4a0e443bf4b955ef0c029bc8eec62d369
2012-12-04 15:37:42 -08:00
Jonathan Nieder 345ab401ce archive: Add --format option that switches between formats
Prepare for .tar support.

Change-Id: Ieb07702da1a54b41ae764fbb425f70826907b593
Improved-by: Shawn O. Pearce <spearce@spearce.org>
2012-12-04 15:36:32 -08:00
Jonathan Nieder 7123cbf470 archive: Record executable and symlink bits
Setting the mode for a zip entry is now as simple as
"entry.setUnixMode(mode)", so do that.

The test checks using the system's "zipinfo" command (from InfoZIP)
that the mode has been recorded correctly on systems that happen to
have a "zipinfo" command, using org.junit.Assume to distinguish them.

Change-Id: I4236c102fd76f18d01b2dc926eeb9b9fa11a61b7
2012-12-04 15:34:07 -08:00
Jonathan Nieder 1547eaf7c5 [RFC] archive: Switch to commons-compress as ZIP archiver
The Apache Commons Compress library provides a similar interface to
java.util.zip with some features not found in java.util.zip, including
support for inclusion of metadata (file mode and symlink targets) and
support for multiple file formats (zip, .tar.xz, etc).

Use it, in preparation for making use of these features.  No
functional change intended yet.

A previous version of this patch used plexus-archiver.  That is a
heavier-weight dependency and offers a less convenient interface.

Thanks to James Moger and Chris Aniszczyk for advice.

Change-Id: Id01146950bb9c18dae0169311e3cde2c3bfa675e
2012-12-03 10:49:06 -08:00
Jonathan Nieder b46b27e389 add: Fix bad metaVar reference in <filepattern> help
Without this patch, "jgit add --help" throws two exceptions
(NoSuchFieldException: metavar_filepattern; MissingResourceException:
Can't find resource for bundle java.util.PropertyResourceBundle, key
metavar_filepattern) instead of printing a usage message, due to a
small typo and a missing declaration.

Change-Id: I4b848b3a8c7b1a49d8b9582809375daa4aca6b50
2012-11-28 17:48:25 -08:00
Robin Rosenberg 8b06c46e30 Add a case statement for fast-forward merge
This case was ommitted. Treat the same as a non-fastworwad
merge.

Change-Id: Ia81e2430dfe04c3ce9b6e2f8fb4b6c646293a174
2012-11-25 21:11:28 +01:00
Ketan Padegaonkar 360be05fd4 Have git-ls tree to accept path args like git-ls-tree
Usage is:

jgit ls-tree [-r|--recursive] <tree-ish> [-- paths...]

Change-Id: I2e1c9c3cc8cddfa12ca4bfb9afc4df0492a9fce1
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-18 18:36:13 -06:00
Jonathan Nieder 6a94f027b6 Add "jgit archive" tool that writes a tree as a ZIP file
C Git's "git archive" command represents a tree object using a
standard archival format like tar, zip, or tgz, ready for consumption
by other, git-unaware users or tools.

Add a bare-bones analagous "jgit archive" command to show what is
possible, supporting only ZIP format for now.  It uses java.util.zip
which is not aware of the InfoZIP extensions for representing symlinks
and file permissions, so symlinks, executable files, and submodule
entries are represented as plain text files.

Making this functionality available from the library, improving
handling of special entries, and support for other output formats are
left for later patches.  Ultimately the intent is to offer a
TreeArchiveStream class for use by web frontends like Gitiles to offer
"download as zip/tgz/txz" links and use by, for example, code search
tools to get easy access to the content of git tree objects.

Test with "jgit archive my-favorite-tree >out.zip".

Change-Id: Ib590f173ceff3df4b58493cecccd6b9a1b355e3d
2012-11-16 16:21:25 -08:00
Tomasz Zarna fb33e80218 Add reflog command to JGit CLI
Bug: 394497
Change-Id: Ib8bc1d9fd789d22fe5f10e03068a11cfdd3e46eb
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-16 12:02:28 -08:00
Robin Rosenberg 20c829838a Make an exception for the formatting rules (turn off) for some files
Our rule to enforce javodocs for public members gives us a problem
because there are some patterns where javadoc make little sense so we
make the comments as small as possible, which our formatting rules do
not like, so disable it for those source files.

Change-Id: I6e3edb1e650ed45428b89cf41e6151b6536bca8a
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-16 10:28:42 -08:00
Robin Rosenberg 57333a8e93 Harmonize the JDT settings within JGit
Note the the settings are slightly less restrictive for test bundles.
-Also cleanup a couple of malformed javadocs
-Update compiler warnings/errors to include default values from Juno
-We now flag diagnosed null dereference as error. We didn't do that
 earlier because of some false positives.

Change-Id: I58386d63164e65d3d8d1998da3390d99bdc7381a
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-16 10:25:45 -08:00
Matthias Sohn 05a7113002 Add missing @since tags to mark API added in 2.2
Change-Id: I458167739210214fa54c4b3d62fac5abc82f96f7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-16 10:08:07 -08:00
Tomasz Zarna 318f3d4643 Add support for --no-ff while merging
Bug: 394432
Change-Id: I373128c0ba949f9b24248874f77f3d68b50ccfd1
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-16 11:04:13 +01:00
Tomasz Zarna cb0f0ad4cf Add a test for org.eclipse.jgit.pgm.Tag
The test checks if an error is thrown when trying to create the same tag
for the second time.

Change-Id: I4ed2f6c997587f0ea23bd26a32fb64a2d48a980e
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-15 16:28:02 -08:00
Tomasz Zarna 790126c145 Do not fail when checking out HEAD
Change-Id: I99f5467477ed53101121a5a5d8a0910c55758401
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-15 16:05:09 -08:00
Tomasz Zarna 074f9194dc Prefix an abnormal CLI command termination with 'fatal:'
Change-Id: I3d257666c6fbed7b238c575808f73ec518e811b9
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-15 15:45:35 -08:00
Matthias Sohn 6a3b0668b7 Merge "Fix formatting in org.eclipse.jgit.pgm.CLIText" 2012-11-14 17:34:34 -05:00
Jonathan Nieder dfb8bd694c diff, log -p: do not use outs before it is initialized
Since commit caa362f20d (Check for write errors in standard out and
exit with error, 2012-09-14), running "jgit diff" results in a
NullPointerException:

| $ jgit diff
| java.lang.NullPointerException
|	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
|	at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
|	at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:688)
|	at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:630)
|	at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:616)
|	at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:600)
|	at org.eclipse.jgit.pgm.Diff.run(Diff.java:211)
|	at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:166)
|	at org.eclipse.jgit.pgm.Main.execute(Main.java:200)
|	at org.eclipse.jgit.pgm.Main.run(Main.java:120)
|	at org.eclipse.jgit.pgm.Main.main(Main.java:94)

That patch replaced most uses of System.out with a wrapper, with
changes like the following:

	 class Diff extends TextBuiltin {
		private final DiffFormatter diffFmt = new DiffFormatter( //
	-			new BufferedOutputStream(System.out));
	+			new BufferedOutputStream(outs));

outs is not set for TextBuiltin objects until init() has been run.
Moving the initialization to after the super.init() call gets
"jgit diff" and "jgit log -p" working well again.

Change-Id: I80fcf259c4fb733990bd16e52bcf94e66d820826
2012-11-14 12:14:20 -08:00
Tomasz Zarna 77d98b7ed5 Fix formatting in org.eclipse.jgit.pgm.CLIText
Change-Id: Ia87f28fa440cb354bf591713c8aadbe3969edbf1
2012-11-11 23:45:28 +01:00
Robin Rosenberg 81fa566295 Suppress resource warnings with Java 7
For streams that should not be closed, i.e. don't own an underlying
stream, and in-memory streams that do not need to be closed we just
suppress the warning. This mostly apply to test cases. GC is enough.

For streams with external resources (i.e. files) we add the necessary
call to close().

Change-Id: I4d883ba2e7d07f199fe57ccb3459ece00441a570
2012-10-25 15:17:23 -07:00
Tomasz Zarna e8c25a1738 Add --squash option to org.eclipse.jgit.pgm.Merge
Change-Id: Ifd20b6f4731cfa71319145cac7b464aa53db18b8
2012-10-07 23:38:34 +02:00
Shawn O. Pearce 31261b5c2f Revert "The constructor CmdLineException(String) is deprecated"
This reverts commit 07f9936257.

07f9 seems to require a more recent args4j, but I cannot locate a CQ
that verifies we can use a version more recent then 2.0.12. 2.0.16
has been released, but the Hudson CI instance at Eclipse won't
build it.

Since the commit fixes an issue identified in March but wasn't
actually submitted to the tree until September, we can continue to
ignore whatever the problem is/was until someone can attempt a more
correctly working solution.

Change-Id: I94fa432c219bda21c1126976bb60e5292760092e
2012-09-26 10:20:42 -07:00
Robin Rosenberg 7de1154d21 Remove uses of TextBuiltin.out in favor of outw
These came from patches in review in parallel with the introduction
of the exception throwing print writer.

Change-Id: I1c27fa276eb1fcf12ad19792049c35cb52518c16
2012-09-23 23:00:35 +02:00
Tomasz Zarna 07f9936257 The constructor CmdLineException(String) is deprecated
Use CmdLineException(CmdLineParser, String) instead. The new constructor
has been added in args4j 2.0.12, so in pom.xml that would be the minimum
version. Set the upper boundary in pom.xml to 2.1.0 (exclusive), just
like in the MANIFEST.MF.

Change-Id: If45d809e4ffa11a3572d958ce121422fb03cf8f3
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2012-09-23 10:49:50 +02:00
Robin Rosenberg c3f1fac03f Suppress boxing warnings where we know they are ok
Invoke the wrapper types' valueOf via static imports.
For booleans used in asserts, add a new assert in
the JUnit utility package since out current version of JUnit
does not have the assert(boolean, boolean) method.

Change-Id: I9099bd8efbc8c133479344d51ce7dabed8958a2b
2012-09-22 01:21:00 +02:00
Matthias Sohn 4b3c0f8aba Prepare 2.2.0 builds
Change-Id: I386ba70541d644e58661d26713b309371e0f9257
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-19 09:10:12 +02:00
Tomasz Zarna f7b644df66 Add tests for output result of merging -- org.eclipse.jgit.pgm.Merge
Change-Id: I888c7e80503b869d65a9617e6a07e01d1ff5f197
2012-09-17 07:07:00 -07:00
Robin Rosenberg caa362f20d Check for write errors in standard out and exit with error
The underlying problem is that System.out is a PrintWriter and
as such it does not throw exceptions on error, but rather just
sets a flag and continues.

This changes replaces the use of System.out with a PrintWriter-like
writer that does not catch error, but instead throw them to the
caller.

Bug: 366243
Change-Id: I44405edc4416e943b87f09a0f6ed041c6c51b046
2012-09-16 11:12:47 -07:00
Robin Rosenberg 5f094154dd Added new Status CLI command 'jgit status'
This is a first basic implementation that displays current branch and
list of files of various status, but isn't as refined as its native
counterpart (e.g. does not say if we're ahead or behind the remote).
It's been helpful in the diagnostic of bug #347885.

Bug: 348318
CQ: 6769
Change-Id: Ifc35da608fbba652524c1b5b522e3c0d5369ad5e
Signed-off-by: François Rey <eclipse.org@francois.rey.name>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2012-09-09 21:10:59 +02:00
Tomasz Zarna e44c3e7139 Output result of switching branch -- o.e.jgit.pgm.Checkout
Change-Id: I9829950b686ce3b8c70b8f7a1774d5e2b55cd00a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-05 07:59:37 +02:00
Robin Rosenberg f590a4c667 Fix NPE when notes are present
Change-Id: If9200ae4a7f582a5562aecf323ff0430ba154583
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-05 07:42:12 +02:00
Christian Halstrick 4c3f017a77 Garbage collector for FileRepositories
Implements a garbage collector for FileRepositories. Main ideas are
copied from the garbage collector for DFS based repos
(DfsGarbageCollector). Added functionalities are
- pruning loose objects
- handling of the index
- packing refs
- handling of reflogs (objects referenced from reflog will not be
pruned/)

These are features of a GC which are not handled in this change and
which should come with subsequent changes:
- unpacking packed objects into loose objects (to support that pruning
packed objects doesn't delete them until they are older than two weeks)
- expiration of reflogs
- support for configuration parameters (e.g. gc.pruneExpire)

Change-Id: I14ea5cb7e0fd1b5c50b994fd77f4e05bfbb9d911
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
2012-07-29 15:43:50 +02:00
Shawn O. Pearce 189a01b617 show: Implement command line show for any object
Change-Id: I4dea84428d48b3de0e187c510b766f965323b21b
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2012-07-18 00:31:47 +02:00
Tomasz Zarna 75b60afe41 Typo in CLIText#unknownMergeStratey, should be #unknownMergeStrategy
Change-Id: I4d4aa59723d6422ff755165e45f368da76d309ab
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2012-07-14 15:15:31 +02:00
Matthias Sohn 9000351909 Prepare 2.1.0 builds
Change-Id: I4aad3efdd435d8d5eb53c84a8d38132acce97c25
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-14 00:45:13 +02:00
Matthias Sohn 2f27d5ae12 Prepare post v2.0.0.201206130900-r builds
Change-Id: I51b1bbed35288c5285b3d6860efba97d58de5a1c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-14 00:19:30 +02:00
Matthias Sohn aacd4f721b JGit v2.0.0.201206130900-r
Change-Id: I685e09b3e37d68614df1b5cc5f687a65cd6eb82d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-13 15:03:59 +02:00
Matthias Sohn 4974090d33 Add org.eclipse.jgit.pgm.feature to enable consumption via p2
Orion wants to consume the pgm bundle from a p2 repository in their
build. Also add corresponding source bundle and feature to provision
sources via a target platform.

Bug: 373789
Change-Id: I0016ee155553c546606b63d310666eb10bd997e1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-12 18:10:04 +02:00
Matthias Sohn f2d9a5ed31 Prepare next 2.0.0-SNAPSHOT builds
Change-Id: I0d55b390502b3da139ab0d15a6cf3d05774d8ad9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-06 13:57:32 +02:00
Matthias Sohn 1cb135ebfb JGit v2.0.0.201206060730-rc3
Change-Id: I12f8800b74228e71c77f0fb82c250c154d06369f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-06 13:27:54 +02:00
Matthias Sohn 9bd9d9a698 Prepare next 2.0.0-SNAPSHOT builds
Change-Id: Iffc57d6b25dafb72272d1957116c19ab45ba2c54
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-31 01:39:57 +02:00
Matthias Sohn 4aa550f7cc JGit v2.0.0.201205301645-rc2
Change-Id: Ic4f84f1a11c93863c229c0089f2e4edc7c7a36b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-30 23:08:15 +02:00
Tomasz Zarna 23e0a3e734 Add config --list command to pgm
Currently, only --list option is supported with --global, --system,
--local and --file switches.

Change-Id: I9b179b162996520e95c4e001dccd65c566a4bd27
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-23 16:35:08 +02:00
Mikael Karlsson 15147a273f Add user friendly output from jgit commit command
Instead of printing the stack trace from the JGitInternalException
thrown from CommitMessage.call(), print just the exception
message, using the Die exception.

Change-Id: I9ec3eb02eb001813fa15ac6f90a606223dcdafdc
2012-05-18 22:07:50 +02:00
Tomasz Zarna 94285e691a Add --all switch to org.eclipse.jgit.pgm.Commit
Change-Id: Iab52f995676daf60e0dfa043cc9e022f6e32a758
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-05-10 18:31:33 -07:00
Tomasz Zarna e5633ba2d3 Fix two typos in CLIText.properties
Change-Id: Id1429d52c88a9e2b888e6c6906cf8148945bd2ca
2012-05-02 11:35:13 +02:00
Robin Rosenberg fd53b454f2 Fix broken TagCommand API
Tags can be un-annotated whereby there is no RevTag object, only
a ref pointing to the tagged object.

Bug: 360650
Change-Id: I06309c45c0a896fe2a0a874700febf78c9fb87e8
2012-04-06 00:52:20 +02:00
Shawn Pearce 0a69f05647 Merge changes Ic0ee9c08,Ia3e82682,I8d8ab547,I8f2cd0a0,I45823b0c,Ie22ac47e
* changes:
  cleanup: Silence an unused-parameter warning
  cleanup: Get rid of some unused-warnings
  cleanup: Remove unused parameter in ConsoleCredentialsProvider
  cleanup: Drop unused parameter on DhtPackParser
  cleanup: Remove unneeded parameter to private method in RefUpdateTest
  cleanup: Remove unnecessary @SuppressWarnings
2012-03-12 10:16:42 -04:00
Robin Rosenberg 66e8cd4eec cleanup: Get rid of some unused-warnings
Change-Id: Ia3e82682781c6b5bc3141b3e27db67b93c3162cd
2012-03-09 13:30:20 +01:00
Tomasz Zarna c638f72b41 Export all packages from org.eclipse.jgit.pgm
Change-Id: I90565c8626aa5ab58ed3ff1dafa8bd21c9a79c62
2012-03-07 18:41:45 +01:00
Matthias Sohn 755dfdb409 Prepare 2.0.0-SNAPSHOT builds
Change-Id: I946e315af04227727ac937ebe9d70ae1ea4e8936
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-02-16 00:49:49 +01:00
Robin Rosenberg 9673ae18ce Merge "Allow to list tags with org.eclipse.jgit.pgm.Tag" 2012-01-25 13:10:15 -05:00
Matthias Sohn 067ccbfda7 Merge branch 'stable-1.2'
* stable-1.2:
  JGit v1.2.0.201112221803-r
  Expose unmerged paths when revert fails
  Enforce the use of Java5 API:s only (with a few exceptions)

Change-Id: Ib18d41a65e68cc47fb63114fcce27a16820d0692
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-26 23:52:32 +01:00
Matthias Sohn a069e90fa9 JGit v1.2.0.201112221803-r
Change-Id: Icc0b09324f205d93929af8cf522a99ad00cf7591
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-23 00:19:02 +01:00
Tomasz Zarna 8c60468ff4 Allow to amend commits with JGit CLI
Change-Id: I0e8d365b56e079ac4ccece7fcf80ea140c319c78
2011-12-18 16:28:44 +01:00
Robin Rosenberg 0ca105a502 Enforce the use of Java5 API:s only (with a few exceptions)
This only works with Eclipse 3.6 and newer and requires installation
of new package. Documentation is not very good, but there is a blog
about it here:
http://eclipseandjazz.blogspot.com/2011/10/of-invalid-references-to-system.html

API checking is especially useful on OS X where Java5 is not readily
available.

Change-Id: I3c0ad460874a21c073f5ac047146cbf5d31992b4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-16 01:01:36 +01:00
Matthias Sohn 7fded4d14f Prepare 1.3.0 builds
Change-Id: I7a1ae73783c95041b59f047a7330e62e7f642149
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-10 01:07:16 +01:00
Robin Rosenberg 9ffbe444f8 Force jgit.sh to use UTF-8 encoding on Mac
For some obscure reason the platform encodng in Java on Macs
is MacRoman. OS X used UTF-8 as the default encoding so set
the encoding property in jgit.sh.

Change-Id: I08182c2f8512f799178cee70bcc28d6ee2b9c2b0
2011-12-07 00:44:46 +01:00
Tomasz Zarna 7017c697fa Allow to list tags with org.eclipse.jgit.pgm.Tag
Change-Id: I79c284a720935814aef9767156106833f983bb8b
2011-12-02 14:25:48 +01:00
Robin Rosenberg 6baf0cb956 Make use of the many date formatting options in the log command
Change-Id: I30f1049fce086f2cf7e39ba3ad8b335df3a7b827
2011-10-26 23:15:24 +02:00
Robin Rosenberg 06b183f9b7 Add a method to SystemReader to get the time zone
Change-Id: Ifd31f408ed2c5b7869694b715fea3219e74963ef
2011-10-20 23:49:51 +02:00
Robin Rosenberg 51d95bbaea Merge "Document the show methods of RevWalkTextBuiltin" 2011-09-22 12:27:48 -04:00
Robin Rosenberg 8a45aa460c Merge "Fix a boxing warning in org.eclipse.jgit.pgm.RevWalkTextBuiltin" 2011-09-22 12:27:27 -04:00
Robin Rosenberg eb8431da75 Document the show methods of RevWalkTextBuiltin
Change-Id: Ic704008cb215e1437c0a3fd1aec3aa38209ef3c7
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2011-09-18 13:08:14 +02:00
Robin Rosenberg edaca7ed12 Fix a boxing warning in org.eclipse.jgit.pgm.RevWalkTextBuiltin
Change-Id: Ia154da79926ce25731e856bed264dd19a76bc1f1
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2011-09-18 13:08:03 +02:00
Matthias Sohn 19a366d532 Prepare 1.2.0 builds
Change-Id: I9ec247135d93ef28d732e94f18d0ec1d0e2e6d44
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-15 22:51:46 +02:00
Matthias Sohn 57d6585522 Prepare post v1.1.0.201109151100-r build
Change-Id: Ib099ec93d8243b238641d79328216874532ab5eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-15 21:51:23 +02:00
Matthias Sohn 1cb0510cee JGit v1.1.0.201109151100-r
Change-Id: Iadcec7e5973600e005cbdeb837fa197d3ae2ea86
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-15 17:32:58 +02:00
Matthias Sohn b09d21b6eb Prepare post v1.1.0.201109071825-rc3 builds
Change-Id: I1244f6639263d156a6f9e4530167e5eb1826a535
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-08 01:50:41 +02:00
Matthias Sohn 75611a8314 JGit v1.1.0.201109071825-rc3
Change-Id: I1b989d3101272632eacabe25a0b111ad0ff5bb3b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-08 00:54:27 +02:00
Matthias Sohn cfdb09e9db Use commit message best practices for Mylyn Commit template
We should use a template for Mylyn commit messages that matches with our
guidelines for commit messages.

http://wiki.eclipse.org/EGit/Contributor_Guide#Commit_message_guidelines

Bug: 337401
Change-Id: I05812abf0eb0651d22c439142640f173fc2f2ba0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-05 23:57:21 +02:00
Matthias Sohn df117d3da9 Prepare post-v1.1.0.201109011030-rc2 builds
Change-Id: I8dda83cdbe88beba4a480df9846848bf3aceb9e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-01 17:36:10 +02:00
Matthias Sohn 384ffa7ee9 JGit v1.1.0.201109011030-rc2
Change-Id: Ie6d65fe45ad92c813ce3a227729aa43681922249
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-01 16:38:13 +02:00
Robin Rosenberg dcd4c5a642 Use the appropriate constant for ".git"
We have two constants with the same content. DOT_GIT is intended
for the git repository below the work tree, while DOT_GIT_EXT is
the ".git" directory extension usually associated with bare
repositories.

Change-Id: I0946b4beb2d1c3af289ddbbb5641d2f4e4c49d3f
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2011-08-27 17:03:10 +02:00
Shawn O. Pearce a5f5b20dff blame: Implement blame on the command line
Command line options match the C implementation of `git blame` as
closely as possible, making for a pretty complete tool.

Change-Id: Ie1bd172ad9de586c3b60f0ee4a77a8f047364882
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2011-08-13 14:12:03 -07:00
Shawn O. Pearce 489604aaad Fix jgit rev-list --objects master
This flag was not being honored due to a bug in createWalk().
argWalk is always non-null when there are commits passed in
on the command line. If --objects was specified, always make
a new ObjectWalk for the actual execution.

Change-Id: I6e1a1636f2634605d86671a83766cc1c42939821
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2011-08-08 08:31:47 -07:00
Chris Aniszczyk f0060f64a7 Merge "Merge in JGit CLI is missing break statement" 2011-07-12 09:53:51 -04:00
Tomasz Zarna 1efecaa9f9 Merge in JGit CLI is missing break statement
Change-Id: I2095601b848e66e54d5dac828ef6ed1a4c5ae66c
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2011-07-12 08:48:53 -05:00
Robin Rosenberg 529a348961 RFC: Ugly fix for i18n of metaVar CLI arguments
This patch possibly ties to a specific version of args4j.

Bug: 318286
Change-Id: I05d4ecf6bd25deec7fb2efbfa61913f4ec4e04e5
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2011-06-20 00:55:13 +02:00
Matthias Sohn 0ab7be9681 Merge branch 'stable-1.0'
* stable-1.0:
  Prepare post JGit v1.0.0.201106090707-r builds
  JGit v1.0.0.201106090707-r
  Include about.html files in maven build
  Prepare post v1.0.0.201106081625-r builds
  JGit v1.0.0.201106081625-r
  Add missing about.html files to all shipped bundles
  Prepare post v1.0.0.201106071701-r builds
  JGit v1.0.0.201106071701-r
2011-06-09 17:41:16 +02:00
Matthias Sohn 6646c72d17 Prepare post JGit v1.0.0.201106090707-r builds
Change-Id: I35292f9f6fb5ebc591308fdd2d069203413e189d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-09 14:11:23 +02:00
Matthias Sohn b26ff6ebd6 JGit v1.0.0.201106090707-r
Change-Id: Iba44e71b6441a0e39122ca8666b51989e605f25f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-09 13:11:58 +02:00
Matthias Sohn e1af16ad99 Include about.html files in maven build
Change-Id: Ifa96090eb0fc336ee8080385f48212b5158dd9f7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-09 11:08:07 +02:00
Matthias Sohn 22df55c8b3 Prepare post v1.0.0.201106081625-r builds
Change-Id: I5e6994844405f7839ad3b3439f98bcadb59d329b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-09 11:08:07 +02:00
Matthias Sohn eacd7104a2 JGit v1.0.0.201106081625-r
Change-Id: I629990189083bab4737938ad712080fba7917582
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-08 22:42:20 +02:00
Matthias Sohn 8c5f403c0c Add missing about.html files to all shipped bundles
Change-Id: I5a4ad9493da3816f21d9fdd0b5b977388d074500
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-08 21:51:51 +02:00
Matthias Sohn 9c67a391f1 Prepare post v1.0.0.201106071701-r builds
Change-Id: I67ee2912ef54462cf860dc4ec0a6334e9c619384
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-08 16:32:01 +02:00
Matthias Sohn ac71f9045a JGit v1.0.0.201106071701-r
Change-Id: Ic8f49336ba96c8dcf4bab2f74c0f1efc1ab55131
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-07 23:04:55 +02:00
Matthias Sohn f1713abcdc Prepare 1.1.0 builds
Change-Id: I4cf017cd567543846839612ab3ace6d26233e01d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-06 01:24:32 +02:00
Matthias Sohn 4a4e1f764c Prepare post v1.0.0.201106051725-r builds
Change-Id: I4839877e1a6fa7782f37423213af8d579727a494
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-06 01:17:16 +02:00
Matthias Sohn f65513f753 JGit v1.0.0.201106051725-r
Change-Id: I39f4a23cf284505395d511dfedf02b7f5608df95
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-05 23:26:56 +02:00
Matthias Sohn ada903085d Prepare post v1.0.0.201106011211-rc3 builds
Change-Id: I4dec8eba7e35858aef65fcc10f91fad3fe5b52b9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-01 18:55:11 +02:00
Matthias Sohn 81371d385b JGit v1.0.0.201106011211-rc3
Change-Id: I574a05200471c431b3a02ac6ff208dc6aa90f539
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-06-01 18:22:44 +02:00
Matthias Sohn f5f1536f3f Remove incubation marker
Change-Id: I6018ce0cd3b7c8137e137848fe1f04551b257538
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-05-31 22:53:53 +02:00
Shawn O. Pearce 0a39fb2ab6 jgit.sh: Implement pager support
If the command is either `diff` or `log`, there is often a lot of
lines of output. Run these commands through $GIT_PAGER, $PAGER, or
`less` in order to make it easier to browse the output on a terminal.

Change-Id: I18b87ea4acf404b94788f2ac2101812bd13e6a0f
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2011-05-31 08:58:45 -07:00
Matthias Sohn f9d7b0d21e Qualify post-0.12 builds
Change-Id: I70fe2671321efb5c3d271121ce00299533d1b388
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-05-03 00:19:54 +02:00
Matthias Sohn b2b58feba7 JGit 0.12.1
Change-Id: Ia6e58b466fa3ef7ddd61b40f2ad44141fe8786c4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-05-02 18:24:45 +02:00
Christian Halstrick 153283f05a Added Merge command to the CLI
This merge command accepts the merge strategy as option and uses the
resolve strategy as default. It expects exactly one other
revision which is merged with current head.

Change-Id: Ia8c188b93ade4afabe6a9ccf267faf045f359a3a
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2011-03-29 12:27:45 -05:00
Sasa Zivkov 13fffa7513 Registering the Checkout command and fixed a typo.
The Checkout command line command was added to JGit but it wasn't
registered in the list of available commands.
Additionally, the 'force' option was named '---force' (triple '-').

Change-Id: I259773932fa9aec3bb29e215740e67c834566f6f
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
2011-03-24 11:22:17 +01:00
Shawn O. Pearce 506ab8caa5 PushCommand: Add utilities for --all, --tags
The --all flag on the command line implies using refs/heads/* as
a push specification. Add this to the standard command object.

The --tags flag on the command line implies using refs/tags/* as
a push specification. Add this to the standard command object.

Change-Id: Iaef200b17cce77604548dbfb15cf2499b10687b5
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2011-03-15 09:49:10 -05:00
Philipp Thun 8e1b581d39 Make --git-dir optional for 'jgit init'
For compatibility reasons with regards to native git and also to
make the init command easier to use from the command line,
argument --git-dir should not be required.

Additionally the path created in case --git-dir is not supplied now is
canonical and thus easier to read.

Change-Id: Idb7d77e983a78c4b21fbf232fc1e75ef581e5ed1
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
2011-03-15 13:57:15 +01:00
Shawn O. Pearce 3b91e3fe49 Always fetch tags during clone
C Git always fetches tags during clone, even if the tag doesn't
point to an object that was fetched by the branch specifications.
Match that behavior, as users expect it.

Bug: 326611
Change-Id: I81a82b7359a9649f18a172219da44ed54e77ca2f
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2011-03-14 08:53:41 -07:00
Philipp Thun a490afedba Add -o option to commit command
This change adds the --only/ -o option to the commit command.

Change-Id: I44352d56877f8204d985cb7a35a2e0faffb7d341
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
2011-03-11 14:25:46 +01:00
Matthias Sohn d353107729 Improve readability of timestamps shown by debug-show-dir-cache
The old format is hard to read.

Change-Id: I27f3a7dbd92b26256993d27d5223b743fef70902
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-03-03 16:19:47 +01:00
Matthias Sohn 3de0df93d4 Enhance debug-show-dir-cache command to show stage
Change-Id: I6fb17ec7f04f8bfaf1253b2ff08200ef9fc51898
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-03-03 10:56:38 +01:00
Shawn O. Pearce 1b2062fe37 PackWriter: Avoid CRC-32 validation when feeding IndexPack
There is no need to validate the object contents during
copyObjectAsIs if the result is going to be parsed by unpack-objects
or index-pack.  Both programs will compute the SHA-1 of the object,
and also validate most of the pack structure.  For git daemon
like servers, this work is already done on the client end of the
connection, so the server doesn't need to repeat that work itself.

Disable object validation for the 3 transport cases where we know
the remote side will handle object validation for us (push, bundle
creation, and upload pack).  This improves performance on the server
side by reducing the work that must be done.

Change-Id: Iabb78eec45898e4a17f7aab3fb94c004d8d69af6
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2011-03-02 12:23:58 -08:00
Chris Aniszczyk 268ccbebe3 Merge "ProgressMonitor: Refactor to use background alarms" 2011-03-01 12:05:59 -05:00
Sasa Zivkov 3e1a5081d6 Show notes in Log CLI command - Part 2
This change fixes issues identified in the commit
5f3d577e5a.

Change-Id: Idbd935f5f60ad043faa0d4982b3e101ef7c07d60
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
2011-03-01 09:29:35 +01:00
Shawn O. Pearce 68ab451d39 ProgressMonitor: Refactor to use background alarms
Instead of polling the system clock on every update(1) method call,
use a scheduled executor to toggle a volatile once per second until
the task is done.  Check the volatile on each update(int), looking
to see if output should occur.

This limits progress output to either once per 1% complete, or once
per second.  To save time during update calls the timer isn't reset
during each 1% of output, which means we may see one unnecessary
output trigger if at least 1% completed during the one second of the
alarm time.

Change-Id: I8fdd7e31c37bef39a5d1b3da7105da0ef879eb84
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2011-02-28 19:36:56 -08:00
Sasa Zivkov 5f3d577e5a Show notes in Log CLI command
Support for --no-standard-notes and --show-notes=REF options is added
to the Log command. The --show-notes option can be specified more than
once if more than one notes branch should be used for showing notes.

The notes are displayed from note branches in the order how the note
branches are specified in the command line. However, the standard note,
from the refs/notes/commits, is always displayed as first unless
the --no-standard-notes options is given.

Change-Id: I4e7940804ed9d388b625b8e8a8e25bfcf5ee15a6
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2011-02-23 09:32:23 -06:00
Chris Aniszczyk bd8944d671 Add Reset to the JGit CLI
Change-Id: I85368c849c0964b9a539fa1991920adb2ace94df
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2011-02-17 14:06:28 -06:00
Shawn O. Pearce 6490090f14 pgm: Make --git-dir a string
DHT based repository types don't use a java.io.File to name the
repository.  Moving the type to a string starts to open up more types
of repository names, making the standard pgm package easier to reuse
on other storage systems.

Change-Id: I262ccc8c01cd6db88f832ef317b0e1e5db2d016a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2011-02-15 13:36:22 -06:00
Shawn O. Pearce 1b7a5a2960 daemon: Use HTTP's resolver and factory pattern
Using a resolver and factory pattern for the anonymous git:// Daemon
class makes transport.Daemon more useful on non-file storage systems,
or in embedded applications where the caller wants more precise
control over the work tasks constructed within the daemon.

Rather than defining new interfaces, move the existing HTTP ones
into transport.resolver and make them generic on the connection
handle type.  For HTTP, continue to use HttpServletRequest, and
for transport.Daemon use DaemonClient.

To remain compatible with transport.Daemon, FileResolver needs to
learn how to use multiple base directories, and how to export any
Repository instance at a fixed name.

Change-Id: I1efa6b2bd7c6567e983fbbf346947238ea2e847e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2011-02-14 18:28:21 -08:00
Matthias Sohn f2c8eec57b Qualify post 0.11 builds
Change-Id: Ibcef4fc4c986c2cda01e943d16aa1c53eff99f25
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-02-12 03:30:05 +01:00
Matthias Sohn 857d151198 JGit 0.11.1
Change-Id: I9ac2fdfb4326536502964ba614d37d0bd103f524
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-02-11 23:25:34 +01:00
Matthias Sohn 38eec8f4a2 [findbugs] Do not ignore exceptional return value of mkdir
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>
2011-01-28 01:11:12 +01:00
Sasa Zivkov 65680da3ee Fixed several NPEs in the Fetch CLI
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>
2011-01-26 11:38:59 -06:00
Sasa Zivkov 990498b75d Fixed NLS in JGit command line interface
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>
2011-01-26 11:33:52 -06:00
Shawn O. Pearce 1bf0c3cdb1 Refactor IndexPack to not require local filesystem
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>
2011-01-25 16:43:06 -06:00
Shawn O. Pearce 0c22243c4a clone: Use DirCacheCheckout
This simple change lets us get rid of WorkDirCheckout from JGit,
and all of its supporting code.

Change-Id: I1a5aabe9ab4a2b156fd37cc7e9ededb4ed70f53a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2010-12-20 09:28:29 -06:00
Matthias Sohn 485917598e Qualify post 0.10 builds
Change-Id: Ifcb8fdea95286779c8aea6bf4d7647e8c1c98d63
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-12-17 15:49:30 +01:00
Matthias Sohn 67d8f3a338 Merge branch 'stable-0.10' 2010-12-17 15:41:27 +01:00
Matthias Sohn 51d1af9489 Qualify post 0.10.1 builds
Change-Id: I320f1f739f3689daf11d532a55ae1133785aec8e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-12-17 15:23:14 +01:00
Matthias Sohn 1fdc17bfe4 JGit 0.10.1
Change-Id: I4a46d35d354193e5d4f28ef7dfae75944be8ffcf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-12-17 03:10:07 +01:00
Shawn O. Pearce 013cb8de38 Reduce calls to Repository.getConfig
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>
2010-12-15 15:14:05 -08:00
Shawn O. Pearce 11fd0fe03a Clarify WorkingTreeOptions and filemode usage
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>
2010-12-08 10:03:19 -08:00
Shawn O. Pearce a02be9725c Remove empty iterator from TreeWalk
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>
2010-12-07 16:49:51 -08:00
Chris Aniszczyk 8bbd4f1bad Avoid NPE in Init
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>
2010-12-07 09:10:07 -06:00
Chris Aniszczyk 8f6c8818dc Update Init to use InitCommand
Change-Id: I3ff700a87dfa6ac255c1aaf3fe11a07264594aab
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2010-12-05 19:03:34 -06:00
Christian Halstrick 049827d708 Make diff algorithm configurable
The diff algorithm which is used by Merge, Cherry-Pick, Rebase
should be configurable. A new configuration parameter "diff.algorithm"
is introduced which currently accepts the values "myers" or
"histogram". Based on this parameter for example the ResolveMerger
will choose a diff algorithm. The reason for this is bug 331078.
This bug shows that JGit is more compatible with C Git when
histogram diff is in place. But since histogram diff is quite new we
need an easy way to fall back to Myers diff.

Bug: 331078
Change-Id: I2549c992e478d991c61c9508ad826d1a9e539ae3
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
2010-11-26 00:30:08 +01:00
Chris Aniszczyk c441380f9c Add the Checkout command to the Git CLI
The implementation delegates to the CheckoutCommand and
therefore only supports some of the options supported by
the CheckoutCommand.

Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2010-11-23 13:07:46 -06:00
Chris Aniszczyk a7f6764e01 Update Rm in the JGit CLI
Since we have the RmCommand API now, update Rm to use it.

Change-Id: I6e2cb37573cc8a29846f01e09e8c07e0dc279dbe
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2010-11-22 11:19:51 -06:00
Shawn O. Pearce 17d9c68636 Implement command line support for CredentialsProvider
Instead of configuring the JSch session factory, configure a more
generic CredentialsProvider, which will work for other transport
types such as http, in addition to the existing ssh.

Change-Id: I22b13303c17e654ba6720edf4be2ef15fe29537a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-11-10 15:12:47 -08:00
Shawn Pearce 09555c9853 Merge "Make Repository.shortenRefName static" 2010-11-08 17:42:21 -05:00
Christian Halstrick a28f33fa8c Fixed help of Diff and ShowCommands commands
jgit.sh <command> --help was not working for the commands Diff
and ShowCommands because of missing metaVar information. Missing
information is added here.

Change-Id: I0ab7e35006b6aa7d4326a634309dddfcdb78f2a6
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
2010-11-08 13:56:07 -08:00
Chris Aniszczyk df037eb230 Merge "Implemented the git add commandline command." 2010-11-07 16:05:24 -05:00
Sasa Zivkov 1a7c918b66 Implemented the git add commandline command.
Implementation delegates all work to the AddCommand class and,
therefore, supports only those options currently supported by the
AddCommand which means: --update and the filepattern... arguments.

Change-Id: I4827d37e08b4c988c2458d9ba60a61b6ad414d10
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
2010-11-07 21:30:56 +01:00
Robin Stocker 2fb0f5cfc0 Make Repository.shortenRefName static
The method has no reason to be non-static.

Change-Id: I1c09e074395d49cee0e6e53679b499d1f0c351ea
2010-11-06 13:41:06 +01:00
Sasa Zivkov af4f6c5125 Fixed the git init to properly set bare=true
When --git-dir=X is given JGit creates a bare repository in the
directory X. However, when the --bare option is not explicitly
given, this is not properly reflected in the X/config file i.e.
the bare=true is missing.  This change fixes this minor issue.

Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
2010-11-05 16:06:14 +01:00
Christian Halstrick e10808e658 Add option to select diff algorithm for diff command
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>
2010-10-26 18:07:49 +02:00
Shawn O. Pearce 0b51a45688 Allow pgm Main to be extended
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>
2010-10-16 21:47:10 -07:00
Shawn O. Pearce 529b2017df Fix three-word command names
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>
2010-10-14 00:14:14 +02:00
Shawn Pearce 4ac3d9814c Merge "Update Tag to use TagCommand API" 2010-10-12 15:05:55 -04:00
Shawn O. Pearce e82cadc0dc Delete PatienceDiff
HistogramDiff outperforms it for any case where PatienceDiff needs to
fallback to another algorithm.  Consequently it's not worth keeping
around, because we would always want a fallback enabled.

Change-Id: I39b99cb1db4b3be74a764dd3d68cd4c9ecd91481
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-10-11 17:05:18 -05:00
Shawn O. Pearce 14da6e0b9d debug-diff-algorithms: Real world performance test implementations
When working on a difference algorithm's implementation, its generally
more important to care about how it behaves on real-world inputs than
it does on fake inputs created for unit test cases.  Run each
implementation against a number of real-world repositories, looking at
changes between files in each commit.  This gives a better picture of
how a particular algorithm performs.

This test suite run against JGit and linux-2.6 with the current
available algorithms shows HistogramDiff always out-performs
MyersDiff, and by a wide margin on the linux-2.6 sources.  As
HistogramDiff has similar output properties as PatienceDiff, the
resulting edits are probably also more human-readable.  These test
results show that HistogramDiff is a good choice for the default
implementation, and also show that PatienceDiff isn't worth keeping.

  jgit: start at baa83ae
            2686 files,          760 commits
    N=         3 min lines,     3016 max lines
  Algorithm                     Time(ns) (  Time(ns) on   Time(ns) on )
                                         (          N=3        N=3016 )
  ---------------------------------------------------------------------
  histogram_myers              314652100 (         3900        298100 )
  histogram                    315973000 (         3800        302100 )
  patience                     774724900 (         4500        347900 )
  patience_histogram_myers     786332800 (         3700        351200 )
  myers                        819359300 (         4100        379100 )
  patience_myers               843416700 (         3800        348000 )

  linux-2.6.git: start at 85a3318
            4001 files,         2680 commits
    N=         2 min lines,    39098 max lines
  Algorithm                     Time(ns) (  Time(ns) on   Time(ns) on )
                                         (          N=2       N=39098 )
  ---------------------------------------------------------------------
  histogram_myers             1229870000 (         5900       2642700 )
  histogram                   1235654100 (         6000       2695400 )
  patience                    3856546000 (         5900       2627700 )
  patience_histogram_myers    3866728100 (         7000       2624000 )
  patience_myers              4004875300 (         8000       2651700 )
  myers                       9794679000 (         7200       2716200 )

Change-Id: I2502684d31f7851e720356820d04d8cf767f7229
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-10-11 16:20:00 -05:00
Chris Aniszczyk 782dbfc60f Update Push to use latest API
Change-Id: I57ea8634a46472f40046f4ec69de505abbf5f6cf
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2010-10-10 15:55:03 -05:00
Chris Aniszczyk 6b6c8dd01b Update Fetch to use FetchCommand API
Change-Id: I06ddc74f1ef658f4876e2bbcc3eaad3475a5371e
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2010-09-27 10:16:22 -05:00
Shawn O. Pearce af3fbb13f6 debug-text-hashfunctions: Test suite for content hashes
This is the test suite I was using to help understand why we had
such a high collision rate with RawTextComparator, and to select
a replacement function.

Since its not something we will run very often, lets make it a
program in the debug package rather than a JUnit test.  This way
we can run it on demand against any corpus of files we choose,
but we aren't bottlenecking our daily builds running tests with
no assertions.

Adding a new hash function to this suite is simple, just define
a new instance member of type "Hash" with the logic applied to
the region passed in.

Change-Id: Iec0b176adb464cf95b06cda157932b79c0b59886
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-09-24 12:49:29 -07:00
Chris Aniszczyk b3446bf387 Update Tag to use TagCommand API
Change-Id: I4f7f8e29c47980536398d73f2a71ed2b2c00f4f2
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2010-09-22 11:02:50 -05:00
Shawn O. Pearce 4b5d3d291b Qualify builds as 0.10.0
Change-Id: I54815c85b32b9492c059064b39f48677e68c5e90
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-09-16 17:26:53 -07:00
Shawn O. Pearce 5deb5b9a4a Merge branch 'stable-0.9'
* stable-0.9:
  Qualify post-0.9.3 builds
  JGit 0.9.3
  clone: Correct formatting of init message
  Fix cloning of repositories with big objects
  Qualify post-0.9.1 builds
  JGit 0.9.1
  Fix PlotCommitList to set lanes on child-less commits
2010-09-16 17:22:37 -07:00
Christian Halstrick 55714f6e73 Add --all option to RevWalkTextBuiltin
Allow our command line commands like Glog, Log to accept the
--all option to walk all known refs.

Change-Id: I6a0c84fc19e7fa80ddaa2315851c58ba89d43ca5
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
2010-09-16 10:36:43 +02:00
Matthias Sohn 26f507f0df Qualify post-0.9.3 builds
Change-Id: Ideab4923a5d8055f0e8a36ddcf0bc8adbf71c329
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-09-16 01:49:03 +02:00
Matthias Sohn 2920fcdde8 JGit 0.9.3
Change-Id: I114106f3286c36f7d5e136748a7e5130f4da163f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-09-16 01:02:53 +02:00
Chris Aniszczyk cc5b3f3473 Merge "Qualify post-0.9.1 builds" into stable-0.9 2010-09-15 15:56:53 -04:00
Shawn O. Pearce a424b7aefe clone: Correct formatting of init message
We used the wrong format method, which lead to this confusing output:

  $ ./jgit clone git://...
  Initialized empty Git repository in {0}
  remote: Counting objects: 201783
  ...
  remote: {0}

We need to use MessageFormat.format() as the message translations
use {0} syntax and not %s syntax for placeholders.

Change-Id: I8bf0fd3f7dbecf9edf47419c46aed0493d405f9e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-09-15 08:47:17 -07:00
Matthias Sohn 7ae5e82d66 Qualify post-0.9.1 builds
Change-Id: I07a3391de03379f32ecfd055d45750e3860b2be4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-09-15 11:31:05 +02:00
Matthias Sohn 445a3a281d JGit 0.9.1
Change-Id: Ic411b1b8a7e6039ae3ff567e2c9cdd5db84f4d41
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-09-15 09:46:11 +02:00
Shawn O. Pearce 67263e2056 Refactor diff sequence API
Instead of making the sequence itself responsible for the equivalence
function, use an external function that is supplied by the caller.
This cleans up the code because we now say cmp.equals(a, ai, b, bi)
instead of a.equals(ai, b, bi).

This refactoring also removes the odd concept of creating different
types of sequences to have different behaviors for whitespace
ignoring.  Instead DiffComparator now supports singleton functions
that apply a particular equivalence algorithm to a type of sequence.

Change-Id: I559f494d81cdc6f06bfb4208f60780c0ae251df9
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-09-06 21:37:11 -05:00