]> source.dussan.org Git - jgit.git/log
jgit.git
11 years agoEnable LsRemoteCommand to work without local repository 26/14726/4
Robin Stocker [Sun, 21 Jul 2013 14:23:12 +0000 (16:23 +0200)]
Enable LsRemoteCommand to work without local repository

It's supported by C Git and can be useful.

Bug: 413388
Change-Id: I12c6c10e791cc09ee271d89eb8b8d32f53e385db
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd missing @since tag for replaceLineBreaksWithSpace 84/15384/1
Robin Stocker [Mon, 12 Aug 2013 19:34:50 +0000 (21:34 +0200)]
Add missing @since tag for replaceLineBreaksWithSpace

Change-Id: Ibd9d9ba609a2cd7707b985cdb07405dce0422aab
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoAllow the command line bundle to access internal jgit packages 96/13996/2
Matthias Sohn [Fri, 21 Jun 2013 23:11:25 +0000 (01:11 +0200)]
Allow the command line bundle to access internal jgit packages

Change-Id: Id1e11a21fdcbd8cb0f2f8c22e7ab253e8df65d2f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Recognize CRLF when parsing the short message of a commit or tag"
Robin Rosenberg [Sat, 10 Aug 2013 22:31:01 +0000 (18:31 -0400)]
Merge "Recognize CRLF when parsing the short message of a commit or tag"

11 years agoMerge "Added characters to be escaped in file name patterns"
Robin Rosenberg [Sat, 10 Aug 2013 21:32:20 +0000 (17:32 -0400)]
Merge "Added characters to be escaped in file name patterns"

11 years agoAdd missing @since tags 42/15042/9
Lars Vogel [Thu, 25 Jul 2013 21:28:05 +0000 (23:28 +0200)]
Add missing @since tags

Change-Id: I9754e2124c0fe6ad2dbde5597c3ed10f1c3efef5
Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdvertise capabilities with no refs in upload service. 53/15253/2
Colby Ranger [Thu, 8 Aug 2013 14:57:49 +0000 (07:57 -0700)]
Advertise capabilities with no refs in upload service.

With reference hiding, it is possible for a repository to appear
empty when all refs are hidden. This causes capabilities to not be
advertised either, since they are published with the first reference,
breaking fetch by SHA1 support.

Always advertise the capabilites by publishing the symbolic capabilities
reference when the repository has no references to advertise (similar to
the receive service).

Change-Id: I8060e430ee03571dc51239e702864c85e888505c

11 years agoAllow UploadPack requests with no options 27/15227/1
Shawn Pearce [Wed, 7 Aug 2013 22:43:58 +0000 (15:43 -0700)]
Allow UploadPack requests with no options

UploadPack can be invoked with no capabilities selected by the
client if the client is an ancient version of Git that nobody in
their right mind should still be using. Or if the client is very
broken and does not want to use any of the newer features added to
the protocol since its inception.

Change-Id: I3baa6f90e6a41a37a8eab8449a3cc41f4efcb91a

11 years agoAdd --quiet flag to pgm fetch. 49/15149/1
Colby Ranger [Mon, 5 Aug 2013 22:12:57 +0000 (15:12 -0700)]
Add --quiet flag to pgm fetch.

Change-Id: If141fdc5c181b3a618b7e286ad3c6957211d0afc

11 years agoSend no-progress option with NullProgressMonitor. 48/15148/1
Colby Ranger [Mon, 5 Aug 2013 21:33:55 +0000 (14:33 -0700)]
Send no-progress option with NullProgressMonitor.

The NullProgressMonitor does not report progress anywhere. Inform the
server not to send progress by enabling the no-progress capability.

Change-Id: Id18dbc754c814d1a5534a284c947030bf201c569

11 years agoMerge "Change RequestValidator parameter to ObjectId list"
Shawn Pearce [Fri, 2 Aug 2013 22:15:19 +0000 (18:15 -0400)]
Merge "Change RequestValidator parameter to ObjectId list"

11 years agoChange RequestValidator parameter to ObjectId list 98/14898/4
Greg Hill [Fri, 26 Jul 2013 19:08:31 +0000 (12:08 -0700)]
Change RequestValidator parameter to ObjectId list

Instead of RevObject list, this allows a custom request validator to be called
on SHA-1's corresponding to objects that may not exist in repository storage

Change-Id: I19bb667beff0d0c144150a61d7a1dc6c9703be7f
Signed-off-by: Greg Hill <greghill@google.com>
11 years agoAdd setter for ProgressMonitor to StatusCommand 76/14876/5
Christian Trutz [Thu, 25 Jul 2013 21:28:05 +0000 (23:28 +0200)]
Add setter for ProgressMonitor to StatusCommand

This is useful if Git.status() is a long running command.

Change-Id: I6bdbf347a688043d549c1f091fb4a264a6c7024e
Signed-off-by: Christian Trutz <christian.trutz@gmail.com>
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoImplement open(URIish) for TransportLocal 25/14725/2
Robin Stocker [Sun, 21 Jul 2013 14:10:54 +0000 (16:10 +0200)]
Implement open(URIish) for TransportLocal

Can be used for listing remote refs for a repository on the file system
without having a local repository.

Bug: 413400
Change-Id: I397f5092c5eafb62236e9f9e74d9183f56903cc6
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoFix NPE in openFetch on Transport without local repository 20/14720/3
Robin Stocker [Sat, 20 Jul 2013 14:26:05 +0000 (16:26 +0200)]
Fix NPE in openFetch on Transport without local repository

