]> source.dussan.org Git - jgit.git/log
jgit.git
10 years agoRebaseCommand should ignore submodule modifications 26/35126/3
Christian Halstrick [Fri, 17 Oct 2014 08:05:32 +0000 (10:05 +0200)]
RebaseCommand should ignore submodule modifications

Before a rebase happens the RebaseCommand checks that the working tree
is clean. We don't want to start a rebase on a dirty working tree. If
the working tree is dirty a rebase should not be allowed. But
RebaseCommand should ignore modifications done to submodules. E.g. if a
submodules HEAD points to <x> but the root repository has in index that
the submodule should point to <y> then this should not prohibit a
rebase. Also native git allows a rebase in this case. Since jgit's
StatusCommand has learned to ignore submodule changes this is now used
by the RebaseCommand to determine the repository state correctly.

Bug: 446922
Change-Id: I487bf7484dca3f5501e6e514584e2871524eea19

10 years agoSupport for Submodule configuration submodule.<name>.ignore 25/35125/3
Christian Halstrick [Fri, 17 Oct 2014 07:58:39 +0000 (09:58 +0200)]
Support for Submodule configuration submodule.<name>.ignore

For each submodule native git allows to configure which modifications to
submodules should be ignored by the status command. It is possible to
ignore "none", "all", "dirty", "untracked" [1]. This configuration is
now supported by IndexDiff. The StatusCommand offers the possibility to
specify this mode.

[1] http://git-scm.com/docs/gitmodules

Change-Id: Ifd81d574a680f9b4152945ba70f8ec4af4f452c9

10 years agoReimplementation of ignore rule parser 66/31366/8
Andrey Loskutov [Mon, 11 Aug 2014 07:28:52 +0000 (09:28 +0200)]
Reimplementation of ignore rule parser

The current IgnoreRule/FileNameMatcher implementation scales not well
with huge repositories - it is both slow and memory expensive while
parsing glob expressions (bug 440732). Addtitionally, the "double star"
pattern (/**/) is not understood by the old parser (bug 416348).

The proposed implementation is a complete clean room rewrite of the
gitignore parser, aiming to add missing double star pattern support and
improve the performance and memory consumption.

The glob expressions from .gitignore rules are converted to Java regular
expressions (java.util.regex.Pattern). java.util.regex.Pattern code can
evaluate expression from gitignore rules considerable faster (and with
less memory consumption) as the old FileNameMatcher implementation.

CQ: 8828
Bug: 416348
Bug: 440732
Change-Id: Ibefb930381f2f16eddb9947e592752f8ae2b76e1
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Initialize 'pathLen' field also for empty directories"
Robin Stocker [Thu, 23 Oct 2014 10:50:00 +0000 (06:50 -0400)]
Merge "Initialize 'pathLen' field also for empty directories"

10 years agoInitialize 'pathLen' field also for empty directories 54/34054/5
Andrey Loskutov [Mon, 29 Sep 2014 14:28:06 +0000 (16:28 +0200)]
Initialize 'pathLen' field also for empty directories

Bug: 445363
Change-Id: Ia8428af84fb61ba0d572374a19e8e8c55b138a63
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
10 years agoMerge "Add retainOnReset(RevFlag) to RevWalk to simplify reset usage"
Shawn Pearce [Mon, 20 Oct 2014 17:45:28 +0000 (13:45 -0400)]
Merge "Add retainOnReset(RevFlag) to RevWalk to simplify reset usage"

10 years agoAdd retainOnReset(RevFlag) to RevWalk to simplify reset usage 79/35079/2
Shawn Pearce [Fri, 17 Oct 2014 21:17:23 +0000 (14:17 -0700)]
Add retainOnReset(RevFlag) to RevWalk to simplify reset usage

Applications sometimes use a RevFlag instead of a Set<RevObject>
to track boolean state bits about objects being processed. However
this requires careful use of the resetRetain() methods to avoid an
accidental clearing of the RevFlag bits, effectively clearing the
Set<RevObject> the application wanted to track.

Simplify that use case by offering retainOnReset, a collection of
flags that are never cleared by the RevWalk.

Change-Id: I4c05b89b1398e4a4f371eac3a5d1d5edddec838f

10 years agoBundleWriter: Support including HEAD in bundle 92/35092/1
Robin Stocker [Sun, 19 Oct 2014 03:40:29 +0000 (14:40 +1100)]
BundleWriter: Support including HEAD in bundle

Bug: 446813
Change-Id: Ide64aec2a995dd7ff6c1325c3ada242a4eb4565e
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoMerge branch 'stable-3.5' 56/34956/1
Matthias Sohn [Tue, 14 Oct 2014 15:51:53 +0000 (17:51 +0200)]
Merge branch 'stable-3.5'

* stable-3.5:
  Prepare 3.5.2-SNAPSHOT builds
  JGit v3.5.1.201410131835-r
  Only hide gitdir if the repository isn't bare

Change-Id: I171e5fb8718cb6829bb1357859c95b4a29910ac6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare 3.5.2-SNAPSHOT builds 32/34832/1
Matthias Sohn [Mon, 13 Oct 2014 23:29:37 +0000 (01:29 +0200)]
Prepare 3.5.2-SNAPSHOT builds

Change-Id: Ib2ccdebe80bad0b09d2d31889a3ab89d77e341f6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.5.1.201410131835-r 28/34828/1 v3.5.1.201410131835-r
Matthias Sohn [Mon, 13 Oct 2014 22:38:49 +0000 (00:38 +0200)]
JGit v3.5.1.201410131835-r

