Commit Graph

355 Commits

Author SHA1 Message Date
Robin Rosenberg 078a9f6066 Add symlink support to JGit
The change includes comparing symbolic links between disk and index,
adding symbolic links to the index, creating/modifying links on
checkout. The behavior is controlled by the core.symlinks setting, just
as C Git does. When a new repository is created core.symlinks will be
set depending on the capabilities of the operating system and Java
runtime.

If core.symlinks is set to true, the assumption is that symlinks are
supported, which may result in runtime errors if this turns out not to
be the case.

Measuring the cost of jgit status on a repository with ~70000 files,
of which ~30000 are tracked reveals a penalty of about 10% for using
the Java7 (really NIO2) support module.

Bug: 354367
Change-Id: I12f0fdd9d26212324a586896ef7eb1f6ff89c39c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-10 22:53:33 +01:00
Robin Rosenberg 4ceb25b602 Tag som non-localizable strings with NON-NLS
Change-Id: I6882c98c2785f38241a81ba5b93892aab79690a5
2014-01-10 14:06:50 +01:00
Robin Rosenberg ed7e1eff07 Suppport the GIT_CONFIG_NOSYSTEM environment variable
Change-Id: If3cc05931683d396b5ae2ea8952adceeb9a82ab9
2014-01-06 18:49:37 +01:00
Matthias Sohn 2a50e7065c [CLI] Add option --millis / -m to debug-show-dir-cache command
This is useful when comparing mtime displayed by 
    $ jgit debug-show-dir-cache -m
with mtime displayed by 
    $ git ls-files --debug 
or 
    $ stat "%m"

Change-Id: Id133ebe6f6093a56a6a6645e1c5bb18752fb2fd0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-12-27 12:22:47 +01:00
Jonathan Nieder f2abbd0ea9 archive: Prepend a specified prefix to all entry filenames
Common practice when distributing tarballs is to prefix all entries
with a single directory name so when the tarball is extracted it all
falls neatly into a single directory.  Add a setPrefix() method to
ArchiveCommand to support this.

Change-Id: I16b2832ef98c30977f6b77b646728b83d93c196f
Signed-off-by: Jonathan Nieder <jrn@google.com>
2013-12-17 11:22:46 -08:00
Matthias Sohn b14a939718 Prepare 3.3.0-SNAPSHOT builds
Change-Id: I7c7e7c1beec0c5d15b96c14c73ce93e3f09855c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-12-05 22:42:47 +01:00
Kaloyan Raev 7026658ac8 CLI status should support --porcelain
Add support for the machine-readable output format along with the
existing default long format.

Bug: 419968
Change-Id: I37fe5121b4c9dbae1106b1d18e9fdc134070a9dd
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
2013-12-04 11:13:27 +01:00
Axel Richard c95e4fb909 Manage CheckoutConflictException in pgm
Change-Id: I49f92bf7cafc80404f0bd07d62ff4b25e4db6e7c
Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-11-29 23:42:08 +01:00
Matthias Sohn b41b5d723e Add uses directives to ensure OSGi wires jgit bundles correctly
See
http://spring.io/blog/2008/10/20/understanding-the-osgi-uses-directive/

Bug: 420903
Change-Id: I3706a2b8f695d4ce0ee2333722ed7b8d31032f1e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-11-12 23:11:16 +01:00
Tomasz Zarna 52ce448662 Add missing resources from source.. in build.properties
Change-Id: Ief9b84c07494bdb01ce16b4ae3353c5364cc6625
Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
2013-10-30 17:42:38 +01:00
Kaloyan Raev 40e8ba4186 CLI fetch command should support --tags
Bug: 419638
Change-Id: I1dc99fd38e678e091a1d141d741328f0dec1756a
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2013-10-26 17:25:23 -04:00
Robin Rosenberg 057321731e Merge "Add describe command to JGit command line interface" 2013-10-20 12:31:25 -04:00
Kaloyan Raev 46c839abd5 CLI version command falls back to Bundle-Version
If the version command cannot read the Implementation-Version of the
containing JAR fall back to read the Bundle-Version header in
MANIFEST.MF. This makes the command working also from the
org.eclipse.jgit.pgm bundle and during development in a host IDE.

Bug: 419087
Change-Id: I4269d1cbd9bf9fd8be6fb4463aecc1c434aa387b
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-12 22:45:27 +02:00
Matthias Sohn 401212de7a Add describe command to JGit command line interface
Change-Id: I1560fd2be417361b3d2df15a27618053031bd873
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-11 00:52:11 +02:00
Matthias Sohn f3d323e9fe List all supported formats in archive command's help
Change-Id: I4bd271cb348914642069239853488f4960444746
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-10 23:36:07 +02:00
Robin Stocker ec56d0d82a Merge "Add support for --version in JGit CLI" 2013-10-10 07:53:57 -04:00
Kaloyan Raev 4d2378f41b Add resources/ as source folder in build.properties
This allows correct export of org.eclipse.jgit.pgm via the PDE Export
wizard.