Setting the walk and other fields to null will result in NPEs when the
user e.g. calls fetch on the connection, but at least the advertised
refs can be read like that without having a local repository.

Bug: 413389
Change-Id: I39c8363e81a1c7e6cb3412ba88542ead669e69ed
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoAdd NON-NLS comments for some obviously untranslatable strings 52/12552/3
Robin Rosenberg [Mon, 6 May 2013 19:47:11 +0000 (21:47 +0200)]
Add NON-NLS comments for some obviously untranslatable strings

Change-Id: I2d1076b46695dac84961b8ae663bfc5cb123b3a3
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoUpdate reflog like C Git during rebase (non-interactive) 17/12517/5
Robin Rosenberg [Sun, 5 May 2013 23:39:25 +0000 (01:39 +0200)]
Update reflog like C Git during rebase (non-interactive)

Bug: 346350
Change-Id: I119766a00bc52a810c51cffaa19207cb8555ca22
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoImprove documentation of PathSuffixFilter 62/14562/2
Robin Stocker [Mon, 15 Jul 2013 15:20:53 +0000 (17:20 +0200)]
Improve documentation of PathSuffixFilter

Change-Id: I1077dbb1f10c7cc687c0d1b8a8e8f763ca96977c
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoAdd path option to StatusCommand 98/14698/3
Christian Halstrick [Fri, 19 Jul 2013 11:37:58 +0000 (13:37 +0200)]
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>
11 years agoFix MERGED_NOT_COMMITTED toString 65/14665/1
Robin Stocker [Thu, 18 Jul 2013 18:04:47 +0000 (20:04 +0200)]
Fix MERGED_NOT_COMMITTED toString

It had a typo (commited) and was not in the style of the others.

Change-Id: Ia1be1c70b13bb2f3da80c8e8239c5f254070fe60
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoTarFormat: use tabs for indent 29/14629/1
Dave Borowitz [Wed, 17 Jul 2013 19:57:35 +0000 (12:57 -0700)]
TarFormat: use tabs for indent

Change-Id: I2f4c285d2b2f4bdb7a5d1a1026c131417066410d

11 years agoClose unfinished archive entries on error 28/14628/1
Jonathan Nieder [Wed, 17 Jul 2013 19:19:12 +0000 (12:19 -0700)]
Close unfinished archive entries on error

Otherwise the underlying error is hidden by an "IOException: This
archives contains unclosed entries." when jgit tries to close the
archive.

Reported-by: Dave Borowitz <dborowitz@google.com>
Change-Id: I594dcdf366200b802e13e5a645fe06597feb7bb4
Signed-off-by: Jonathan Nieder <jrn@google.com>
11 years agoMerge "Add missing @since tags"
Matthias Sohn [Fri, 12 Jul 2013 22:09:22 +0000 (18:09 -0400)]
Merge "Add missing @since tags"

11 years agoMerge "Fix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter"
Christian Halstrick [Thu, 11 Jul 2013 06:32:37 +0000 (02:32 -0400)]
Merge "Fix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter"

11 years agoAdd missing @since tags 65/14465/1
Matthias Sohn [Wed, 10 Jul 2013 22:18:48 +0000 (00:18 +0200)]
Add missing @since tags

Change-Id: I6f672249d7ca014c63fb939cd0836689eb27ab90
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd tests for DirCacheCheckout and symlinks 42/14442/3
Christian Halstrick [Mon, 9 Jan 2012 15:15:12 +0000 (16:15 +0100)]
Add tests for DirCacheCheckout and symlinks

DirCacheCheckout had a bug when the parentdirectory of a worktree was a
symlink. DirCacheCheckout was deleting those symlinks under certain
conditions. This was fixed in I81735ba0394ef6794e9b2b8bdd8bd7e8b9c6460f
without a test because previously it was hard to setup tests containing
symlinks.

BUG: 412489
Change-Id: I2513166af519d6fc01d1eae3976ad6cff6f98530
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge changes If386fe25,I52a17499,Id12e7f00,I264e028a,I0d52af8a,I0d0cc4f8
Dave Borowitz [Wed, 10 Jul 2013 18:50:41 +0000 (14:50 -0400)]
Merge changes If386fe25,I52a17499,Id12e7f00,I264e028a,I0d52af8a,I0d0cc4f8

* changes:
  UploadPack: allow custom RequestValidator instances
  UploadPack: refactor want validation
  UploadPack: set RefFilter from TransportConfig
  UploadPack: configure RequestPolicy with TransportConfig
  UploadPack: advertise allow-tip-sha1-in-want
  Add RequestPolicy.TIP to allow fetching non-advertised ref tips

11 years agoMake sure checkout is not deleting folders outside the workingtree 35/4935/2
Christian Halstrick [Mon, 9 Jan 2012 15:15:12 +0000 (16:15 +0100)]
Make sure checkout is not deleting folders outside the workingtree

There was a chance that jgit deletes symbolic links which point to the
folder on top of the working tree. Make sure not to touch these
resources.

Thanks to Cedric Darloy who reported this bug on
http://www.eclipse.org/forums/index.php/m/776910/#msg_776910 and to
Ondrej Vrabec who reported bug 412489.

