]> source.dussan.org Git - jgit.git/log
jgit.git
12 years agoSupport gitdir: refs in BaseRepositoryBuilder.findGitDir 39/6139/2
Kevin Sawicki [Thu, 10 May 2012 20:32:16 +0000 (13:32 -0700)]
Support gitdir: refs in BaseRepositoryBuilder.findGitDir

This allows findGitDir to be used for repositories containing
a .git file with a gitdir: ref to the repository's directory
such as submodule repositories that point to a folder under the
parent repository's .git/modules folder

Change-Id: I2f1ec7215a2208aa90511c065cadc7e816522f62
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoMerge "Relax RevisionSyntaxException to an IllegalArgumentException" into stable-2.0
Christian Halstrick [Mon, 4 Jun 2012 15:05:32 +0000 (11:05 -0400)]
Merge "Relax RevisionSyntaxException to an IllegalArgumentException" into stable-2.0

12 years agoMerge "Only increment mod count if packed-refs file changes" into stable-2.0
Shawn Pearce [Mon, 4 Jun 2012 14:44:10 +0000 (10:44 -0400)]
Merge "Only increment mod count if packed-refs file changes" into stable-2.0

12 years agoRelax RevisionSyntaxException to an IllegalArgumentException 28/6128/3
Robin Rosenberg [Sat, 26 May 2012 08:07:18 +0000 (10:07 +0200)]
Relax RevisionSyntaxException to an IllegalArgumentException

Change-Id: Ide46eeb6cddcf3111f7c237ba8425a0854a90bfd

12 years agoAdd lazy loading of body for tags to PlotWalk 50/6150/3
Stefan Lay [Fri, 11 May 2012 09:18:36 +0000 (11:18 +0200)]
Add lazy loading of body for tags to PlotWalk

This change is required by egit's lazy loading of the body in the
history view when the walk is started with setRetainBody(false).

Change-Id: I9291ba8c34c8744bc009b1bd302ed28bfa4e9476
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
12 years agoSet minimum Jetty version to 7.6 29/6229/1
Matthias Sohn [Sun, 3 Jun 2012 21:54:12 +0000 (23:54 +0200)]
Set minimum Jetty version to 7.6

This reverts commit 0c6e7d71273b2b899f35e974d5a1463ce110fa7e which
didn't work since package imports need to be different with Jetty 7.5
and 7.6. Jetty 7.6 can be installed into Eclipse SDK 3.7.2 so rather
require Jetty 7.6 instead of adding a lot of reflective code to
workaround these incompatible changes.

Change-Id: I7eb6413ecf2bc4ad7bef0c70cde45ae3fde02b2f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoFix compile error when using Jetty 7.5 27/6227/1
Matthias Sohn [Sun, 3 Jun 2012 07:30:03 +0000 (09:30 +0200)]
Fix compile error when using Jetty 7.5

Class Constraint was moved from package org.eclipse.jetty.http.security
in Jetty 7.5 to package org.eclipse.jetty.util.security in Jetty 7.6.
Hence also import package org.eclipse.jetty.security, then also Jetty
7.5, coming with Indigo, can be used to run JGit HTTP tests.

Change-Id: I26c38ec9f51b0a4fb62e1aa9f2266ada7bb2fa0c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoRevert Jetty from 8.1.3.v20120416 to 7.6.0.v20120127 13/6213/4
Matthias Sohn [Sun, 3 Jun 2012 06:32:38 +0000 (08:32 +0200)]
Revert Jetty from 8.1.3.v20120416 to 7.6.0.v20120127

This reverts commit 24a0f47e32ab7cdf20c2201d7100599ea057f8a3 and
updates JGit dependencies to use the latest available Jetty 7.x
release. We can't use Jetty 8.x since it depends on Servlet API 3.0
which requires Java 6 but JGit still wants to support Java 5.
Use one of the target platforms defined in
Ibf67a6d3539fa0708a3e5dbe44fb899c56fbd8ed to work with that in Eclipse.

Change-Id: I343273d994dc7b6e0287c604e5926ff77d5b585b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoUse default thread pool to prevent thread pool starvation 26/6226/1
Matthias Sohn [Sun, 3 Jun 2012 06:00:48 +0000 (08:00 +0200)]
Use default thread pool to prevent thread pool starvation

Bug: 380302
Change-Id: Ie66d495481776469ff2aa603c550557cff82cafc
Suggested-By: Joakim Erdfelt <joakim@intalio.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Reduce number of hard-coded maven artifact versions" into stable-2.0
Robin Rosenberg [Thu, 31 May 2012 21:49:29 +0000 (17:49 -0400)]
Merge "Reduce number of hard-coded maven artifact versions" into stable-2.0

12 years agoRemove obsolete GitlinksNotSupportedException 27/6127/3
Robin Rosenberg [Sat, 26 May 2012 07:51:21 +0000 (09:51 +0200)]
Remove obsolete GitlinksNotSupportedException

Change-Id: Idddd86818858b229e68b4a46597fc67547bcce17

12 years agoUpdate ORIG_HEAD when resetting 40/6140/5
Kevin Sawicki [Thu, 10 May 2012 22:56:21 +0000 (15:56 -0700)]
Update ORIG_HEAD when resetting

Write the old object id from the RefUpdate to the
ORIG_HEAD file after the update completes.