Bug: 419089
Change-Id: I98765208edd7df59e262001dd01ed2b43e4475a9
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
2013-10-10 00:49:58 +03:00
Kaloyan Raev 2c969ea00b Add support for --version in JGit CLI
Bug: 419000
Change-Id: I43f5267182ea69d1f9abbff33136e0491c629071
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
2013-10-09 20:37:03 +03:00
Colby Ranger 5218f7b33a Propagate IOException where possible when getting refs.
Currently, Repository.getAllRefs() and Repository.getTags() silently
ignores an IOException and instead returns an empty map. Repository
is a public API and as such cannot be changed until the next major
revision change. Where possible, update the internal jgit APIs to
use the RefDatabase directly, since it propagates the error.

Change-Id: I4e4537d8bd0fa772f388262684c5c4ca1929dc4c
2013-10-07 11:32:54 -07:00
Matthias Sohn 7995d87713 Prepare 3.2.0-SNAPSHOT builds
Change-Id: Iac6cf7a5bb6146ee3fe38abe8020fc3fc4217584
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-03 18:21:31 +02:00
Matthias Sohn da6e87bc37 Prepare post 3.1.0 builds
Change-Id: I306a3d40c6ddb88a16d17f09a60e3d19b0716962
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-03 17:29:00 +02:00
Matthias Sohn 16ca725b35 JGit v3.1.0.201310021548-r
Change-Id: I2170b13047d5eab7565f47f9feb1680e03b1ba09
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-02 22:09:19 +02:00
Matthias Sohn 5a2a2222ef Prepare post 3.1.0 RC1 builds
Change-Id: I060f2082ccd0c91905b6b29a49cc633a0b51a1f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-27 15:54:40 +02:00
Matthias Sohn 6f0681eb9f JGit v3.1.0.201309270735-rc1
Change-Id: I48202dd461110da25f9bc159c938311fff0669e0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-27 13:34:51 +02:00
Matthias Sohn b4f07df357 Prepare re-signing pgm's ueberjar to avoid SecurityException
Since we now sign all build artifacts immediately after creating them
we need to re-sign the ueberjar created for jgit command line tool
because the signatures of the individual jars are invalidated when
repacking them into the ueberjar. Hence we need to exclude the
signatures of the individual jars when using maven-shade-plugin to
create the ueberjar.

Also install the shaded plugin into maven repository and exclude osgi
framework sources which were included unintentionally.

See http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02277.html

Change-Id: Ia302e68a4b2a9399cb18025274574e31d3d3e407
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-24 11:25:55 +02:00
Matthias Sohn 801aac579e Merge branch 'stable-3.0'
* stable-3.0:
  JGit v3.0.3.201309161630-r
  Add org.eclipse.jgit.java7.source to jgit source feature

Change-Id: I738afcfbc78ea1ac56d0d0ab7d4f7717167dd8dd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-17 15:08:55 +02:00
Matthias Sohn 85fae93539 JGit v3.0.3.201309161630-r
Change-Id: I73ff609ba681500394b5919f62cff9ec24a52756
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-16 22:40:52 +02:00
Matthias Sohn 4b8a848a47 Merge branch 'stable-3.0'
* stable-3.0:
  Prepare post 3.0.2 builds
  JGit v3.0.2.201311090911-r

Change-Id: I99a7d1072285646f7fcd4169225c1fd249ad5e37
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-11 23:30:05 +02:00
Matthias Sohn 3af38b4fee Prepare post 3.0.2 builds
Change-Id: Ie1bd951a2cb35d069c94dab4a62507115913764f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-11 16:54:32 +02:00
Matthias Sohn da3041ae73 JGit v3.0.2.201311090911-r
Change-Id: Ifaae2e3e2f1bb0504bf9e6d59983086ac19a540b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-11 15:15:00 +02:00
Matthias Sohn 01e793a3ff Add missing usage texts for JGit commandline commands
Also update help text for the merge command now supporting recursive
strategy as the default merge strategy.

Change-Id: I07886fe875c407e2244f562c003bb9d04f398026
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-09 22:54:52 +02:00
Matthias Sohn 4eefa881b3 Prepare post 3.0.2-rc2 builds
Change-Id: I0e4020326c6443ba7157c18b345160cf9e1e88a7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-04 19:34:56 +02:00
Matthias Sohn 7c37177952 JGit v3.0.2.201309041250-rc2
Change-Id: Ie18ced75f573f140969af2a7d9edb45c76523715
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-04 18:55:13 +02:00
Matthias Sohn fdd1ac930e Prepare 3.0.2-SNAPSHOT builds
Change-Id: I3287609a90f068017cc62f4fd7738651e0663081
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-08-19 01:39:41 +02:00
Colby Ranger ef7512b596 Add --quiet flag to pgm fetch.
Change-Id: If141fdc5c181b3a618b7e286ad3c6957211d0afc
2013-08-05 15:12:57 -07:00
Christian Halstrick 06dd0e9e27 Add path option to StatusCommand
Allow filtering of the status. Only files which match given paths are
inspected and only their state is reported.