Bug: 412489
Change-Id: I81735ba0394ef6794e9b2b8bdd8bd7e8b9c6460f
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoUpdate to Jetty 7.6.11.v20130520 73/14373/1
Matthias Sohn [Thu, 4 Jul 2013 22:06:05 +0000 (00:06 +0200)]
Update to Jetty 7.6.11.v20130520

Change-Id: I76d32444c9cf9f086a013e410a88d37a359272fd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter 47/14347/2
Robin Stocker [Mon, 8 Jul 2013 08:51:52 +0000 (10:51 +0200)]
Fix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter

* It didn't check the first character in the pattern due to a off-by-one
  error. Spotted by James Roper.
* It returned true even when pattern was longer than current path, e.g.
  it returned that ".txt" is suffix of "txt".

Bug: 411999
Change-Id: I9fbcd68a11fb57cc49956b70c387a47271a0424f
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoRefactor PathSuffixFilterTest to remove duplication 57/14357/1
Robin Stocker [Mon, 8 Jul 2013 08:48:45 +0000 (10:48 +0200)]
Refactor PathSuffixFilterTest to remove duplication

Makes it possible to add new test cases without copying lots of lines.

Change-Id: I66db3bc0cbd18fb5a07748905c60384b86b1c162
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoCheck parentFile is not null 93/14293/1
Hiroshi Tomita [Fri, 5 Jul 2013 00:04:00 +0000 (09:04 +0900)]
Check parentFile is not null

parentFile becomes null when f is relative path, such as ".".

This patch avoids NullPointerException in such case.

Change-Id: I4752674b1daab6eedd7c3650c7749462810eaffd
Signed-off-by: Hiroshi Tomita <tomykaira@gmail.com>
11 years agoUploadPack: allow custom RequestValidator instances 03/14003/7
Dave Borowitz [Mon, 24 Jun 2013 00:28:34 +0000 (17:28 -0700)]
UploadPack: allow custom RequestValidator instances

Make the existing concrete implementations public as well so custom
implementations may delegate to them where appropriate. Treat all custom
implementations as providing allow-tip-sha1 in want.

Change-Id: If386fe25c0d3b4551a97c16a22350714453b03e9

11 years agoUploadPack: refactor want validation 02/14002/4
Dave Borowitz [Mon, 24 Jun 2013 00:02:29 +0000 (17:02 -0700)]
UploadPack: refactor want validation

Associate each RequestPolicy with an implementation of a
RequestValidator interface that contains the validation logic. The
checkWants method is only called if there are wants that were not
advertised, since clients may always request any advertised want
according to the git protocol. Calling the method only once at the
end of parsing the want list also means policy implementations can be
stateful, unlike the previous switch statement inside a loop.

For the special handling of unidirectional pipes, simply check
isBiDirectional() and delegate to other implementations if necessary.

Change-Id: I52a174999ac3a5aca46d3469cb0b81edd1710580

11 years agoUploadPack: set RefFilter from TransportConfig 00/13900/7
Dave Borowitz [Tue, 18 Jun 2013 23:41:58 +0000 (16:41 -0700)]
UploadPack: set RefFilter from TransportConfig

Teach TransportConfig to respect uploadpack.hiderefs, which is new in
C git 1.8.2.

Change-Id: Id12e7f00b9a60258e996410f67fa10616459f53f

11 years agoUploadPack: configure RequestPolicy with TransportConfig 99/13899/7
Dave Borowitz [Tue, 18 Jun 2013 22:31:17 +0000 (15:31 -0700)]
UploadPack: configure RequestPolicy with TransportConfig

C git 1.8.2 supports setting the equivalent of RequestPolicy.TIP with
uploadpack.allowtipsha1. Parse this into TransportConfig and use it
from UploadPack. An explicitly set RequestPolicy overrides the config,
and the policy may still be upgraded on a unidirectional connection to
avoid races.

Defer figuring out the effective RequestPolicy to later in the
process. This is a minor semantic change to fix a bug: previously,
calling setRequestPolicy(ADVERTISED) _after_ calling
setBiDirectionalPipe(true) would have reintroduced the race condition
otherwise fixed by 01888db892aa9590862d886c01f3b293140db153.

Change-Id: I264e028a76574434cecb34904d9f5944b290df78

11 years agoUploadPack: advertise allow-tip-sha1-in-want 98/13898/7
Dave Borowitz [Tue, 18 Jun 2013 22:07:19 +0000 (15:07 -0700)]
UploadPack: advertise allow-tip-sha1-in-want

This protocol capability, new in C git 1.8.2, corresponds to
RequestPolicy.TIP, so advertise it if that request policy was set.

Change-Id: I0d52af8a7747e951a87f060a5124f822ce1b2b26

11 years agoAdd RequestPolicy.TIP to allow fetching non-advertised ref tips 97/13897/6
Dave Borowitz [Tue, 18 Jun 2013 21:58:44 +0000 (14:58 -0700)]
Add RequestPolicy.TIP to allow fetching non-advertised ref tips

Users of UploadPack may set a custom RefFilter or AdvertisedRefsHook
that limits which refs are advertised, but clients may learn of a
SHA-1 that the server should have as a ref tip through some
alternative means. Support serving such objects from the server side
with a new RequestPolicy.

As with ADVERTISED, we need a special relaxed RequestPolicy to allow
commits reachable from the set of valid tips for unidirectional
connections.

Change-Id: I0d0cc4f8ee04d265e5be8221b9384afb1b374315