Change-Id: I37e049c8e81f963cfb7c17f1af91fd4245766aee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Only hide gitdir if the repository isn't bare" into stable-3.5
Christian Halstrick [Mon, 13 Oct 2014 15:57:55 +0000 (11:57 -0400)]
Merge "Only hide gitdir if the repository isn't bare" into stable-3.5

10 years agoFix ResetCommand to default to mixed reset 42/34742/3
Matthias Sohn [Mon, 13 Oct 2014 14:41:58 +0000 (16:41 +0200)]
Fix ResetCommand to default to mixed reset

ResetCommand threw an NPE if neither mode nor path was defined. Instead
it should default to a mixed reset like native git does.

Change-Id: I455902394f9e7b0c7afae42381f34838f7f2a138
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoUpdate URL of JGit Maven release repository 84/34784/1
Matthias Sohn [Mon, 13 Oct 2014 08:25:14 +0000 (10:25 +0200)]
Update URL of JGit Maven release repository

This repository is required to allow clirr to compare the API of the
checked out version against the API of the latest release of jgit. The
old Maven repository on the download server was replaced by Nexus a long
time back.

Change-Id: I05125407fb72531c6831ec721064b0dad278bde5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge branch 'stable-3.5' 82/34782/1
Matthias Sohn [Sun, 12 Oct 2014 21:42:55 +0000 (23:42 +0200)]
Merge branch 'stable-3.5'

* origin/stable-3.5:
  When marking commits as uninteresting don't care if the tree exists

Change-Id: I66559a72ed7284cb721cf929512af884c0db2d61
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoCompare API changes against 3.5.0 81/34781/1
Matthias Sohn [Sun, 12 Oct 2014 20:24:16 +0000 (22:24 +0200)]
Compare API changes against 3.5.0

Change-Id: I10e51aea66f1446dd1d6d367ea113d824252d82b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoEnable maven site generation for jgit 80/34780/1
Matthias Sohn [Thu, 25 Sep 2014 09:18:53 +0000 (11:18 +0200)]
Enable maven site generation for jgit

Generating the site:
$ mvn site:site

Local staging of the site:
$ mvn site:stage
the site is staged under ./target/staging/

If you can connect to build.eclipse.org over ssh
(ask webmaster if you are a committer and need ssh access)
you can deploy a local build of the site:
$ mvn site:deploy
The site is deployed under
http://download.eclipse.org/jgit/site/${project.version}

To select the ssh key to use for deploying over ssh add the following
section to your Maven settings.xml:
<server>
  <id>jgit.website</id>
  <username>username</username>
  <privateKey>${user.home}/.ssh/id_rsa</privateKey>
  <filePermissions>664</filePermission>
  <directoryPermissions>775</directoryPermissions>
  <configuration></configuration>
</server>

To deploy the site from Hudson https://hudson.eclipse.org/egit/
enable the Maven profile "build-server".

Change-Id: I7e64c8560ca75196d2232f111ffad953c14f013f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit 6d00f0a09c67421d4ac9960c568f9c18ceb4a6a4)

10 years agoGenerate javadocs as part of Maven site project reports 79/34779/1
Matthias Sohn [Thu, 25 Sep 2014 09:17:40 +0000 (11:17 +0200)]
Generate javadocs as part of Maven site project reports

see http://maven.apache.org/plugins/maven-javadoc-plugin/usage.html

Change-Id: I6dc5dddea0adbb4abf5560d5d1c833408e944082
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit a3d0b0d903452ed9ba9d7bb5ea58c275b318a66f)

10 years ago[Java 8] Configure doclint to accept missing descriptions 78/34778/1
Matthias Sohn [Mon, 22 Sep 2014 22:27:46 +0000 (00:27 +0200)]
[Java 8] Configure doclint to accept missing descriptions

We avoid trivial descriptions in JavaDoc. Hence configure
doclint to not fail on missing descriptions.

Change-Id: Iba3d5aec18cc7d7f43e53fa6789f0dede9996fb7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit 54dc4b20b3e084c9c470c8211810dff008b6f0fc)

10 years agoWhen marking commits as uninteresting don't care if the tree exists 27/34727/1
Christian Halstrick [Thu, 9 Oct 2014 22:00:45 +0000 (00:00 +0200)]
When marking commits as uninteresting don't care if the tree exists

When during an ObjectWalk commits are marked as uninteresting we should
be tolerant against the situation that the commit exists in the repo but
the referenced tree is not exisiting. Since commit
c4797fe98655b3d52d0a90ba44fce6e053db3b8b we are throwing
MissingObjectException in such a case. This semantic differs from native
git behaviour and may cause push operations to fail while they would
work in native git. See:
http://dev.eclipse.org/mhonarc/lists/egit-dev/msg03585.html

Bug: 445744
Change-Id: Ib7dec10fd2ef1adbb8adbabb9d3d5a64e554286a

10 years agoRevert "When marking commits as uninteresting don't care if the tree exists"
Christian Halstrick [Thu, 9 Oct 2014 22:09:44 +0000 (00:09 +0200)]
Revert "When marking commits as uninteresting don't care if the tree exists"

This reverts commit 441fdb54ef05bbe58c61d562b331d606b0edd783.

10 years agoWhen marking commits as uninteresting don't care if the tree exists
Christian Halstrick [Thu, 9 Oct 2014 22:00:45 +0000 (00:00 +0200)]
When marking commits as uninteresting don't care if the tree exists

When during an ObjectWalk commits are marked as uninteresting we should
be tolerant against the situation that the commit exists in the repo but
the referenced tree is not exisiting. Since commit
c4797fe98655b3d52d0a90ba44fce6e053db3b8b we are throwing
MissingObjectException in such a case. This semantic differs from native
git behaviour and may cause push operations to fail while they would
work in native git. See:
http://dev.eclipse.org/mhonarc/lists/egit-dev/msg03585.html