Add two new convenience methods to Repository to read
and write the ORIG_HEAD reference similar to the methods
for reading/writing CHERRY_PICK_HEAD and MERGE_HEAD.

Bug: 375525
Change-Id: I120b3b2cd3b1ddae88fce435285bae15cbf96f5e

12 years agoReduce number of hard-coded maven artifact versions 89/6189/1
Matthias Sohn [Wed, 30 May 2012 23:50:55 +0000 (01:50 +0200)]
Reduce number of hard-coded maven artifact versions

This reduces the number of hard-coded version numbers we have to touch
with every release.

Change-Id: I0f2e910423d3db081b644968cd0d6a89178ba12a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoPrepare next 2.0.0-SNAPSHOT builds 88/6188/1
Matthias Sohn [Wed, 30 May 2012 23:39:57 +0000 (01:39 +0200)]
Prepare next 2.0.0-SNAPSHOT builds

Change-Id: Iffc57d6b25dafb72272d1957116c19ab45ba2c54
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoJGit v2.0.0.201205301645-rc2 83/6183/1 v2.0.0.201205301645-rc2
Matthias Sohn [Wed, 30 May 2012 20:44:08 +0000 (22:44 +0200)]
JGit v2.0.0.201205301645-rc2

Change-Id: Ic4f84f1a11c93863c229c0089f2e4edc7c7a36b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoGit API does not declare GitAPIException call() and related cleanups 00/6100/11
Robin Rosenberg [Wed, 30 May 2012 00:07:25 +0000 (02:07 +0200)]
Git API does not declare GitAPIException call() and related cleanups

All commands should throw a GitAPIException so new exceptions can be
added without breaking the builds of old code, i.e. anyone that calls
a Git API should catch GitAPIException and not just the currently known
exceptions.

Now the only checked exceptions on Git API calls are GitException and
subclasses of it. New checked exceptions that are subclasses of
GitException may be added without breaking the API.

Javadoc for GitAPIException is declared on GitCommand and
inherited to subclasses. JGitInternalException is not explicitly
documented anymore.

Unfortunately this change itself breaks the API. The intention is
that it shall be possible to add new checked subclasses of
GitAPIException without breaking the API.

Bug: 366914
EGit-Change-Id: I50380f13fc82c22d0036f47c7859cc3a77e767c5
Change-Id: I50380f13fc82c22d0036f47c7859cc3a77e767c5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Retain file length and mod time when doing a mixed reset" into stable-2.0
Robin Rosenberg [Wed, 30 May 2012 19:57:04 +0000 (15:57 -0400)]
Merge "Retain file length and mod time when doing a mixed reset" into stable-2.0

12 years agoMerge "Update smudged entries when writing index" into stable-2.0
Robin Rosenberg [Wed, 30 May 2012 19:56:30 +0000 (15:56 -0400)]
Merge "Update smudged entries when writing index" into stable-2.0

12 years agoEnable loading history until a given commit 67/6167/1
Matthias Sohn [Sat, 19 May 2012 14:49:03 +0000 (16:49 +0200)]
Enable loading history until a given commit

This is needed to allow jumping to a selected commit when loading
history incrementally.

Change-Id: Id3b97d88d3b4b2d67561b11f8810cb88fe040823
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoOnly increment mod count if packed-refs file changes 41/6141/1
Kevin Sawicki [Fri, 11 May 2012 02:13:24 +0000 (19:13 -0700)]
Only increment mod count if packed-refs file changes

Previously if a packed-refs file was racily clean then there
was a 2.5 second window in which each call to getPackedRefs
would increment the mod count causing a RefsChangedEvent to be
fired since the FileSnapshot would report the file as modified.

If a RefsChangedListener called getRef/getRefs from the
onRefsChanged method then a StackOverflowError could occur
since the stack could be exhausted before the 2.5 second
window expired and the packed-refs file would no longer
report being modified.

Now a SHA-1 is computed of the packed-refs file and the
mod count is only incremented when the packed refs are
successfully set and the id of the new packed-refs file
does not match the id of the old packed-refs file.

Change-Id: I8cab6e5929479ed748812b8598c7628370e79697

12 years agoRetain file length and mod time when doing a mixed reset 38/6138/1
Kevin Sawicki [Sun, 6 May 2012 17:17:05 +0000 (10:17 -0700)]
Retain file length and mod time when doing a mixed reset

Previously the index was cleared and updated with a new tree.

Now the commit being reset to and the index are iterated over
in a tree walk and the current index mod time and file length
are copied over to the new dir cache entry being written if
the object ids are the same.

Change-Id: Iaf9e624efb0bf90f9e05fcb0587dde4dec50000c

12 years agoUpdate smudged entries when writing index 37/6137/1
Kevin Sawicki [Mon, 21 May 2012 22:00:23 +0000 (15:00 -0700)]
Update smudged entries when writing index

Overload DirCache.lock to take a repository that is
used for updating smudged index entries with information
from the repository's working tree.

New unit tests are also added for updating smudged index
entries on reset, checkout, and commit.

Change-Id: I88689f26000e4e57e77931e5ace7c804d92af1b6

12 years agoUpdate Jetty to 8.1.3.v20120416 97/6097/1
Matthias Sohn [Wed, 23 May 2012 20:21:58 +0000 (22:21 +0200)]
Update Jetty to 8.1.3.v20120416

Jetty 8.1.3 comes with Juno M7 and this version can be installed from
http://download.eclipse.org/jetty/updates/jetty-bundles-8.x/8.1.3.v20120416/