11 years agoMerge "Update HEAD in cherry-picking several commits"
Robin Stocker [Tue, 2 Jul 2013 11:12:32 +0000 (07:12 -0400)]
Merge "Update HEAD in cherry-picking several commits"

11 years agoUse a bucket sort for PackReverseIndex. 54/14154/3
Colby Ranger [Fri, 28 Jun 2013 17:37:56 +0000 (10:37 -0700)]
Use a bucket sort for PackReverseIndex.

Previously it took 1200ms to create a reverse index (sorted by offset).
Using a simple bucket sort algorithm, that time is reduced to 450ms.
The bucket index into the offset array is kept, in order to decrease
the binary search window.

Don't keep a copy of the offsets. Instead, use nth position
to lookup the offset in the PackIndex.

Change-Id: If51ab76752622e04a4430d9a14db95ad02f5329d

11 years agoUpdate HEAD in cherry-picking several commits 64/14164/3
Hiroshi Tomita [Sun, 30 Jun 2013 16:07:10 +0000 (01:07 +0900)]
Update HEAD in cherry-picking several commits

Without update, index is wrongly detected to be dirty
when picking the second commit.

Change-Id: Idf47ecb33e8bd38340d760806d629f67be92d2d5
Signed-off-by: Hiroshi Tomita <tomykaira@gmail.com>
Bug: 411963

11 years agoImplement get nth offset in PackIndex. 53/14153/2
Colby Ranger [Fri, 28 Jun 2013 21:02:26 +0000 (14:02 -0700)]
Implement get nth offset in PackIndex.

Currently, the offset can only be retrieved by ObjectId or iterating all
of the entries. Add a method to lookup the offset by position in the
index sorted by SHA1.

Change-Id: I45e9ac8b752d1dab47b202753a1dcca7122b958e

11 years agoMerge "Add missing @since tag"
Matthias Sohn [Wed, 26 Jun 2013 23:35:42 +0000 (19:35 -0400)]
Merge "Add missing @since tag"

11 years agoMerge "Move gc to package org.eclipse.jgit.pgm"
Christian Halstrick [Mon, 24 Jun 2013 09:32:59 +0000 (05:32 -0400)]
Merge "Move gc to package org.eclipse.jgit.pgm"

11 years agoFix HTTP response processing for WWW-Authenticate headers 85/13285/2
Alex Rukhlin [Wed, 6 Mar 2013 21:35:52 +0000 (16:35 -0500)]
Fix HTTP response processing for WWW-Authenticate headers

The original code was able to process only one WWW-Authenticate
header in an HTTP response, and if this header was not one of
two expected, authentication failed regardless of that there
could be other headers in the response.

All WWW-Authenticate headers in an HTTP response have to be
browsed to find one of supported, i.e. Basic or Digest.
By that if both are present, the Digest one should be used
as more preferable.

Bug: 357719
Change-Id: Icf601a41fec63f7d40308f3c85aaa4f71a7c095b
Signed-off-by: Alex Rukhlin <arukhlin@microsoft.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoDon't skip want validation when the client sends no haves 97/13997/1
Dave Borowitz [Fri, 21 Jun 2013 23:14:30 +0000 (16:14 -0700)]
Don't skip want validation when the client sends no haves

Change-Id: I5e80b3befca5cf1dcb06075862d6d48e6491cc0f

11 years agoMove gc to package org.eclipse.jgit.pgm 95/13995/1
Matthias Sohn [Fri, 21 Jun 2013 22:57:26 +0000 (00:57 +0200)]
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>
11 years agoAdd missing @since tag 43/13943/1
Matthias Sohn [Thu, 20 Jun 2013 07:52:11 +0000 (09:52 +0200)]
Add missing @since tag

Change-Id: I80cfc3e81d5cebf810f36ddf2760aee955c6f50a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRemove fix-headers and rewrite-history 38/13938/1
Shawn Pearce [Wed, 19 Jun 2013 22:29:15 +0000 (15:29 -0700)]
Remove fix-headers and rewrite-history

These scripts were created to bootstrap the initial contribution for
Eclipse using information from the pre-Eclipse history. We are well
past the point where the project will rewrite history in order to
correct copyright statements, so these tools no longer make sense
to keep in the tip of the tree.

Change-Id: If68419ead0766035d17a21a53a3e5e761eaa70c4

11 years agoAdd a method to DfsOutputStream to read as an InputStream 21/12421/5
Dave Borowitz [Tue, 30 Apr 2013 21:40:11 +0000 (14:40 -0700)]
Add a method to DfsOutputStream to read as an InputStream

Change-Id: I0ec1f17a88bc14f22c10f9bc8d6f5b5118410e3a

11 years agoAdd the other test launchers as favorites 46/13846/2
Robin Rosenberg [Sun, 16 Jun 2013 10:03:04 +0000 (12:03 +0200)]
Add the other test launchers as favorites

The user may not see them otherwise

Change-Id: I43b7c0172870a9446cfb35c7b3fee6394f3292e3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix tests for OS X when the tmpdir is the default /tmp 45/13845/2
Robin Rosenberg [Sun, 16 Jun 2013 10:02:14 +0000 (12:02 +0200)]
Fix tests for OS X when the tmpdir is the default /tmp

/tmp is a symbolic link and some tests break when the path
gets canonicalized by JGit or Jetty. Allow Jetty to serve
symlinks by setting init parameter "aliases" to true [1].