Bug: 445744
Change-Id: Ib7dec10fd2ef1adbb8adbabb9d3d5a64e554286a

10 years agoOnly hide gitdir if the repository isn't bare 39/34439/2
Matthias Sohn [Mon, 6 Oct 2014 09:07:21 +0000 (11:07 +0200)]
Only hide gitdir if the repository isn't bare

This problem was raised on the jgit list
https://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02675.html

Change-Id: I8ce8a159120ce3747d31d6f012c6d2c0d0ce7917
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge branch 'stable-3.5' 68/33968/1
Matthias Sohn [Fri, 26 Sep 2014 13:45:46 +0000 (15:45 +0200)]
Merge branch 'stable-3.5'

* stable-3.5:
  Prepare 3.5.1-SNAPSHOT builds
  JGit v3.5.0.201409260305-r
  Fix PackWriterBitmapWalker handling non-existing uninteresting objects
  Enable maven site generation for jgit
  Generate javadocs as part of Maven site project reports
  Compare API changes with clirr against 3.4.1
  [cli] Use chaining credentials provider to enable .netrc
  Add chaining credentials provider
  [Java 8] Configure doclint to accept missing descriptions
  Do not use .netrc implicitly if no CredentialsProvider was set
  Prepare post 3.5.0-rc1 builds
  JGit 3.5.0.201409071800-rc1
  Fix the ls-remote command when there is no local repo

Change-Id: Iaa4485cac6ff9c7917380e89e12e416e0f52a557
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare 3.5.1-SNAPSHOT builds 63/33963/1
Matthias Sohn [Fri, 26 Sep 2014 12:56:34 +0000 (14:56 +0200)]
Prepare 3.5.1-SNAPSHOT builds

Change-Id: Ibf89f996c9d9a7e431ee09261987bb76246de441
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.5.0.201409260305-r 39/33939/1 v3.5.0.201409260305-r
Matthias Sohn [Fri, 26 Sep 2014 07:02:45 +0000 (09:02 +0200)]
JGit v3.5.0.201409260305-r

Change-Id: Ibf382bda3dcbb4b70829b1dd3a8abfd07bc4879e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix PackWriterBitmapWalker handling non-existing uninteresting objects 06/33906/5
Christian Halstrick [Thu, 25 Sep 2014 15:29:35 +0000 (17:29 +0200)]
Fix PackWriterBitmapWalker handling non-existing uninteresting objects

When writing new packs it should be allowed to specify objects as "have"
(objects which should not be included in the pack) which do not exist in
the local repository.

This works with the traditional PackWriter, but when PackWriter was
working on a repository with bitmap indexes and used
PackWriterBitmapWalker then this feature was broken. Non-existing "have"
objects lead to MissingObjectExceptions. That broke push and Gerrit
replication. When the replication target had branches unknown to the
replication source then the source repository wanted to build pack files
where "have" included branch-tips which were unknown in the source
repository.

Bug: 427107
Change-Id: I6b6598a1ec49af68aa77ea6f1f06e827982ea4ac
Also-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoEnable maven site generation for jgit 92/33892/1
Matthias Sohn [Thu, 25 Sep 2014 09:18:53 +0000 (11:18 +0200)]
Enable maven site generation for jgit

Generating the site:
$ mvn site:site

Local staging of the site:
$ mvn site:stage
the site is staged under ./target/staging/

If you can connect to build.eclipse.org over ssh
(ask webmaster if you are a committer and need ssh access)
you can deploy a local build of the site:
$ mvn site:deploy
The site is deployed under
http://download.eclipse.org/jgit/site/${project.version}

To select the ssh key to use for deploying over ssh add the following
section to your Maven settings.xml:
<server>
  <id>jgit.website</id>
  <username>username</username>
  <privateKey>${user.home}/.ssh/id_rsa</privateKey>
  <filePermissions>664</filePermission>
  <directoryPermissions>775</directoryPermissions>
  <configuration></configuration>
</server>

To deploy the site from Hudson https://hudson.eclipse.org/egit/
enable the Maven profile "build-server".

Change-Id: I7e64c8560ca75196d2232f111ffad953c14f013f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoGenerate javadocs as part of Maven site project reports 91/33891/1
Matthias Sohn [Thu, 25 Sep 2014 09:17:40 +0000 (11:17 +0200)]
Generate javadocs as part of Maven site project reports

see http://maven.apache.org/plugins/maven-javadoc-plugin/usage.html

Change-Id: I6dc5dddea0adbb4abf5560d5d1c833408e944082
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoCompare API changes with clirr against 3.4.1 90/33890/1
Matthias Sohn [Thu, 25 Sep 2014 09:15:57 +0000 (11:15 +0200)]
Compare API changes with clirr against 3.4.1

Change-Id: I76dcbb763984e7a7a526e29ec379d1f923b4253f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years ago[cli] Use chaining credentials provider to enable .netrc 99/33799/3
Matthias Sohn [Tue, 23 Sep 2014 22:06:48 +0000 (00:06 +0200)]
[cli] Use chaining credentials provider to enable .netrc

If available use credentials in .netrc otherwise prompt the user
if jgit command line needs credentials for remote operations.

Change-Id: Iea1f595618edfb87a37137db08bac8ca2d500ebc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdd chaining credentials provider 33/33733/4
Matthias Sohn [Wed, 17 Sep 2014 21:30:46 +0000 (23:30 +0200)]
Add chaining credentials provider

The chaining credentials provider sequentially tries to obtain
credentials from a list of credential providers and returns the
credentials from the first provider which can provide them.