Change-Id: Ifc4bfbb3efbab0f5bfbde74f0b2ddc5a2f9ee6a5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd config --list command to pgm 98/4898/4
Tomasz Zarna [Fri, 18 May 2012 12:20:05 +0000 (14:20 +0200)]
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>
12 years agoEnsure resetting on commit id 80/6080/2
Dariusz Luksza [Wed, 23 May 2012 00:04:04 +0000 (02:04 +0200)]
Ensure resetting on commit id

When reset command was called with tag name as parameter the resulting
HEAD was set to the tag's SHA-1 which is a bug. This patch ensures that
repository.resolve() call always returns commit id.

Change-Id: I219b898c620a75c497c8652dbf4735fd094c4d7c
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMove NLS test for HttpServerText to http.test 83/6083/1
Shawn O. Pearce [Tue, 22 May 2012 21:52:32 +0000 (14:52 -0700)]
Move NLS test for HttpServerText to http.test

This never should have been in the core library test suite, as that
test suite never should depend upon the HTTP server module.

Change-Id: Ie0528c4d1c755823303d138e327a3a2f4caccc32

12 years agoFix JGit source bundle packaging 46/6046/2
Matthias Sohn [Mon, 21 May 2012 18:51:10 +0000 (20:51 +0200)]
Fix JGit source bundle packaging

Due to Tycho bug 368596 we didn't package the correct JGit source bundle
anymore. Instead of sources it contained the binary bundle. As a
workaround fall back to use packaging type eclipse-update-site which
doesn't seem to have this problem.

Bug: 368596
Bug: 379402
Change-Id: I3192dbd00b51e6ee6596d2301050b2a6f7028e3b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoSmudge index entries on first write (too), as well when reading 13/5413/9
Robin Rosenberg [Mon, 21 May 2012 17:48:40 +0000 (10:48 -0700)]
Smudge index entries on first write (too), as well when reading

That happens when the index and a new file is created within the same
second and becomes a problem if we then modify the newly created file
within the same second after adding it to the index. Without smudging
JGit will, on later reads, think the file is unchanged.

The accompanying test passed with the smuding on read.

Change-Id: I4dfecf5c93993ef690e7f0dddb3f3e6125daae15

12 years agoAdd user friendly output from jgit commit command 34/6034/1
Mikael Karlsson [Fri, 18 May 2012 20:07:50 +0000 (22:07 +0200)]
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

12 years agoDon't swallow JSchException "Auth fail" exception 88/5988/3
Dariusz Luksza [Wed, 16 May 2012 05:55:03 +0000 (07:55 +0200)]
Don't swallow JSchException "Auth fail" exception

"Auth fail" exception was swallowed during retrying, this leads to
"Session down" exception during clone operation with invalid SSH keys.

Bug: 336795
Change-Id: Id8d9e83b10f4f2a01e0cf89819190bb23a04a2b9
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
12 years agoEnable call chaining on LsRemoteCommand methods 74/5974/1
Dave Borowitz [Tue, 20 Mar 2012 14:45:12 +0000 (07:45 -0700)]
Enable call chaining on LsRemoteCommand methods

Change-Id: I706332386415892d7a964b241442832ad79fa223

12 years agoFactor a base class out of ReceivePack 18/5818/4
Dave Borowitz [Thu, 3 May 2012 23:44:53 +0000 (16:44 -0700)]
Factor a base class out of ReceivePack

We are working on a publish/subscribe based git protocol, and we want to
reuse several parts of the ReceivePack-like code for reading commands
and processing a pack. In this new implementation, the connection
management will be very different, in particular, there may be multiple
packs received on a single open connection. So, hoist out as much as we
can from ReceivePack, mostly just leaving behind the single-connection
version in that class.

Change-Id: I5567aad6ae77951f73f59c1f91996d934ea88334

12 years agoAdd --all switch to org.eclipse.jgit.pgm.Commit 63/5763/2
Tomasz Zarna [Mon, 30 Apr 2012 13:18:07 +0000 (15:18 +0200)]
Add --all switch to org.eclipse.jgit.pgm.Commit

Change-Id: Iab52f995676daf60e0dfa043cc9e022f6e32a758
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoCleanup MergeResult constructors 68/5368/2
Tomasz Zarna [Thu, 15 Mar 2012 17:04:16 +0000 (18:04 +0100)]
Cleanup MergeResult constructors

'mergeStrategy' should be 5th argument, after 'mergeStatus'. Pass
'description' if available.

Change-Id: I97cebfe5d7db6247fe899075d917b82955906f85
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd missing @since tags to mark API added in 2.0 73/5873/2
Matthias Sohn [Mon, 7 May 2012 21:45:24 +0000 (23:45 +0200)]
Add missing @since tags to mark API added in 2.0

Change-Id: I0a86ce0e393dfde9bb27f0b29e036e76c856396e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoUpdate tycho version to 0.14.1 96/5596/2
Matthias Sohn [Mon, 16 Apr 2012 15:40:43 +0000 (17:40 +0200)]
Update tycho version to 0.14.1

Tycho 0.14.1 enforces that artifactId and feature/bundle SymbolicName
must match, hence follow recommended migration practice and change
groupId of feature projects in order not to change the feature names as
this would require a feature migration.

Also migrate the p2 repository build from the deprecated packaging type
eclipse-update-site to packaging type eclipse-repository.