[1] http://wiki.eclipse.org/Jetty/Howto/How_to_serve_symbolically_linked_files

Change-Id: I45359a40435e8a33def6e0bb6784b4d8637793ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix running maven http tests on OS X 44/13844/2
Robin Rosenberg [Sun, 16 Jun 2013 09:28:36 +0000 (11:28 +0200)]
Fix running maven http tests on OS X

In 36144e12d8 tests were changed to use the system tmp directory as defined
by java.io.tmpdir, which was then overridden in the pom files to usea custom
directory that made som tests work, but not all.

Change-Id: I2fa04878f8830ad9c9b32a6f3fe8d2e2d66fe411

11 years agoDisable warning about assigning to parameter 62/12962/3
Robin Stocker [Sat, 18 May 2013 10:47:27 +0000 (12:47 +0200)]
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

11 years agoRecognize CRLF when parsing the short message of a commit or tag 67/11567/5
Robin Rosenberg [Sat, 30 Mar 2013 10:03:33 +0000 (11:03 +0100)]
Recognize CRLF when parsing the short message of a commit or tag

Bug: 400707
Change-Id: I9b09bb88528af465018fc0278f5441f7e6b75986

11 years agoAdd missing @since tags 34/13834/1
Matthias Sohn [Fri, 14 Jun 2013 23:10:33 +0000 (01:10 +0200)]
Add missing @since tags

Change-Id: I7f2c155cab4b5be55f7e849ff2595c8c5d804f05
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "document empty blocks in StashApplyCommandTest"
Matthias Sohn [Fri, 14 Jun 2013 22:57:59 +0000 (18:57 -0400)]
Merge "document empty blocks in StashApplyCommandTest"

11 years agodocument empty blocks in StashApplyCommandTest 44/12544/2
Tomasz Zarna [Mon, 6 May 2013 17:27:42 +0000 (19:27 +0200)]
document empty blocks in StashApplyCommandTest

Change-Id: I5b49bd00b00b86584b912fc5f503abf29db0f56e

11 years agoPrepare 3.1.0-SNAPSHOT builds 99/13799/1
Matthias Sohn [Thu, 13 Jun 2013 13:54:22 +0000 (15:54 +0200)]
Prepare 3.1.0-SNAPSHOT builds

Change-Id: I7490a7c9558423c03e3c167ad55b9a98be9d99d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge branch 'stable-3.0' 98/13798/1
Matthias Sohn [Thu, 13 Jun 2013 13:51:16 +0000 (15:51 +0200)]
Merge branch 'stable-3.0'

* stable-3.0:
  Prepare post 3.0.0.201306101825-r builds
  JGit v3.0.0.201306101825-r
  Make JGit test work with both hamcrest 1.1 (juno) and 1.3 (kepler)
  Fix version.sh to not overwrite ${project.version}
  Prepare post 3.0.0 RC3 builds
  JGit v3.0.0.201306040240-rc3

Change-Id: I5b1db1f5b69bad1136dd21b956e798f63b1ba0ee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare post 3.0.0.201306101825-r builds 92/13792/1
Matthias Sohn [Thu, 13 Jun 2013 13:47:43 +0000 (15:47 +0200)]
Prepare post 3.0.0.201306101825-r builds

Change-Id: I299cf1addc0987ffe39140d2216ab6a98e95ce52
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v3.0.0.201306101825-r 17/13717/2 v3.0.0.201306101825-r
Matthias Sohn [Mon, 10 Jun 2013 22:28:11 +0000 (00:28 +0200)]
JGit v3.0.0.201306101825-r

Change-Id: Ie8deab94c6263b5198f0bcb4533b1cfb3f5724b1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix warnings in ArchiveCommand 69/13669/2
Matthias Sohn [Sun, 9 Jun 2013 21:35:41 +0000 (23:35 +0200)]
Fix warnings in ArchiveCommand

- remove unnecessary imports
- fix NLS warnings
- add missing Javadoc tag

Bug: 410354
Change-Id: I2b78a2c0e92c740bed80558b17a2100c1c884416
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMake JGit test work with both hamcrest 1.1 (juno) and 1.3 (kepler) 61/13161/3
Robin Rosenberg [Sun, 26 May 2013 20:07:24 +0000 (22:07 +0200)]
Make JGit test work with both hamcrest 1.1 (juno) and 1.3 (kepler)

The hamcrest library has moved things around. This problem applies only
to the test, not plugin runtime.

Change-Id: I5b97f356d8595dbdc9e91d157558e40561a6a30d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd support for "jgit archive --output=<filename>" 34/13634/1
Jonathan Nieder [Fri, 7 Jun 2013 01:32:10 +0000 (18:32 -0700)]
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

11 years agoPick default archive format based on filename suffix 09/13609/3
Jonathan Nieder [Fri, 7 Jun 2013 01:39:04 +0000 (18:39 -0700)]
Pick default archive format based on filename suffix

Introduce a setFilename() method for ArchiveCommand so callers can
specify the intended filename of the produced archive.  If the
filename ends with .tar, the format will default to tar; if .zip, zip;
if .tar.gz, gzip-compressed tar; and so on.

This doesn't affect "jgit archive" because it doesn't support the
--output=<file> option yet.  A later patch might do that.

Change-Id: Ic0236a70f7aa7f2271c3ef11083b21ee986b4df5