Change-Id: I499f304119d7066d011dbde3556dee6facee8ab0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFixed API violation errors for 3.6 in ConfigConstants 13/33813/2
Andrey Loskutov [Wed, 24 Sep 2014 09:18:49 +0000 (11:18 +0200)]
Fixed API violation errors for 3.6 in ConfigConstants

Change-Id: Ibeb09eb23d47412fa93493bb4e81d24d437e31bc
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
10 years ago[Java 8] Configure doclint to accept missing descriptions 34/33734/2
Matthias Sohn [Mon, 22 Sep 2014 22:27:46 +0000 (00:27 +0200)]
[Java 8] Configure doclint to accept missing descriptions

We avoid trivial descriptions in JavaDoc. Hence configure
doclint to not fail on missing descriptions.

Change-Id: Iba3d5aec18cc7d7f43e53fa6789f0dede9996fb7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdd "aggressive" option to GC 03/33503/4
Christian Halstrick [Wed, 17 Sep 2014 13:57:25 +0000 (15:57 +0200)]
Add "aggressive" option to GC

JGit should offer the possibility to do a garbage collection in
"aggressive" mode. In this mode garbage collection more aggressively
optimize the repository at the expense of taking much more time.
Technically a aggressive mode garbage collection differs from a
non-aggressive one by:
- not reusing packed objects found in old packs. Recompress every object
- the configuration pack.window is set to 250 (the default is 10)
- the configuration pack.depths is set to 250 (the default is 50)

The associated classes in org.eclipse.jgit.api and the command line
command in org.eclipse.jgit.pgm expose this new option.

The configuration parameters gc.aggressiveDepth and gc.aggressiveWindow
have been introduced to configure this feature.

Bug: 444332
Change-Id: I024101f2810acf6be13ce144c9893d98f5c4ae76

10 years agoDo not use .netrc implicitly if no CredentialsProvider was set 10/33510/1
Matthias Sohn [Wed, 17 Sep 2014 13:16:55 +0000 (15:16 +0200)]
Do not use .netrc implicitly if no CredentialsProvider was set

Do not silently set the NetRCCredentialsProvider if no
CredentialsProvider was set explicitly since applications may want to
have full control which provider should be used.

Bug: 444338
Change-Id: Ie096983bc1caa90443a504d302bfea8f2d26ab9e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPackIndexV1 should check for possible corruption 54/33054/1
Marc Strapetz [Mon, 8 Sep 2014 15:02:33 +0000 (17:02 +0200)]
PackIndexV1 should check for possible corruption

Change-Id: I1dd741d3e522e396950c30d2f96e9713d0439078
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
10 years agoPrepare post 3.5.0-rc1 builds 14/33014/1
Matthias Sohn [Sun, 7 Sep 2014 23:01:31 +0000 (01:01 +0200)]
Prepare post 3.5.0-rc1 builds

Change-Id: Id9e01b867bff0ed10e887c15a12e5399b788b68e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit 3.5.0.201409071800-rc1 11/33011/1 v3.5.0.201409071800-rc1
Matthias Sohn [Sun, 7 Sep 2014 21:58:44 +0000 (23:58 +0200)]
JGit 3.5.0.201409071800-rc1

Change-Id: I59e5e2492820da111df1837fbf3649a2ae03841c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix the ls-remote command when there is no local repo 93/32993/1
Robin Rosenberg [Fri, 6 Jun 2014 19:18:16 +0000 (21:18 +0200)]
Fix the ls-remote command when there is no local repo

Bug: 436695
Change-Id: I567f9a8e355c7624efa3efc9bac4f3b9015afa97
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare 3.6.0-SNAPSHOT builds 24/32924/1
Matthias Sohn [Thu, 4 Sep 2014 15:06:48 +0000 (17:06 +0200)]
Prepare 3.6.0-SNAPSHOT builds

Change-Id: I2d8c3768998c0cfc8d02d11009bc5b7ed1d75778
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPackWriter: Report more stats during partial writes 83/32883/1
Shawn Pearce [Thu, 4 Sep 2014 19:41:24 +0000 (12:41 -0700)]
PackWriter: Report more stats during partial writes

It can be useful for a server operator to know how long a pack
writer spent writing out objects, even if the request aborts and
never finishes.

Record more of the stats data inside of a finally block, to
ensure these can be included into the server's monitoring.

Change-Id: I00858aa393a948f8e742e64ae4c00953eadaef95

10 years agoUpdate the README with current modules and features 52/29952/3
Robin Rosenberg [Tue, 15 Jul 2014 23:53:50 +0000 (01:53 +0200)]
Update the README with current modules and features

Change-Id: Ic30f55f30ce260dc02c428e1ebf11f01cb790a6e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoDrop warnings about unchecked casts in a few stable select places 51/29951/3
Robin Rosenberg [Tue, 15 Jul 2014 09:37:10 +0000 (11:37 +0200)]
Drop warnings about unchecked casts in a few stable select places

Change-Id: Ie163a4940f0d13bbdefd8c4643c0944c71800544

10 years agoHide warnings about field hiding in the MyersDiff code 50/29950/3
Robin Rosenberg [Tue, 15 Jul 2014 09:36:01 +0000 (11:36 +0200)]
Hide warnings about field hiding in the MyersDiff code

Just suppress warning in this stable code rather then fixing names

Change-Id: I07580aa3cbdaa66852a5c919769bbd9020d78703

10 years agoFix warnings about missing serialVersionUID 49/29949/3
Robin Rosenberg [Tue, 15 Jul 2014 09:33:58 +0000 (11:33 +0200)]
Fix warnings about missing serialVersionUID

Use @SuppressWarnings since these are private classes

Change-Id: Ic8e4c08b70627a3f9b031e2474092e1ce8116f22