Change-Id: I99fc6c2bbb20efbd6514bdd9940f3535707c21bc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoUpdate packaging project to build using Indigo platform 95/5595/2
Matthias Sohn [Mon, 16 Apr 2012 12:47:44 +0000 (14:47 +0200)]
Update packaging project to build using Indigo platform

Change-Id: I4c07112a6723d90d3677761f5476af00ead58282
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoRemove throws IOException declaration on filterClean 03/5903/2
Kevin Sawicki [Wed, 9 May 2012 18:18:02 +0000 (11:18 -0700)]
Remove throws IOException declaration on filterClean

This method only creates an EolCanonicalizingInputStream
which does not throw an IOException and so the throws
declaration on the method is unneeded.

Change-Id: Icae8b80006c5e3ffcf3b69790a1a45c505be0f05
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd Object type to Comparable implements declaration 02/5902/3
Kevin Sawicki [Wed, 9 May 2012 17:41:40 +0000 (10:41 -0700)]
Add Object type to Comparable implements declaration

This removes unchecked warnings when a List of
AnyObjectId objects or any of its subclasses are
passed to Collections.sort such as in PackWriter

Change-Id: I806732cee24349c75c0357a655df55b070f2f213
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoRemove 4 unboxed warnings 01/5901/2
Kevin Sawicki [Wed, 9 May 2012 15:45:08 +0000 (08:45 -0700)]
Remove 4 unboxed warnings

Use Integer.intValue to explicitly convert to an int

Change-Id: I1135ed01af4e274b26d6b07d1a50f48ef0a30d91
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMake output stream optional in DiffCommand 08/5908/2
Kevin Sawicki [Wed, 9 May 2012 22:19:04 +0000 (00:19 +0200)]
Make output stream optional in DiffCommand

Use the NullOutputStream.INSTANCE value when the
configured output stream is null or the command is
configured to only show name and status.

Also only set the context and prefix options if
formatting is actually being performed.

Bug: 377157
Change-Id: I333cfcc82ee746f3c6a8e94c09dcc803ffbb4b3a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoCompare modes before comparing ids in ResolveMerger 09/5909/1
Kevin Sawicki [Wed, 9 May 2012 21:31:59 +0000 (14:31 -0700)]
Compare modes before comparing ids in ResolveMerger

Comparing ids can be more expensive so do the cheap
mode check first and short circuit the id comparison
when modes are non-equal

Change-Id: I671eda51c74a411cc27de9d6077cc76e816ebe2b

12 years agoRemove 86 boxing warnings 93/5893/2
Kevin Sawicki [Wed, 9 May 2012 04:42:53 +0000 (21:42 -0700)]
Remove 86 boxing warnings

Use Integer, Character, and Long valueOf methods when
passing parameters to MessageFormat and other places
that expect objects instead of primitives

Change-Id: I5942fbdbca6a378136c00d951ce61167f2366ca4

12 years agoRemove unnecessary boxing SuppressWarnings annotation 91/5891/1
Kevin Sawicki [Wed, 9 May 2012 03:42:19 +0000 (20:42 -0700)]
Remove unnecessary boxing SuppressWarnings annotation

Change-Id: Id8a6d9f96860742f9094efdb4f31a952be7d3025

12 years agoRemove unneeded catch block and null checks 32/5832/1
Kevin Sawicki [Fri, 4 May 2012 21:37:40 +0000 (14:37 -0700)]
Remove unneeded catch block and null checks

The catched exception was just rethrown and the
null check of the locked dir cache was unneeded if
the assignment was done outside the try block.

Change-Id: If2ee1f3eff3849f8da51eab825057fc56e166a94

12 years agoFix two typos in CLIText.properties 80/5780/1
Tomasz Zarna [Wed, 2 May 2012 09:35:13 +0000 (11:35 +0200)]
Fix two typos in CLIText.properties

Change-Id: Id1429d52c88a9e2b888e6c6906cf8148945bd2ca

12 years agoMerge "Update README regarding CRLF conversion, /etc and $HOME"
Matthias Sohn [Mon, 30 Apr 2012 20:07:38 +0000 (16:07 -0400)]
Merge "Update README regarding CRLF conversion, /etc and $HOME"

12 years agoUpdate README regarding CRLF conversion, /etc and $HOME 59/5759/1
Robin Rosenberg [Sat, 28 Apr 2012 22:37:54 +0000 (00:37 +0200)]
Update README regarding CRLF conversion, /etc and $HOME

Change-Id: I3c41a8ee7f500e2c39df94eaf5d87c234934b741

12 years agoValidate paths during DirCheckout 17/4617/16
Robin Rosenberg [Mon, 23 Apr 2012 20:37:50 +0000 (22:37 +0200)]
Validate paths during DirCheckout

DirCacheCheckout and CanonicalTreeParser cooperate. CanonicalTreeParser
can detect malformed, potentially malicious tree entries and sets a
flag, while DirCacheCheckout refuses to work with such paths.