11 years agoAdd long filename, large file, and non-ASCII filename support to TarFormat 33/13633/1
Jonathan Nieder [Thu, 6 Jun 2013 19:31:46 +0000 (12:31 -0700)]
Add long filename, large file, and non-ASCII filename support to TarFormat

Attempts to write entries with too-long filenames currently error out:

  $ jgit.pgm/target/jgit archive HEAD >test.tar
  java.lang.RuntimeException: file name 'org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java' is too long ( > 100 bytes)
          at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.putArchiveEntry(TarArchiveOutputStream.java:288)
          at org.eclipse.jgit.archive.TarFormat.putEntry(TarFormat.java:92)
          at org.eclipse.jgit.archive.TarFormat.putEntry(TarFormat.java:62)
          at org.eclipse.jgit.api.ArchiveCommand.writeArchive(ArchiveCommand.java:293)
          at org.eclipse.jgit.api.ArchiveCommand.call(ArchiveCommand.java:322)
          at org.eclipse.jgit.pgm.Archive.run(Archive.java:97)
          at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:174)
          at org.eclipse.jgit.pgm.Main.execute(Main.java:213)
          at org.eclipse.jgit.pgm.Main.run(Main.java:121)
          at org.eclipse.jgit.pgm.Main.main(Main.java:95)

That's because the default longFileMode is LONGFILE_ERROR, which
throws an exception for filenames longer than 100 characters.  Switch
to LONGFILE_POSIX.  While at it, handle large files and filenames with
strange encodings, too.

This requires commons compress 1.4, which introduced support for large
files and POSIX long filenames.

Change-Id: I04d5427eec0968b129f55d7a4c6021039a494828

11 years agoAdd tbz2 archive format 08/13608/1
Jonathan Nieder [Thu, 6 Jun 2013 02:12:37 +0000 (19:12 -0700)]
Add tbz2 archive format

Change-Id: Idb7ff75877a0cfe23f47e10e3f6f93386f5bb145

11 years agoFix version.sh to not overwrite ${project.version} 65/13565/1
Matthias Sohn [Tue, 4 Jun 2013 11:58:24 +0000 (13:58 +0200)]
Fix version.sh to not overwrite ${project.version}

Change-Id: If5ae792581170bcba2dc1860012cbe389d8e9f24
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare post 3.0.0 RC3 builds 51/13551/1
Matthias Sohn [Tue, 4 Jun 2013 11:39:42 +0000 (13:39 +0200)]
Prepare post 3.0.0 RC3 builds

Change-Id: I008d55e2ef0aac9d1877b05ba73e3cf26335d430
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v3.0.0.201306040240-rc3 29/13529/1 v3.0.0.201306040240-rc3
Matthias Sohn [Tue, 4 Jun 2013 06:43:04 +0000 (08:43 +0200)]
JGit v3.0.0.201306040240-rc3

Change-Id: I8b782e9ebe03e5f72611a21a76d80c6b20cb7845
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoInclude o.e.j.archive into o.e.jgit feature 67/13467/1
Matthias Sohn [Sat, 1 Jun 2013 23:56:20 +0000 (01:56 +0200)]
Include o.e.j.archive into o.e.jgit feature

Also the pgm feature should depend on the jgit feature to ensure that
all needed bundles are available.

Change-Id: I670e8262cdace4323d3883717efe4b5e5e06f4c7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoUpdate build to use Tycho 0.18 66/13466/2
Matthias Sohn [Sat, 1 Jun 2013 22:26:59 +0000 (00:26 +0200)]
Update build to use Tycho 0.18

Change-Id: I66ffb2b6416dbbd5da11ad789dd58060b7ab09f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd jgit target platform to define dependencies more precisely 65/13465/4
Matthias Sohn [Fri, 31 May 2013 22:36:17 +0000 (00:36 +0200)]
Add jgit target platform to define dependencies more precisely

Avoid that the packaging build picks an older jgit version coming with
eclipse platform by using a target platform which allows to define the
dependencies more precisely.

Change-Id: I39bba3baa4517e2b5e5fe0de096e756f2904e3e9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix javadoc of FormatActivator 64/13464/3
Matthias Sohn [Sat, 1 Jun 2013 21:54:24 +0000 (23:54 +0200)]
Fix javadoc of FormatActivator

Change-Id: I64b32f71df2964da4cb2de73b34bf7e455ab5b93
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix version of dependency to package org.osgi.framework 63/13463/1
Matthias Sohn [Sat, 1 Jun 2013 21:39:52 +0000 (23:39 +0200)]
Fix version of dependency to package org.osgi.framework

OSGi 4.01 comes with package org.osgi.framework version 1.3 [1] which
has the BundleActivator interface needed by org.eclipse.jgit.archive.
OSGi 5.0 matches package org.osgi.framework version 1.7 [2].

[1] http://www.osgi.org/javadoc/r4v401/
[2] http://www.osgi.org/javadoc/r5/core/

Change-Id: I10f78e5eb02b5d03395f23d2f0ad039caf565269
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd missing javadoc for archive code 54/13354/2
Jonathan Nieder [Wed, 29 May 2013 17:42:35 +0000 (10:42 -0700)]
Add missing javadoc for archive code

Document archive formats, the archive format interface, and the
parameters of the GitAPIException constructors.  Noticed by eclipse.

Reported-by: Dani Megert <Daniel_Megert@ch.ibm.com>
Change-Id: I22b5f9d4c0358bbe867c1906feec7c279e214273