10 years agoFix warning about missing serialVersionUID 48/29948/3
Robin Rosenberg [Tue, 15 Jul 2014 09:32:45 +0000 (11:32 +0200)]
Fix warning about missing serialVersionUID

Change-Id: Ia9532d1aaf92df9073c85c44ff2ca94796deefc2

10 years agoRename local variables/parameters to remove warnings about hiding 47/29947/3
Robin Rosenberg [Tue, 15 Jul 2014 09:32:23 +0000 (11:32 +0200)]
Rename local variables/parameters to remove warnings about hiding

Change-Id: I73f38492b6a2e7fd6e77005efd0a8a8c65763e74

10 years agoRemove non-existing source directories from Java 7 test build 44/29944/3
Robin Rosenberg [Tue, 15 Jul 2014 09:27:21 +0000 (11:27 +0200)]
Remove non-existing source directories from Java 7 test build

This was a copy-artifact when the bundle was created. This chanhe
removed some warnings in Eclipse.

Change-Id: I32acdf4b60bf5528566e66b1fd82113b1343ed37

10 years agoEliminate warnings for non-nls strings that will never be translated 42/29942/3
Robin Rosenberg [Tue, 15 Jul 2014 09:22:47 +0000 (11:22 +0200)]
Eliminate warnings for non-nls strings that will never be translated

Some of these eliminations just reduces the number of warnings on
lines where messages are constructed that can/will be translated.

Change-Id: I6eddb39ccc8f2488741bb58540d9ec5f5665e2c4

10 years agoWindows: Hide the .git directory if hidedotfiles is set to non-false 83/9383/48
Robin Rosenberg [Tue, 11 Feb 2014 00:06:27 +0000 (01:06 +0100)]
Windows: Hide the .git directory if hidedotfiles is set to non-false

Other .git files are not hidden with this patch

Change-Id: Idf63ca08d08f3a77c33f5848d02074f8d6a75758
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdd the resources directory to the Eclipse classpath 59/29959/3
Robin Rosenberg [Wed, 16 Jul 2014 07:41:40 +0000 (09:41 +0200)]
Add the resources directory to the Eclipse classpath

This removes a warning in Eclipse.

Change-Id: I5961ebf2052aff3e5d853451f69c7d75890ac53a

10 years agoPlotCommitList: Close plot lanes at root commits 65/32665/2
Konrad Kügler [Mon, 1 Sep 2014 19:09:59 +0000 (21:09 +0200)]
PlotCommitList: Close plot lanes at root commits

Bug: 443006
Change-Id: I40b1eb044fa2d9e6c5d4b956c17e32ca6c1bd39f
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoPrevent NPE if no CredentialsProvider is registered 26/32626/1
Matthias Sohn [Mon, 1 Sep 2014 09:27:17 +0000 (11:27 +0200)]
Prevent NPE if no CredentialsProvider is registered

If the git server requires authentication and no CredentialsProvider is
registered TransportHttp.connect() would throw an NPE since it tries to
reset the credentials provider. Instead throw a TransportException
explaining the problem.

Change-Id: Ib274e7d9c43bba301089975423de6a05ca5169f6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoHandle -m option for Merge command 41/32541/3
Axel Richard [Fri, 29 Aug 2014 12:37:09 +0000 (14:37 +0200)]
Handle -m option for Merge command

Set the commit message to be used for the merge commit (in case one is
created)

Bug: 442886
Change-Id: Ie5ecc13822faa366f00b3daa07f74c8441cae195
Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoUploadPack: Always make PackWriter.Statistics available 76/32576/1
Shawn Pearce [Fri, 29 Aug 2014 19:56:17 +0000 (12:56 -0700)]
UploadPack: Always make PackWriter.Statistics available

If the packer fails, still obtain the stats and make them available
to the logger and the caller. Failures can frequently happen when
a client disconnects in the middle of a pack stream. Server admins
may still want to examine the timing metrics from counting and
compressing phases.

Change-Id: Iceae4f68b5473f4223d85c9edfb57837fc818eed

10 years agoPackIndexV2 should check for possible corruption 01/31501/4
Marc Strapetz [Fri, 15 Aug 2014 12:02:16 +0000 (14:02 +0200)]
PackIndexV2 should check for possible corruption

Change-Id: I1803ec6d8141f07dd4085778da6461abe81c30a9
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
10 years agoAllow projects without path attribute in manifest. 18/32518/1
Yuxuan 'fishy' Wang [Fri, 29 Aug 2014 04:16:56 +0000 (21:16 -0700)]
Allow projects without path attribute in manifest.

In such case, we use the name attribute as the default value of path.

Change-Id: I53fa312d6b64c6eb2240f08af7d1d60cea99192a
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "PackIndexV2: fix possibly wrong check"
Shawn Pearce [Thu, 28 Aug 2014 23:53:36 +0000 (19:53 -0400)]
Merge "PackIndexV2: fix possibly wrong check"

10 years agoLet ObjectWalk.markUninteresting also mark the root tree as 81/31081/5
Saša Živkov [Tue, 5 Aug 2014 13:14:59 +0000 (15:14 +0200)]
Let ObjectWalk.markUninteresting also mark the root tree as
uninteresting

Using the ObjectWalk and marking a commit as uninteresting didn't mark
its root tree as uninteresting. This caused the "missing tree ..."
error in Gerrit under special circumstances. For example, if the
patch-set 2 changes only the commit message then the patch-set 1
and patch-set 2 share the same root-tree:

  ps1 -> o   o <- ps2
          \ /
           o root-tree

The transported pack will contain the ps2 commit but not the root-tree
object.

When using the BaseReceivePack.setCheckReferencedObjectsAreReachable
JGit will check the reachability of all referenced objects not provided
in the transported pack. Since the ps1 was advertised it will properly
be marked as uninteresting. However, the root-tree was reachable because
the ObjectWalk.markUninteresting missed to mark it as uninteresting.
JGit was then rejecting the pack with the "missing tree ..." exception.