Change-Id: I3c4b1b46bf297cd4ebdb4997cfa14c8752a36411
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2013-07-21 21:39:53 -05:00
Matthias Sohn f34e38f473 Move gc to package org.eclipse.jgit.pgm
All bugs reported for gc have been fixed and it seems we reached a
stable implementation.

Change-Id: I78a96ee2103beb48325da0f6ee10b2498bdc0267
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-06-22 00:57:26 +02:00
Robin Stocker 01ebfa6c17 Disable warning about assigning to parameter
See change I08bed4275af9ec52aa4d7054067ac82f6a3c9781, where fixing such
warning lead to complaints.

If fixing is not wanted, disable it instead.

Change-Id: If31d4028fa1c6377a11e83ed5688b45701cec68b
2013-06-15 15:11:54 +02:00
Matthias Sohn 6b9c0d1232 Prepare 3.1.0-SNAPSHOT builds
Change-Id: I7490a7c9558423c03e3c167ad55b9a98be9d99d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-06-13 16:13:32 +02:00
Matthias Sohn 01f6d91476 Prepare post 3.0.0.201306101825-r builds
Change-Id: I299cf1addc0987ffe39140d2216ab6a98e95ce52
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-06-13 15:48:41 +02:00
Matthias Sohn f384644774 JGit v3.0.0.201306101825-r
Change-Id: Ie8deab94c6263b5198f0bcb4533b1cfb3f5724b1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-06-11 00:56:27 +02:00
Jonathan Nieder 1153a59e38 Add support for "jgit archive --output=<filename>"
If the --format option is not given and the output filename is,
then infer the format from that filename.  Otherwise match
"git archive" by defaulting to tar (this is a change from the
existing "jgit archive" default behavior, which was to default to
zip).

Change-Id: I5806bc48a403d05e4cfc3c180b82b33ad7cfae7f
2013-06-06 18:39:07 -07:00
Matthias Sohn bf388c2e32 Prepare post 3.0.0 RC3 builds
Change-Id: I008d55e2ef0aac9d1877b05ba73e3cf26335d430
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-06-04 13:54:39 +02:00
Matthias Sohn a898836eac JGit v3.0.0.201306040240-rc3
Change-Id: I8b782e9ebe03e5f72611a21a76d80c6b20cb7845
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-06-04 09:02:36 +02:00
Jonathan Nieder 79583aeba7 Remove unused import in Archive
Change-Id: I0bc82e74f4acedb059322c29e13352151165ef7f
2013-05-29 12:35:13 -07:00
Jonathan Nieder 679382fb20 Move FormatActivator.start()/stop() to a separate class
This makes the functionality of registering all formats from the
org.eclipse.jgit.archive package available in contexts where
FormatActivator cannot be built because the OSGi core framework is not
readily available to build against.

Change-Id: If8e3487e933783a7e12f8e1838cbfe0b5862ce80
2013-05-29 12:34:04 -07:00
Matthias Sohn 0603519aad Prepare post 3.0.0-rc2 builds
Change-Id: Ic46832bcde80d0bf74c16cb094abd76b00552d14
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-05-29 10:37:17 +02:00
Jonathan Nieder 68d92182e6 Maintain list of archive formats in one place
Add a static start() method to FormatActivator to allow outside
classes such as the Archive subcommand of the jgit program to use it
without a BundleContext.  This way, the list of formats only has to be
maintained in one place.

While at it, build a list of registered formats at start() time, so
stop() doesn't have to repeat the same list of formats.

Suggested-by: Shawn Pearce <spearce@spearce.org>
Change-Id: I55cb3095043568740880cc9e4f7cde05f49c363c
2013-05-28 16:51:32 -07:00
Matthias Sohn 30fad6758f JGit v3.0.0.201305281830-rc2
Change-Id: I490ad8cc7590f70783d3fbd6dd6f0e0446ae5afe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-05-29 00:49:12 +02:00
Jonathan Nieder f99fa9d23e Release ArchiveCommand's ObjectReader in call()
Make call() release all private resources so instead of using a
pattern like

	ArchiveCommand cmd = git.archive();
	try {
		cmd.setTree(tree)
			. ...
			.call();
	} finally {
		cmd.release();
	}

callers can just use git.archive().setTree(tree)....call() directly.

This involves pushing more work out of parameter setters and into
call() so the ObjectReader is not allocated and potentially leaked
before then.

Change-Id: I699f703c6302696e1cc276d7ab8ee597d82f2c5d
2013-05-24 18:28:37 -07:00