11 years agoRemove unused import in Archive 53/13353/2
Jonathan Nieder [Wed, 29 May 2013 17:47:56 +0000 (10:47 -0700)]
Remove unused import in Archive

Change-Id: I0bc82e74f4acedb059322c29e13352151165ef7f

11 years agoDrop unnecessary "throws" clauses in archive code 52/13352/2
Jonathan Nieder [Wed, 29 May 2013 17:45:41 +0000 (10:45 -0700)]
Drop unnecessary "throws" clauses in archive code

Noticed by eclipse.

Change-Id: I730b290556066038efeaf2436de95415b175f351

11 years agoMove FormatActivator.start()/stop() to a separate class 69/13369/1
Jonathan Nieder [Wed, 29 May 2013 19:33:44 +0000 (12:33 -0700)]
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

11 years agoMerge branch 'stable-3.0' 33/13333/1
Matthias Sohn [Wed, 29 May 2013 10:27:50 +0000 (12:27 +0200)]
Merge branch 'stable-3.0'

* stable-3.0:
  Prepare post 3.0.0-rc2 builds
  JGit v3.0.0.201305281830-rc2
  Support refspecs with wildcard in middle (not only at end)
  Fix multiple bugs in RawSubStringPattern used by MessageRevFilter
  Handle short branch/tag name for setBranch in CloneCommand
  Add missing Bundle-Localization header
  Apply tree filter marks when pairing DiffEntry for renames
  Improve feature names to become understandable by end users
  Update kepler orbit version to R20130517111416
  Fix BatchRefUpdate progress-monitoring so it doesn't count twice
  Fix AnyObjectId's generic type declaration of Comparable
  Fix DiffFormatter NPEs for DiffEntry without content change
  Fix CommitCommand not to destroy repo
  Fix the parameters to an exception
  Prepare post 3.0.0 M7 builds
  JGit v3.0.0.201305080800-m7

Change-Id: Ia8441c9796f01497e0d90e672c0aaf60520a0098
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare post 3.0.0-rc2 builds 20/13320/1
Matthias Sohn [Wed, 29 May 2013 08:36:51 +0000 (10:36 +0200)]
Prepare post 3.0.0-rc2 builds

Change-Id: Ic46832bcde80d0bf74c16cb094abd76b00552d14
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd tgz and txz archive formats 95/13295/5
Jonathan Nieder [Tue, 28 May 2013 23:51:39 +0000 (16:51 -0700)]
Add tgz and txz archive formats

Change-Id: I347e8a9a112d142ccef91cba1d6e997d645ca70a

11 years agoMaintain list of archive formats in one place 07/13307/3
Jonathan Nieder [Tue, 28 May 2013 23:51:32 +0000 (16:51 -0700)]
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

11 years agoJGit v3.0.0.201305281830-rc2 04/13304/1 v3.0.0.201305281830-rc2
Matthias Sohn [Tue, 28 May 2013 22:49:12 +0000 (00:49 +0200)]
JGit v3.0.0.201305281830-rc2

Change-Id: I490ad8cc7590f70783d3fbd6dd6f0e0446ae5afe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoSupport refspecs with wildcard in middle (not only at end) 81/12681/4
Robin Stocker [Sat, 4 May 2013 14:43:51 +0000 (16:43 +0200)]
Support refspecs with wildcard in middle (not only at end)