Gerrit-issue: https://code.google.com/p/gerrit/issues/detail?id=1582
Change-Id: Iff2de8810f14ca304e6655fc8debeb8f3e20712b
Signed-off-by: Saša Živkov <sasa.zivkov@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoHandles repo manifest file without default remote. 44/32444/1
Yuxuan 'fishy' Wang [Wed, 27 Aug 2014 23:28:43 +0000 (16:28 -0700)]
Handles repo manifest file without default remote.

Change-Id: Ic45919a0b695e8a6f4ed47cc060e0c41f1d7e7ea
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "ReceivePack: Accept shallow lines from Git >= 1.9"
Shawn Pearce [Wed, 27 Aug 2014 20:56:16 +0000 (16:56 -0400)]
Merge "ReceivePack: Accept shallow lines from Git >= 1.9"

10 years agoReceivePack: Accept shallow lines from Git >= 1.9 34/32434/3
Shawn Pearce [Wed, 27 Aug 2014 17:41:59 +0000 (10:41 -0700)]
ReceivePack: Accept shallow lines from Git >= 1.9

In Git 1.9 (5dbd767601 "support pushing from a shallow clone")
the git-core project intentionally broke the existing send-pack
protocol from shallow clients.

Shallow clients now transmit their shallow information during push,
ahead of the old-new command sequence. JGit must accept these lines
when presented.

To protect the server against clients sending partial history,
require the connectivity check when pushed to by a shallow client.

Change-Id: I46639366b0900052c376091e1688f07def44ab79

10 years agoMerge "Strip "<", ">", and "\n" from name/email in UserConfig"
Robin Rosenberg [Fri, 22 Aug 2014 13:19:49 +0000 (09:19 -0400)]
Merge "Strip "<", ">", and "\n" from name/email in UserConfig"

10 years agoMerge "Throw URISyntaxException for incorrect percent-encoding"
Robin Rosenberg [Thu, 21 Aug 2014 21:47:51 +0000 (17:47 -0400)]
Merge "Throw URISyntaxException for incorrect percent-encoding"

10 years agoStrip "<", ">", and "\n" from name/email in UserConfig 65/32065/1
Robin Stocker [Thu, 21 Aug 2014 13:10:55 +0000 (23:10 +1000)]
Strip "<", ">", and "\n" from name/email in UserConfig

This matches what C Git does, see "stripped" in `man git-commit-tree`.

It also fixes the bug of the user where an user.email like "<>" would
show up as "<<>>" in EGit.

Bug: 439844
Change-Id: I567a3c620e191ce9d37d318417e63cb5d4483419
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoThrow URISyntaxException for incorrect percent-encoding 44/31944/3
Yi EungJun [Mon, 18 Aug 2014 09:46:19 +0000 (18:46 +0900)]
Throw URISyntaxException for incorrect percent-encoding