Malicious tree entries are ".", "..", ".git" (case insensitive), any
name containing '/' and (on Windows '\') and also (on Windows)
any paths ending in a combination of '.' or space or containing a ':'.
We also forbid all special names like "con" etc on Windows.

Some of the test can execute on any platform by enabling partial
platform emulation.

A new runtime exception, InvalidPathException, is introduced. For
backwards compatibility it extends InvalidArgumentException.

Change-Id: I86199105814b63d4340e5de0e471d0da6b579ead
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoEnable large file support 89/5589/4
Robin Rosenberg [Mon, 16 Apr 2012 22:18:10 +0000 (00:18 +0200)]
Enable large file support

Allow adding files with size over 2 GB. The drawback is that the tests
for huge file support adds roughly 10 minutes of execution time.
For that reason we @Ignore the test in the standard test execution.

Change-Id: I5788e8009899203b346f353297166825b3744575

12 years agoAllow to write tests with CLI syntax 08/5408/2
Tomasz Zarna [Fri, 23 Mar 2012 08:10:41 +0000 (09:10 +0100)]
Allow to write tests with CLI syntax

CQ: 6385
Bug: 365444
Change-Id: I2d5164cd92429673fe3c37e9f5f9bc565192cc12
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoEnable DirCacheEntry's copyMetaData to not copy stage info 93/5493/5
Robin Rosenberg [Fri, 13 Apr 2012 22:40:06 +0000 (00:40 +0200)]
Enable DirCacheEntry's copyMetaData to not copy stage info

When there is a conflict sometimes we did not set the stage of
the conflict entries properly for the STAGE_1 entry.

Change-Id: I1c28ff6251fdbc95f7c40fc3e401f1b41157a9f6

12 years agoMerge "Fix tests for Ant task "git-clone""
Christian Halstrick [Tue, 17 Apr 2012 07:38:12 +0000 (03:38 -0400)]
Merge "Fix tests for Ant task "git-clone""

12 years agoHide two warnings about boxing 94/5494/4
Robin Rosenberg [Mon, 16 Apr 2012 21:34:47 +0000 (23:34 +0200)]
Hide two warnings about boxing

Change-Id: I1cb7cdb81481019f4a55221d38d771fcc9451529
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoFix constructor for SafeBufferedOutputStream 83/5583/2
Robin Rosenberg [Fri, 13 Apr 2012 15:41:06 +0000 (17:41 +0200)]
Fix constructor for SafeBufferedOutputStream

The size shoould be passed to BufferedOutputStream's constructor.
All callers seem to use the default, but that could change.

Change-Id: I874afee6a9114698805e36813781547e6aa328a5

12 years agoMerge "UnsupportedCredentialItem with password authentication"
Robin Rosenberg [Mon, 9 Apr 2012 14:40:28 +0000 (10:40 -0400)]
Merge "UnsupportedCredentialItem with password authentication"

12 years agoUnsupportedCredentialItem with password authentication 29/5529/2
Robin Rosenberg [Thu, 5 Apr 2012 06:04:45 +0000 (08:04 +0200)]
UnsupportedCredentialItem with password authentication

If the server prompts for password, it comes as a StringType prompt.

Bug: 360862
Change-Id: Ic758456c21c8d68d1b3d7f56228beb7535b11735

12 years agoMerge "Fix broken TagCommand API"
Robin Rosenberg [Fri, 6 Apr 2012 09:34:00 +0000 (05:34 -0400)]
Merge "Fix broken TagCommand API"

12 years agoMerge "Cleanup possiblyFilteredInputStream() in WorkingTreeIterator"
Matthias Sohn [Fri, 6 Apr 2012 00:32:03 +0000 (20:32 -0400)]
Merge "Cleanup possiblyFilteredInputStream() in WorkingTreeIterator"

12 years agoMerge "Handle content length in WorkingTreeIterator"
Robin Rosenberg [Thu, 5 Apr 2012 23:29:08 +0000 (19:29 -0400)]
Merge "Handle content length in WorkingTreeIterator"

12 years agoFix broken TagCommand API 02/5302/2
Robin Rosenberg [Fri, 9 Mar 2012 11:03:20 +0000 (12:03 +0100)]
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

12 years agoCleanup possiblyFilteredInputStream() in WorkingTreeIterator 39/5539/1
Robin Rosenberg [Thu, 5 Apr 2012 22:26:06 +0000 (00:26 +0200)]
Cleanup possiblyFilteredInputStream() in WorkingTreeIterator

Use early return instead of nested if/else

Change-Id: I3b5048f9f5cfdfd01f916af550722532db3f9bb3

12 years agoMerge "Recurse into cloned submodules"
Matthias Sohn [Tue, 3 Apr 2012 22:42:03 +0000 (18:42 -0400)]
Merge "Recurse into cloned submodules"

12 years agoUnlock DirCache in case of occurring exception 69/4869/2
Jens Baumgart [Tue, 3 Apr 2012 15:25:32 +0000 (17:25 +0200)]
Unlock DirCache in case of occurring exception

A DirCache was not unlocked if an exception occurred in the
DirCacheCheckout constructor.

Bug: 365449
Change-Id: I231d902d52e3e5e9a7748eedaa63a2bb889ebb13
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
12 years agoMerge "Index config section and subsection names in one pass"
Robin Rosenberg [Mon, 2 Apr 2012 21:59:34 +0000 (17:59 -0400)]
Merge "Index config section and subsection names in one pass"

12 years agoMerge "Add @Override annotations to enums"
Robin Rosenberg [Mon, 2 Apr 2012 21:53:07 +0000 (17:53 -0400)]
Merge "Add @Override annotations to enums"

12 years agoMerge "Externalize parsing exception message for RebaseCommand#Action"
Matthias Sohn [Mon, 2 Apr 2012 20:02:39 +0000 (16:02 -0400)]
Merge "Externalize parsing exception message for RebaseCommand#Action"

12 years agoIndex config section and subsection names in one pass 87/5487/2
Shawn O. Pearce [Tue, 27 Mar 2012 19:32:16 +0000 (15:32 -0400)]
Index config section and subsection names in one pass

Instead of indexing the subsection names on each request for a given
section name, index both the section and subsection names in a single
scan through the entry list. This should improve lookup time for
reading the section names out of the configuration, especially for the
url.*.insteadof type of processing performed in RemoteConfig.

Change-Id: I7b3269565b1308f69d20dc3f3fe917aea00f8a73

12 years agoExternalize parsing exception message for RebaseCommand#Action 15/5515/1
Tomasz Zarna [Mon, 2 Apr 2012 09:36:29 +0000 (11:36 +0200)]
Externalize parsing exception message for RebaseCommand#Action

Change-Id: Id0d7801e4de98bf118dbecadf623c9ffd7ab7554

12 years agoAdd @Override annotations to enums 14/5514/1
Tomasz Zarna [Mon, 2 Apr 2012 09:24:05 +0000 (11:24 +0200)]
Add @Override annotations to enums

Change-Id: I8fa3b89a6349c1231251b346cae12c1c4f095929

12 years agoDon't use java.nio channel for file size determination 76/5276/11
Markus Duft [Mon, 2 Apr 2012 05:27:19 +0000 (07:27 +0200)]
Don't use java.nio channel for file size determination

Java NIO has some problems (like files closing unexpectedly because the
thread was interrupted). To avoid those problems, don't use a NIO
channel to determine the size of a file, but rather ask the File itself.

We have to be prepared to handle wrong/outdated information in this case
too, as the inode of the File may change between opening and determining
file size.

Change-Id: Ic7aa6c3337480879efcce4a3058b548cd0e2cef0

12 years agoRecurse into cloned submodules 98/5498/1
Kevin Sawicki [Mon, 2 Apr 2012 01:36:42 +0000 (18:36 -0700)]
Recurse into cloned submodules

Iterate over all successfully cloned submodules recursively
and continue initializing and updating until no more are found.

Bug: 375426
Change-Id: Ifb99e41e2deb0c369442bca3c0f5f072dd006816

12 years agoFix tests for Ant task "git-clone" 97/5497/1
Matthias Sohn [Sun, 1 Apr 2012 23:20:31 +0000 (01:20 +0200)]
Fix tests for Ant task "git-clone"

If project.init() isn't called GitCloneTaskTest fails when started from
Eclipse, according to [1] calling init() is necessary to properly
initialize the Ant project programmatically.

Always set the destination folder in order to ensure that all test
resources are created under the project's target folder and do not
pollute the project's source tree with test data.

[1]
http://ant.1045680.n5.nabble.com/project-createTask-not-working-with-ant-1-8-2-td3385716.html

Change-Id: Icbeb62680b018a92673faa58828b5e850564c7a8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge changes Ic8907231,I693148a5
Robin Rosenberg [Fri, 30 Mar 2012 16:25:47 +0000 (12:25 -0400)]
Merge changes Ic8907231,I693148a5

* changes:
  Sort Config entries and use O(log N) lookup
  Extract inner classes from Config

12 years agoFix loading packed objects >2G 90/5490/2
Shawn O. Pearce [Wed, 28 Mar 2012 14:12:20 +0000 (10:12 -0400)]
Fix loading packed objects >2G

Parsing the size from a packed object header was incorrectly computing
the total inflated length when the length exceeded the range of a Java
int. The next 7 bits of size information was shifted left as an int
using a shift of 25 bits, placing the higher bits of the size into the
sign position. When this size was extended to a long to be added to
the current size accumulator the size went negative, resulting in
NegativeArraySizeException being thrown.

Fix all places where this particular pattern of code is used to read a
pack size field, or a binary delta header, as they both use the same
variable length encoding scheme.

Change-Id: I04008728ed828f18202652c3d5401cf95a441d0a

12 years agoSort Config entries and use O(log N) lookup 86/5486/1
Shawn O. Pearce [Tue, 27 Mar 2012 15:49:13 +0000 (11:49 -0400)]
Sort Config entries and use O(log N) lookup

Decrease running time for getStringList (and all other get methods) by
looking for configuration entries using binary search rather than
linear search through the configuration file.

Configuration lines are sorted by section, subsection, name in a
sorted list whenever the snapshot is rebuilt. Binary search is used to
locate an index in the middle of the values, then walk backwards to
find the first value in the range.

Given a configuration of file of 5000 distinct section/subsection/name
triplets (e.g. a Gerrit Code Review project.config configuration file
with 5000 unique access control rules), this new code is faster to
lookup each rule individually using getStringList():

  old setStringList() 194 usec avg
      getStringList() 196 usec avg

  new setStringList() 188 usec avg
      getStringList()  24 usec avg

Change-Id: Ic8907231868c18eb946b72f341a6b58666b70324

12 years agoExtract inner classes from Config 85/5485/1
Shawn O. Pearce [Tue, 27 Mar 2012 14:43:02 +0000 (10:43 -0400)]
Extract inner classes from Config

The Config class is getting very large. Extract two of its inner
classes into new top level types to reduce the size of Config.
Rename them slightly in the process.

Change-Id: I693148a5ae2977378789bf455c880a6fd856c0f0

12 years agoHandle content length in WorkingTreeIterator 12/5412/2
Robin Rosenberg [Sun, 25 Mar 2012 12:42:54 +0000 (14:42 +0200)]
Handle content length in WorkingTreeIterator

Content length is computed and cached (short term) in the working
tree iterator when core.autocrlf is set.

Hopefully this is a cleaner fix than my previous attempt to make
autocrlf work.

Change-Id: I1b6bbb643101a00db94e5514b5e2b069f338907a

12 years agoAllow RepositoryResolver to throw ServiceMayNotContinueException 77/5477/1
Dave Borowitz [Mon, 26 Mar 2012 17:19:40 +0000 (10:19 -0700)]
Allow RepositoryResolver to throw ServiceMayNotContinueException

Implementations may want to send an error message to the user, which
doesn't really fit with any of the existing exception types.
ServiceMayNotContinueException, on the other hand, is documented as
always containing a user-visible error string, so use that.

Modify the git and HTTP transport mechanisms to properly relay this
message to the end user.

Change-Id: I362e67ea46102a145bf2c6284d38788537c9735f

12 years agoClarify documentation of exceptions in RepositoryResolver 76/5476/1
Dave Borowitz [Mon, 26 Mar 2012 16:53:32 +0000 (09:53 -0700)]
Clarify documentation of exceptions in RepositoryResolver

Change-Id: Idf805f76f24bfa1f3552366197e0ed4e45cb2b74

12 years agoProperly parse first line in ReceivePack with no '\0' 11/5411/1
Dave Borowitz [Fri, 23 Mar 2012 21:38:06 +0000 (14:38 -0700)]
Properly parse first line in ReceivePack with no '\0'

Change-Id: Ic98e17aff4e4b3c3fa0359082bab689e4522e3d7

12 years agoRevert "Allow to write tests with CLI syntax" 07/5407/1
Matthias Sohn [Thu, 22 Mar 2012 23:30:46 +0000 (00:30 +0100)]
Revert "Allow to write tests with CLI syntax"

This reverts commit bf845c126d53f07de103e03b68ddb7f24014cee5 since this
change needs to go through a formal IP review and Chris missed to file a
CQ for that.

Change-Id: I303515d78116f0591a2911dbfb9f857738f086a9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Allow to write tests with CLI syntax"
Christian Halstrick [Thu, 22 Mar 2012 11:39:14 +0000 (07:39 -0400)]
Merge "Allow to write tests with CLI syntax"

12 years agoAllow to write tests with CLI syntax 20/4720/8
Tomasz Zarna [Thu, 22 Mar 2012 10:29:18 +0000 (11:29 +0100)]
Allow to write tests with CLI syntax

Bug: 365444
Change-Id: I86f382913bc47665c5b9a2827b878e7dbedce7b1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd command support for dropping a stashed commit 93/5393/8
Kevin Sawicki [Wed, 21 Mar 2012 17:50:16 +0000 (10:50 -0700)]
Add command support for dropping a stashed commit

This extracts the logic for writing to the reflog from
RefDirectory into a new ReflogWriter class.  This class
creates a public API for writing reflog entries similar
to ReflogReader for reading reflog entries.

The new command supports rewriting the stash's log to remove
a configured entry followed by updating the stash ref to
the value at the bottom of the newly written log.

Change-Id: Icfcbc70e838666769a742a94196eb8dc9c7efcc7
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoIgnore trailing comments in transport SPI parsing 88/5388/5
Kevin Sawicki [Tue, 20 Mar 2012 05:00:49 +0000 (22:00 -0700)]
Ignore trailing comments in transport SPI parsing

Check for a '#' character in each line read and
parse the leading characters as the class name of
a TransportProtocol being registered via SPI.

Bug: 373439
Change-Id: If36cb62c07ecea78ba0f326a87edf1d80b7b42b6
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoCompare repository format version as parsed long 17/5217/5
Kevin Sawicki [Mon, 12 Mar 2012 17:00:52 +0000 (10:00 -0700)]
Compare repository format version as parsed long

This allows repositoryies with a missing repositoryformatversion
config value to be successfully opened but still throws exceptions
when the value is a non-long or greater than zero.

git-core attempts to parse this config value as a long as well
and defaults to 0 if the value is missing.

Bug: 368697
Change-Id: I4a93117afca37e591e8e0ab4d2f2eef4273f0cc9
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoCopy all branch configuration values when renaming 87/5387/3
Kevin Sawicki [Tue, 20 Mar 2012 01:03:20 +0000 (18:03 -0700)]
Copy all branch configuration values when renaming

Previously only certain values were copied over which caused
divergence in behavior between the JGit command and corresponding
CGit command.

Bug: 372051
Change-Id: I72a83215a679a713138da31f5ab838f14388d4bd
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoClarify the purpose of ObjectInserter.buffer() 67/5367/2
Shawn O. Pearce [Thu, 15 Mar 2012 14:57:56 +0000 (07:57 -0700)]
Clarify the purpose of ObjectInserter.buffer()

Recently Robin tried to increase the size of the buffer used by
ObjectInserter to fix a bug in the InputStream that handles AutoCRLF.
The purpose of this buffer is NOT to make a random InputStream work
correctly by passing it a larger buffer during read(byte[],int,int).

Clarify the Javadoc on the buffer() method to reduce the risk
someone tries to abuse it again.

While we are here, modify the method to load the field into a local
variable before returning. This should cut down 1 field load during
the common case of the buffer being already allocated.

Change-Id: Ic6898530d10fcd7e59f90397117a4a0d97e1f031
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoLogCommand#setMaxCount affects all commits 28/5028/4
Tomasz Zarna [Sun, 18 Mar 2012 00:13:01 +0000 (01:13 +0100)]
LogCommand#setMaxCount affects all commits

Bug: 370132
Change-Id: I9f5ff3640a4f69c0b48c97609728d7672e63e6ab
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoPass a DfsRepositoryDescription to InMemoryRepository 70/5370/1
Dave Borowitz [Thu, 15 Mar 2012 22:46:39 +0000 (15:46 -0700)]
Pass a DfsRepositoryDescription to InMemoryRepository

This was likely intended originally, but this class had never been
used, so the mistake went unnoticed.

Change-Id: I5e0e9f22ebf707c11d0581511c7a56b182188f77

12 years agoRevert "Quickfix for AutoCRLF handling" 66/5366/1
Shawn O. Pearce [Thu, 15 Mar 2012 14:21:14 +0000 (07:21 -0700)]
Revert "Quickfix for AutoCRLF handling"

This reverts commit 88fe2836edab8d8ce82d28acd9d07b061988ff3a.

Auto CRLF isn't special enough to be screwing around with the buffers
used for raw byte processing of the ObjectInserter API. If it needs a
buffer to process a file that is bigger than the buffer allocated by
an ObjectInserter, it needs to do its own buffer management.

Change-Id: Ida4aaa80d0f9f78035f3d2a9ebdde904c980f89a

12 years agoOnly unstash files changed when originally stashed 94/5194/8
Kevin Sawicki [Wed, 14 Mar 2012 00:01:42 +0000 (17:01 -0700)]
Only unstash files changed when originally stashed

Previously a DirCacheCheckout was done using a merge tree reflecting
the state of the repository when the stash was originally done.
This was wrong since unstashing after making subsequent commits
would undo changes already committed by checking out entries from
an outdated tree.

The new approach is to scan for conflicts initially using a 6-way
tree walk that contains the trees for the stashed HEAD, stashed
index, stashed working directory, current HEAD, current index, and
current working directory.  Then perform a subsequent scan of the
stashed HEAD, index, and working directory trees and apply all
the stashed differences to the current index and working directory.

Bug: 372882
Change-Id: Ica65f162132c00a16964e838de66fc8b5cd0b0aa
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoMerge "Enable smart HTTP transport to place EOF at end of pack"
Shawn O. Pearce [Tue, 13 Mar 2012 18:50:27 +0000 (14:50 -0400)]
Merge "Enable smart HTTP transport to place EOF at end of pack"

12 years agoEnable smart HTTP transport to place EOF at end of pack 48/5348/2
Shawn O. Pearce [Tue, 13 Mar 2012 18:10:33 +0000 (11:10 -0700)]
Enable smart HTTP transport to place EOF at end of pack

When fetching over smart HTTP the InputStream that gets fed into
a PackParser doesn't really support EOF at the end of the pack. It
instead tries to make a new HTTP request, which fails because there
is no request body currently buffered by the client.

Make EOF work correctly on the end of an HTTP derived InputStream
for the pack by denoting no more requests are expected as the higher
level code is now consuming the pack (or side-band embedded pack).
Smart HTTP support doesn't automatically enqueue execute support onto
the end of the UnionInputStream, which allows the UnionInputStream
to correctly reflect EOF when the HTTP response is consumed.

Change-Id: I975f1ab1c81ab1c1af925716970088bc7b8d6b1a

12 years agoDo not import/export empty org.eclipse.jgit package 39/5339/2
Tomasz Zarna [Tue, 13 Mar 2012 16:10:10 +0000 (09:10 -0700)]
Do not import/export empty org.eclipse.jgit package

The package was removed in I763590a45d75f00a09097ab6f89581a3bbd3c797

Change-Id: Ifa9e75714f85d17609f9bf61581aaed0631a6fa7
Signed-off-by: Kevin Sawicki <kevin@github.com>
12 years agoMove JGitText to an internal package 01/5301/3
Robin Rosenberg [Fri, 9 Mar 2012 09:44:05 +0000 (10:44 +0100)]
Move JGitText to an internal package

Change-Id: I763590a45d75f00a09097ab6f89581a3bbd3c797

12 years agoMerge changes Ic0ee9c08,Ia3e82682,I8d8ab547,I8f2cd0a0,I45823b0c,Ie22ac47e
Shawn Pearce [Mon, 12 Mar 2012 14:16:42 +0000 (10:16 -0400)]
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

12 years agoMerge "Use object id provided by working tree iterator for submodules"
Shawn Pearce [Mon, 12 Mar 2012 14:14:02 +0000 (10:14 -0400)]
Merge "Use object id provided by working tree iterator for submodules"

12 years agoFix compilation error due to missing javadoc. 25/5325/1
Markus Duft [Mon, 12 Mar 2012 13:54:56 +0000 (14:54 +0100)]
Fix compilation error due to missing javadoc.

Another change introduced this problem. With default JGit project
settings there is a compilation problem as javadoc problems are set to
Error in the project preferences.

Change-Id: I81e3ceeb02f7a2119b2a6cfefb7fbd9e83771fc9