The following refspec, which can be used to fetch GitHub pull requests,
is supported by C Git but was not yet by JGit:

  +refs/pull/*/head:refs/remotes/origin/pr/*

The reason is that the wildcard in the source is in the middle.

This change also includes more validation (e.g. "refs//heads" is not
valid) and test cases.

Bug: 405099
Change-Id: I9bcef7785a0762ed0a98ca95a0bdf8879d5702aa

11 years agoFix multiple bugs in RawSubStringPattern used by MessageRevFilter 42/13242/2
Robin Stocker [Mon, 27 May 2013 18:56:31 +0000 (20:56 +0200)]
Fix multiple bugs in RawSubStringPattern used by MessageRevFilter

* Match at end of input was not handled correctly.
* When more than one character matched but not all, the next character
  was not considered as a match start (e.g. pattern "abab" didn't match
  input "abaabab").

Bug: 409144
Change-Id: Ia44682c618bfbb927f5567c194227421d222a160
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoHandle short branch/tag name for setBranch in CloneCommand 53/13153/2
Robin Stocker [Sat, 25 May 2013 13:56:50 +0000 (15:56 +0200)]
Handle short branch/tag name for setBranch in CloneCommand

Before, it was not clear from the documentation what kind of branch name
was accepted. Users specifying "branch" (instead of "refs/heads/branch")
got no error message and ended up with a repository without HEAD and no
checkout.

With this, CloneCommand now tries "$branch", then "refs/heads/$branch"
and then "refs/tags/$branch". C Git only does the last two, but for
compatibility we should still allow "refs/heads/branch".

Bug: 390994
Change-Id: I4be13144f2a21a6583e0942f0c7c40da32f2247a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd missing Bundle-Localization header 55/13155/1
Matthias Sohn [Sat, 25 May 2013 22:52:57 +0000 (00:52 +0200)]
Add missing Bundle-Localization header

Change-Id: I6831ad417f069127b4705fdd909844ec72065527
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRelease ArchiveCommand's ObjectReader in call() 48/13148/1
Jonathan Nieder [Sat, 25 May 2013 01:24:53 +0000 (18:24 -0700)]
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

11 years agoMove ArchiveCommand into standard porcelain API 62/12262/10
Jonathan Nieder [Sat, 25 May 2013 00:30:18 +0000 (17:30 -0700)]
Move ArchiveCommand into standard porcelain API

Allow use of ArchiveCommand without depending on the jgit command-line
tools.

To avoid complicating the process of installing and upgrading JGit,
this does not add a dependency by the org.eclipse.jgit bundle on
commons-compress.  Instead, the caller is responsible for registering
any formats they want to use by calling ArchiveCommand.registerFormat.

This patch puts functionality that requires an archiver into a
separate org.eclipse.jgit.archive bundle for people who want it.  One
can use it by calling ArchiveCommand.registerFormat directly to
register its formats or by relying on OSGi class loading to load
org.eclipse.jgit.archive.FormatActivator, which takes care of
registration automatically.

Once the appropriate formats are registered, you can make a tar or zip
from a git tree object as follows:

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

Change-Id: I418e7e7d76422dc6f010d0b3b624d7bec3b20c6e

11 years agoRemove dependency by ArchiveCommand on archive formats 63/12563/4
Jonathan Nieder [Fri, 24 May 2013 23:57:10 +0000 (16:57 -0700)]
Remove dependency by ArchiveCommand on archive formats

Provide static registerFormat and unregisterFormat methods to allow
formats to register themselves without the ArchiveCommand code being
aware of them.

Register the basic "zip" and "tar" support at bundle activation time
(and deregister them when unloading the bundle).  For anyone using
this code as an OSGi plugin it should continue to just work.

The jgit program does not load org.eclipse.jgit.pgm as an OSGi bundle,
so let the Archive command register the formats it uses explicitly
with registerFormat.

Change-Id: Id39c03ea6923d0aed8316ed7b6bd04d5ced570a7

11 years agoApply tree filter marks when pairing DiffEntry for renames 69/12969/2
Robin Stocker [Sun, 19 May 2013 13:19:35 +0000 (15:19 +0200)]
Apply tree filter marks when pairing DiffEntry for renames

When using a RenameDetector to generate new DiffEntries after using
DiffEntry.scan, the treeFilterMarks of the original entries were lost.
Now it combines the marks from src and dst.

See EGit bug 335082 where this is used.

Change-Id: I72b34b10ca12e3a6bd10ce44f4fa05b193fc52cc

11 years agoDrop dependency by ArchiveCommand.Format interface on commons-compress 62/12562/4
Jonathan Nieder [Thu, 23 May 2013 23:53:57 +0000 (16:53 -0700)]
Drop dependency by ArchiveCommand.Format interface on commons-compress

Otherwise, anyone trying to implement a new format would have to
depend on commons-compress, even if using a different underlying
library to write the archive.

Change-Id: I301a1997e3b48aa7e32d693fd8f4b2d436c9b3a7

11 years agoArchiveCommand.Format: pass output stream as first argument to putEntry 00/13100/2
Jonathan Nieder [Thu, 23 May 2013 23:46:29 +0000 (16:46 -0700)]
ArchiveCommand.Format: pass output stream as first argument to putEntry

This is more consistent with other APIs where the output side is the
first parameter to be analagous to the left-hand side of an
assignment.

Change-Id: Iec46bd50bc973a38b77d8367296adf5474ba515f

11 years agoArchiveCommand: make archive formats non-inner classes 61/12561/7
Jonathan Nieder [Fri, 24 May 2013 01:08:35 +0000 (18:08 -0700)]
ArchiveCommand: make archive formats non-inner classes

First step toward making ArchiveCommand itself format-agnostic.

Change-Id: I3cff5fce28fa7a19e34f8291cfb5b62f16429713

11 years agoRemove unused import in UploadPack 93/13093/1
Shawn Pearce [Thu, 23 May 2013 20:10:03 +0000 (13:10 -0700)]
Remove unused import in UploadPack

Change-Id: I9304cb3a6502ceb0cba21eb841e466f932ab3c01

11 years agoUse NullOutputStream not DisabledOutputStream in UploadPack 91/13091/1
Shawn Pearce [Thu, 23 May 2013 20:07:03 +0000 (13:07 -0700)]
Use NullOutputStream not DisabledOutputStream in UploadPack

The stream should not throw IllegalStateException if it is off.
Flush the stream after the hook runs, in case any messages need
to be sent ahead of the pack.

Change-Id: I21c7a0258ab1308406d226293fa0e7da69b4f57b

11 years agoAllow PreUploadHook.onSendPack to send messages to the client 60/13060/1
Shawn Pearce [Wed, 22 May 2013 19:12:52 +0000 (12:12 -0700)]
Allow PreUploadHook.onSendPack to send messages to the client

Before transmitting to the client a hook may want to send along
a text message ahead of the pack, such as a "message of the day".
Enable this usage by mirroring the message sending API from
ReceivePack on the UploadPack instance, using the side band.

Change-Id: I31cd254a4ddb816641397a3e9c2c20212471c37f

11 years agoImprove feature names to become understandable by end users 17/13017/2
Matthias Sohn [Tue, 21 May 2013 12:54:39 +0000 (14:54 +0200)]
Improve feature names to become understandable by end users

This was requested in [1].

[1] http://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg08981.html

Change-Id: I9764961a651c1fa64042098d60da9b496453f703
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>