URIish.unescape() threw an ArrayIndexOutOfBoundsException if the given
url has incorrect percent-encoding (e.g. http://example.com/%gg). But an
URISyntaxException is much better to know the reason of the failure.

Change-Id: I3f40a26d43cd2eb4e32c11aba7dc2594bc1f98e2
Signed-off-by: Yi EungJun <eungjun.yi@navercorp.com>
10 years agoMerge "Fix minor spelling error in comment"
Robin Stocker [Tue, 19 Aug 2014 14:28:46 +0000 (10:28 -0400)]
Merge "Fix minor spelling error in comment"

10 years agoFix minor spelling error in comment 93/31893/1
Robin Rosenberg [Tue, 19 Aug 2014 14:21:02 +0000 (16:21 +0200)]
Fix minor spelling error in comment

Change-Id: I320b5cd526827844d4fe0cbc0f32551010e98090

10 years agoMerge "cleanup: Remove no-longer needed API compatibility warning filters"
Christian Halstrick [Tue, 19 Aug 2014 13:57:28 +0000 (09:57 -0400)]
Merge "cleanup: Remove no-longer needed API compatibility warning filters"

10 years agoSupport remote aliases in repo manifest. 55/31855/1
Yuxuan 'fishy' Wang [Mon, 18 Aug 2014 18:12:08 +0000 (11:12 -0700)]
Support remote aliases in repo manifest.

Change-Id: Icbe5761b9d8a4ae5305bfe45b2d042f214156fc8
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoSupport non-default remotes in project tag. 53/31853/1
Yuxuan 'fishy' Wang [Mon, 18 Aug 2014 17:57:09 +0000 (10:57 -0700)]
Support non-default remotes in project tag.

Change-Id: I3c730a1ce379d142d3ed81dda4a73f86f1f9c3eb
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoAdd tests for checking out tags with CheckoutCommand 02/31802/2
Robin Stocker [Sun, 17 Aug 2014 07:39:02 +0000 (17:39 +1000)]
Add tests for checking out tags with CheckoutCommand

Change-Id: Ifec3ac59264c91e154b832fdd907736faf8a8412
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoAdd toString to Git with repository path 03/31803/1
Robin Stocker [Sun, 17 Aug 2014 07:48:05 +0000 (17:48 +1000)]
Add toString to Git with repository path

Useful for debugging.

Change-Id: I78b92ccbcc099370fc99a1d2fa2cf60d5f5892e6
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoResolveMerger: Use the ObjectReader to access objects 71/31771/3
Shawn Pearce [Fri, 15 Aug 2014 17:21:32 +0000 (10:21 -0700)]
ResolveMerger: Use the ObjectReader to access objects

This is necessary to ensure objects accessed by the TreeWalk come from
the associated ObjectInserter when the merger is a RecursiveMerger
instance and a virtual common base was constructed but not flushed.

Change-Id: Iebe739d30fd868ebc4f61dbfb714673146a2c3ec

10 years agoPackIndexV2: fix possibly wrong check 52/31752/1
Marc Strapetz [Fri, 15 Aug 2014 12:00:40 +0000 (14:00 +0200)]
PackIndexV2: fix possibly wrong check

According to http://stackoverflow.com/a/8381338, the maximum array
size is not Integer.MAX_VALUE, but Integer.MAX_VALUE - 8

Change-Id: I6ddc7470368acd20abf0885c53c89a982bb0f176
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
10 years agoCleanup use of java.util.Inflater, fixing rare infinite loops 04/31604/4
Shawn Pearce [Wed, 13 Aug 2014 23:54:22 +0000 (16:54 -0700)]
Cleanup use of java.util.Inflater, fixing rare infinite loops

The native implementation of inflate() can set finished to return
true at the same time as it copies the last bytes into the buffer.

Check for finished on each iteration, terminating as soon as libz
knows the stream was completely inflated.

If not finished, it is likely input is required before the next
native call could do any useful work. Most invocations are passing
in a buffer large enough to store the entire result. A partial return
from inflate() will need more input before it can continue. Checking
right away that needsInput() is true saves a native call to determine
no bytes can be inflated without more input.

This should fix a rare infinite loop condition inside of inflation
when an object ends exactly at the end of a block boundary, and
the next block contains only the 20 byte trailing SHA-1.

When the stream is finished each new attempt to inflate() returns
n == 0, as no additional bytes were output. The needsInput() test
tries to add the length of the footer block to itself, but then loops
back around an reloads the same block as the block is smaller than
a full block size. A zero length input is set to the inflater,
which triggers needsInput() condition again.

Change-Id: I95d02bfeab4bf995a254d49166b4ae62d1f21346

10 years agoAdd missing @since 3.5 tag to RepoCommand.setIncludedFileReader 98/31598/1
Shawn Pearce [Wed, 13 Aug 2014 22:28:24 +0000 (15:28 -0700)]
Add missing @since 3.5 tag to RepoCommand.setIncludedFileReader

Change-Id: Ib5d24f8dafacc0d12c36927c2bbc3ebef2fff7b2

10 years agoAdd support to <include> tag in repo manifest xml. 50/31150/4
Yuxuan 'fishy' Wang [Thu, 7 Aug 2014 05:01:08 +0000 (22:01 -0700)]
Add support to <include> tag in repo manifest xml.

Change-Id: I32d468f92e24701ea680435bf3417e3850857303
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "Tweak the handling of remote url in jgit repo."
Shawn Pearce [Wed, 13 Aug 2014 20:02:57 +0000 (16:02 -0400)]
Merge "Tweak the handling of remote url in jgit repo."

10 years agoRevert "Add a method to DfsOutputStream to read as an InputStream" 52/31552/1
Shawn Pearce [Wed, 13 Aug 2014 17:42:43 +0000 (10:42 -0700)]
Revert "Add a method to DfsOutputStream to read as an InputStream"

This reverts commit b646578d89513c5db30151f0b865c7335c88d682.

openInputStream() is never used in JGit, nor is it used by any
known working DFS implementation. The method was added as a
utility for reading back from a DfsInserter, but the final
implementation of that feature does not requrire this method.

Change-Id: I075ad95e40af49c92b554480f8993ef5658f7684

10 years agoAdd a Merger.merge method that makes flushing optional 04/12504/8
Dave Borowitz [Fri, 3 May 2013 18:45:36 +0000 (11:45 -0700)]
Add a Merger.merge method that makes flushing optional

This allows callers performing multiple separate merges to reuse a
single ObjectInserter without flushing the inserter on each iteration
(which can be slow in the DFS case).

Change-Id: Icaff7d2bc2c20c873ce5a7d9af5002da84ae1c2b

10 years agoTeach mergers to use ObjectInserter.newReader() 03/12503/10
Dave Borowitz [Fri, 3 May 2013 17:54:38 +0000 (10:54 -0700)]
Teach mergers to use ObjectInserter.newReader()

This allows the RecursiveMerger to iteratively create new merge bases
without necessarily flushing packs to storage in the DFS case;
flushing only need happen at the end of the whole merge process.

Since Merger's walk now depends on its inserter, we need to construct
an inserter at Merger construction time.  This should not be a
significant increase in overhead since unused inserters don't use any
resources (beyond a reference to the Repository).

We also must release and recreate the walk whenever setObjectInserter
is called, which can break usages where setObjectInserter is called in
the middle of stateful operations on the walk.  No usages of this
method within JGit currently do this; the inserter is only ever set
before any stateful walk operations happen.

Change-Id: I9682a6aa4a2c37dccef8e163f132ddb791d79103

10 years agoTweak the handling of remote url in jgit repo. 62/31562/1
Yuxuan 'fishy' Wang [Wed, 13 Aug 2014 17:36:56 +0000 (10:36 -0700)]
Tweak the handling of remote url in jgit repo.

This kind of reverted 31148. URI.resolve actually can handle the absolute URL
well, the problem is only the missing "/".

Change-Id: Iee5866c005cbc1430dc20ee7db321b8b51afed30
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoAdd a method to ObjectInserter to read back inserted objects 22/12422/11
Dave Borowitz [Wed, 1 May 2013 17:20:31 +0000 (10:20 -0700)]
Add a method to ObjectInserter to read back inserted objects

In the DFS implementation, flushing an inserter writes a new pack to
the storage system and is potentially very slow, but was the only way
to ensure previously-inserted objects were available.  For some tasks,
like performing a series of three-way merges, the total size of all
inserted objects may be small enough to avoid flushing the in-memory
buffered data.

DfsOutputStream already provides a read method to read back from the
not-yet-flushed data, so use this to provide an ObjectReader in the
DFS case.

In the file-backed case, objects are written out loosely on the fly,
so the implementation can just return the existing WindowCursor.

Change-Id: I454fdfb88f4d215e31b7da2b2a069853b197b3dd

10 years agoDfsInserter: buffer up to streamFileThreshold from InputStream 82/31482/3
Shawn Pearce [Tue, 12 Aug 2014 21:57:28 +0000 (14:57 -0700)]
DfsInserter: buffer up to streamFileThreshold from InputStream

Since 2badedcbe0f87c0a in-core merges can write up to 10 MiB
into a TemporaryBuffer.Heap strategy, where the data is stored
as a chain of byte[] blocks.

Support the inserter reading up to the streamFileThreshold (default 50
MiB) from the supplied input stream and hash the content to determine
if the merged result blob is already present in the repository.  This
allows the inserter to avoid creating duplicate objects in more cases,
reducing repository pack file churn.

Change-Id: I38967e2a0cff14c0a856cdb46a2c8fedbeb21ed5

10 years agoMerger: clarify getBaseCommit javadoc 02/12502/3
Dave Borowitz [Fri, 3 May 2013 17:21:50 +0000 (10:21 -0700)]
Merger: clarify getBaseCommit javadoc

Change-Id: Ic52475248a545d51d3d8ac31a24f0344a1241e45

10 years agoReuse Merger's ObjectReader from ResolveMerger 01/12501/7
Dave Borowitz [Wed, 1 May 2013 22:47:23 +0000 (15:47 -0700)]
Reuse Merger's ObjectReader from ResolveMerger

The base Merger class already has a single ObjectReader instance that
it handles releasing as necessary, so creating new readers is not
necessary.

Change-Id: I990ec43af7df448c7825fc1b10e62eadaa3e0c2a

10 years agoMerge "Fix CheckoutCommand not setting up tracking"
Robin Rosenberg [Mon, 11 Aug 2014 20:23:38 +0000 (16:23 -0400)]
Merge "Fix CheckoutCommand not setting up tracking"

10 years agoMerge "Process most in-core merges without local temp files"
Shawn Pearce [Mon, 11 Aug 2014 16:42:10 +0000 (12:42 -0400)]
Merge "Process most in-core merges without local temp files"

10 years agoMerge "Update tycho and signing plugins to latest versions"
Robin Rosenberg [Mon, 11 Aug 2014 15:26:21 +0000 (11:26 -0400)]
Merge "Update tycho and signing plugins to latest versions"

10 years agoMerge "Update maven plugins to latest versions"
Robin Rosenberg [Mon, 11 Aug 2014 15:25:57 +0000 (11:25 -0400)]
Merge "Update maven plugins to latest versions"

10 years agoUpdate tycho and signing plugins to latest versions 30/31330/3
Matthias Sohn [Fri, 8 Aug 2014 22:46:43 +0000 (00:46 +0200)]
Update tycho and signing plugins to latest versions

Change-Id: I3e8b3835b8ebbb8f0a2a9be42e6c16899cb3b993
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoUpdate maven plugins to latest versions 29/31329/3
Matthias Sohn [Fri, 8 Aug 2014 22:44:21 +0000 (00:44 +0200)]
Update maven plugins to latest versions

Also, remove unused findbugs exclude filter in java7 bundle since latest
findbugs plugins raises an error on this.

Change-Id: I791fc054596e7d9aa9f3cc8126eb0162539c57bf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Remove redundant semicolon"
Robin Rosenberg [Sun, 10 Aug 2014 08:22:08 +0000 (04:22 -0400)]
Merge "Remove redundant semicolon"

10 years agoMerge "We should not warn for unqualifiedFieldAcces"
Robin Rosenberg [Sun, 10 Aug 2014 08:21:55 +0000 (04:21 -0400)]
Merge "We should not warn for unqualifiedFieldAcces"

10 years agoReplace deprecated method call in Java7 FTI test 46/29946/3
Robin Rosenberg [Tue, 15 Jul 2014 09:29:57 +0000 (11:29 +0200)]
Replace deprecated method call in Java7 FTI test

Change-Id: I3bbb6da951765d79d77aa955edeac7b5e4da5d8a

10 years agoWe should not warn for unqualifiedFieldAcces 43/29943/3
Robin Rosenberg [Tue, 15 Jul 2014 09:25:17 +0000 (11:25 +0200)]
We should not warn for unqualifiedFieldAcces

It does not make sense and I cannot explain why it slipped through.

Change-Id: I005a54cde545ea99553c0a2d6dd8d64e6e0a7611

10 years agoRemove redundant semicolon 45/29945/3
Robin Rosenberg [Tue, 15 Jul 2014 09:28:50 +0000 (11:28 +0200)]
Remove redundant semicolon

Change-Id: I15370d7807c82ee85ed7fdb05061a4baf0a77a68

10 years agoProcess most in-core merges without local temp files 36/31336/1
Shawn Pearce [Sat, 9 Aug 2014 00:53:49 +0000 (17:53 -0700)]
Process most in-core merges without local temp files

Instead of always writing to disk use TemporaryBuffer.LocalFile to
store up to 10 MiB of merge result in RAM. Most source code will
fit into this limit, avoiding local disk IO for simple merges.

Larger files will automatically spool to a temporary file that
can be cleaned up in the finally, reducing the risk of leaving
them on disk and consuming space in /tmp.

Change-Id: Ieccbd9b354d4dd3d2bc1304857325ae7a9f34ec6