]> source.dussan.org Git - jgit.git/log
jgit.git
6 years agoMerge branch 'stable-4.9' into stable-4.10 20/124320/1
Matthias Sohn [Mon, 11 Jun 2018 08:54:50 +0000 (10:54 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Ensure DirectoryStream is closed promptly

Change-Id: I62674a1db9266c04fb353ab697e2c0a24a7369b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoEnsure DirectoryStream is closed promptly 85/124285/1
Dave Borowitz [Fri, 5 Jan 2018 18:02:47 +0000 (13:02 -0500)]
Ensure DirectoryStream is closed promptly

From the javadoc for Files.list:

"The returned stream encapsulates a DirectoryStream. If timely disposal
of file system resources is required, the try-with-resources construct
should be used to ensure that the stream's close method is invoked
after the stream operations are completed."

This is the only call to Files#newDirectoryStream that is not already in
a try-with-resources.

Change-Id: I91e6c56b5d74e8435457ad6ed9e6b4b24d2aa14e
(cherry picked from commit 1c16ea4601920c9dbc7a0202efc20137e1a63d55)

6 years agoMerge branch 'stable-4.9' into stable-4.10 01/122401/1
Matthias Sohn [Thu, 10 May 2018 10:51:57 +0000 (12:51 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Retry stale file handles on .git/config file

Change-Id: I6db7256dbd1c71b23e1231809642ca21e996e066
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 00/122400/1
Matthias Sohn [Thu, 10 May 2018 10:30:05 +0000 (12:30 +0200)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Retry stale file handles on .git/config file

Change-Id: Ib029b5536c038190626e7a7ff43b70f0a5673721

6 years agoMerge branch 'stable-4.7' into stable-4.8 99/122399/1
Matthias Sohn [Thu, 10 May 2018 10:08:46 +0000 (12:08 +0200)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Retry stale file handles on .git/config file

Change-Id: Ib665c094b28eefb8236752bb273de0c2d9bf9578

6 years agoMerge branch 'stable-4.6' into stable-4.7 98/122398/1
Matthias Sohn [Thu, 10 May 2018 09:59:56 +0000 (11:59 +0200)]
Merge branch 'stable-4.6' into stable-4.7

* stable-4.6:
  Retry stale file handles on .git/config file

Change-Id: If5a21d38224528edfc551b3216daca6a2582e3ac

6 years agoMerge branch 'stable-4.5' into stable-4.6 95/122395/1
Matthias Sohn [Thu, 10 May 2018 09:39:52 +0000 (11:39 +0200)]
Merge branch 'stable-4.5' into stable-4.6

* stable-4.5:
  Retry stale file handles on .git/config file

Change-Id: Ib6e6ec0846c3ef261ec1016bfa6d26d2eadc3f26

6 years agoRetry stale file handles on .git/config file 73/120973/4
Nasser Grainawi [Fri, 6 Apr 2018 20:05:37 +0000 (14:05 -0600)]
Retry stale file handles on .git/config file

On a local non-NFS filesystem the .git/config file will be orphaned if
it is replaced by a new process while the current process is reading the
old file. The current process successfully continues to read the
orphaned file until it closes the file handle.

Since NFS servers do not keep track of open files, instead of orphaning
the old .git/config file, such a replacement on an NFS filesystem will
instead cause the old file to be garbage collected (deleted).  A stale
file handle exception will be raised on NFS clients if the file is
garbage collected (deleted) on the server while it is being read.  Since
we no longer have access to the old file in these cases, the previous
code would just fail. However, in these cases, reopening the file and
rereading it will succeed (since it will open the new replacement file).
Since retrying the read is a viable strategy to deal with stale file
handles on the .git/config file, implement such a strategy.

Since it is possible that the .git/config file could be replaced again
while rereading it, loop on stale file handle exceptions, up to 5 extra
times, trying to read the .git/config file again, until we either read
the new file, or find that the file no longer exists. The limit of 5 is
arbitrary, and provides a safe upper bounds to prevent infinite loops
consuming resources in a potential unforeseen persistent error
condition.

Change-Id: I6901157b9dfdbd3013360ebe3eb40af147a8c626
Signed-off-by: Nasser Grainawi <nasser@codeaurora.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoDon't subclass ThreadLocal to avoid memory leak in NLS 43/115043/4
Matthias Sohn [Mon, 8 Jan 2018 09:40:23 +0000 (10:40 +0100)]
Don't subclass ThreadLocal to avoid memory leak in NLS

These problem usually occur when you subclass ThreadLocal (usually to
implement initialValue). Those classes reference the webapp's
classloader. The ThreadLocal subclass in turn is referenced by each
Thread instance (that's how ThreadLocals are implemented, they have a
"helper-Map" in each Thread instance, so the leak is actually not a tiny
Random instance but the whole webapp's classloader with a bunch of class
definitions and statically referenced parts of the webapp.

Bug: 449321
Change-Id: Ie7a8b0b90e40229e2471202f2a12637b9e0b1d11
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoSet context classloader to null in WorkQueue 41/115041/3
Matthias Sohn [Mon, 8 Jan 2018 09:14:33 +0000 (10:14 +0100)]
Set context classloader to null in WorkQueue

If threads created by the executor have a reference to the context
classloader this may cause a leak.

See: https://wiki.apache.org/tomcat/MemoryLeakProtection#cclThreadSpawnedByWebApp
Bug: 517107
Change-Id: If79c1ebd3f9cf733fd88a5fce38fd46ff0d08d10
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 96/117396/1
Matthias Sohn [Wed, 14 Feb 2018 20:24:54 +0000 (21:24 +0100)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Fix ssh host name handling for Jsch
  Jsch overrides the port in the URI with the one in ~/.ssh/config

Change-Id: Iff9076f65e767bbe8df016337b631bdaeb40ad98
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix ssh host name handling for Jsch 48/117348/1
Thomas Wolf [Wed, 14 Feb 2018 12:39:28 +0000 (13:39 +0100)]
Fix ssh host name handling for Jsch

If we give Jsch access to the ssh config file, we must _not_ resolve
the host name from the alias. Instead we must give the alias (i.e.,
the host name as is in the URI) to Jsch, so that it finds the same
ssh config entry.

Otherwise if the hostname in the URI, which is taken as an alias in
ssh config ("Host" line), is unequal to the "Hostname" line, and
there happens to be another ssh config entry with that translated
host name as alias, Jsch will pick up that second entry, and we end
up with a strange mixture of both.

Add tests for this case.

Bug: 531118
Change-Id: I249d8c073b0190ed110a69dca5b9be2a749822c3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoJsch overrides the port in the URI with the one in ~/.ssh/config 47/117347/1
Thomas Wolf [Wed, 14 Feb 2018 12:05:17 +0000 (13:05 +0100)]
Jsch overrides the port in the URI with the one in ~/.ssh/config

Jsch unconditionally overwrites the port from the ssh config
file (if a port is specified there), even if the URI explicitly does
give a different port.

Fix this, and add tests.

Change-Id: I7b014543c7ece26270e366db39d7647f82d64f0d
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoMerge branch 'stable-4.9' into stable-4.10 09/116509/2
David Pursehouse [Thu, 1 Feb 2018 08:36:10 +0000 (17:36 +0900)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Minor fixes in three error messages

Change-Id: Ibd6bcecb40a6d97c46c66360020dca7453876298
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMinor fixes in three error messages 95/116395/1
Thomas Wolf [Tue, 30 Jan 2018 06:33:56 +0000 (07:33 +0100)]
Minor fixes in three error messages

* Fix "can not" -> "cannot" in two messages
* Re-word "Cannot mkdir" to "Cannot create directory"

Change-Id: Ide0cec55eeeebd23bccc136257c80f47638ba858
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoMerge branch 'stable-4.9' into stable-4.10 41/115341/1
Matthias Sohn [Fri, 12 Jan 2018 23:51:28 +0000 (00:51 +0100)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Revert handling of ssh IdentityFile to pre-4.9 behavior

Change-Id: I7cd2f0fe93be5193d6de2a376a023bdece5d84a9

6 years agoRevert handling of ssh IdentityFile to pre-4.9 behavior 94/115294/1
Thomas Wolf [Fri, 12 Jan 2018 11:51:22 +0000 (12:51 +0100)]
Revert handling of ssh IdentityFile to pre-4.9 behavior

Jsch caches keys (aka identities) specified in ~/.ssh/config via
IndentityFile only for the current Jsch Session. This results in
multiple password prompts for successive sessions.

Do the handling of IdentityFile exclusively in JGit, as it was before
4.9. JGit uses different Jsch instances per host and caches the
IdentityFile there, allowing it to be re-used in different sessions
for the same host.

* Add comments to explain this.
* Move the JschBugFixingConfig from OpenSshConfig to
  JschConfigSessionFactory to have all these Jsch work-arounds
  in one place.
* Make that config hide the IdentityFile config from Jsch to avoid
  that Jsch overrides the JGit behavior.

Bug: 529173
Change-Id: Ib36c34a2921ba736adeb64de71323c2b91151613
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoPrepare 4.10.1-SNAPSHOT builds 37/114837/1
Matthias Sohn [Sun, 31 Dec 2017 02:22:35 +0000 (03:22 +0100)]
Prepare 4.10.1-SNAPSHOT builds

Change-Id: I139fb660c4630d9d073eabf37ff26ea3a823bcbd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.10.0.201712302008-r 33/114833/1 v4.10.0.201712302008-r
Matthias Sohn [Sun, 31 Dec 2017 01:08:55 +0000 (02:08 +0100)]
JGit v4.10.0.201712302008-r

Change-Id: I9cc3a839d906acd01829df1de64cfafca8a6d008
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoWorkingTreeIterator should pass FS to submodules 66/113366/4
Marc Strapetz [Wed, 13 Dec 2017 21:46:47 +0000 (22:46 +0100)]
WorkingTreeIterator should pass FS to submodules

Change-Id: I4b7bc6bab449b9e3aebba8170788ff9e4a04195a
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
6 years agoCloneCommand: option to set FS to be used 65/113365/4
Marc Strapetz [Wed, 13 Dec 2017 22:01:37 +0000 (23:01 +0100)]
CloneCommand: option to set FS to be used

Change-Id: If8342974d07b7d89a6c5721a6dd03826886aa89e
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
6 years agoInitCommand: option to set FS to be used 64/113364/3
Marc Strapetz [Wed, 13 Dec 2017 21:58:14 +0000 (22:58 +0100)]
InitCommand: option to set FS to be used

Change-Id: I95c72f3bdc2da748adbb0d82af72f60650821aab
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
6 years agoAdd a command to deinitialize submodules 55/110155/6
David Turner [Fri, 13 Oct 2017 18:56:04 +0000 (14:56 -0400)]
Add a command to deinitialize submodules

Change-Id: Iaaefc2cbafbf083d6ab158b1c378ec69cc76d282
Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUse submodule name instead of path as key in config 07/110407/4
David Turner [Thu, 19 Oct 2017 20:58:07 +0000 (16:58 -0400)]
Use submodule name instead of path as key in config

When a submodule is moved, the "name" field remains the same, while
the "path" field changes.  Git uses the "name" field in .git/config
when a submodule is initialized, so this patch makes JGit do so too.

Change-Id: I48d8e89f706447b860c0162822a8e68170aae42b
Signed-off-by: David Turner <dturner@twosigma.com>
6 years agoRequire maven 3.5.2 55/114755/1
Matthias Sohn [Wed, 27 Dec 2017 01:54:40 +0000 (02:54 +0100)]
Require maven 3.5.2

This prepares builds on Java 9 [1].

The maven 2 tag "prerequisites" is not honored by maven 3
hence use maven-enforcer-plugin to enforce the minimum
maven version.

[1] https://issues.apache.org/jira/browse/MNG-6148

Change-Id: I57f5051a0641b1bd21f9f888f1a17d8f98e879e5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUpdate japicmp-maven-plugin to 0.11.0 54/114754/1
Matthias Sohn [Tue, 26 Dec 2017 22:27:17 +0000 (23:27 +0100)]
Update japicmp-maven-plugin to 0.11.0

Change-Id: Ia0c5308fc4544a3b3a4fd6a19947cfc9a33af9c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoURIish: support for empty ports 10/113110/3
Marc Strapetz [Sat, 9 Dec 2017 12:23:28 +0000 (13:23 +0100)]
URIish: support for empty ports

Properly parse URLs like "ssh://host:/path"

Bug: 519187
Change-Id: I0054868e30509e4ba919444be16c2a20f741545a
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
6 years agoUpgrade spotbugs-maven-plugin to 3.1.0 17/114617/2
David Pursehouse [Fri, 22 Dec 2017 02:36:24 +0000 (11:36 +0900)]
Upgrade spotbugs-maven-plugin to 3.1.0

Change-Id: I1817afd3f75bd1f030f1b5c6bc683afa51dc5a6b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAdd header Automatic-Module-Name for Java 9 84/114584/3
Karsten Thoms [Thu, 21 Dec 2017 13:26:37 +0000 (14:26 +0100)]
Add header Automatic-Module-Name for Java 9

Bug: 529075
Change-Id: I4532ce2c80eb91531d46026676502d636ccda706
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' 05/114705/1
Matthias Sohn [Fri, 22 Dec 2017 23:36:45 +0000 (00:36 +0100)]
Merge branch 'stable-4.9'

* stable-4.9:
  Strings#convertGlob: fix escaping of patterns like [\[].

Change-Id: I18d55537002b3153db35f8a6b60f2f5317d17248
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoStrings#convertGlob: fix escaping of patterns like [\[]. 26/114526/2
Dmitry Pavlenko [Fri, 15 Dec 2017 20:15:35 +0000 (21:15 +0100)]
Strings#convertGlob: fix escaping of patterns like [\[].

Originally the patterns were escaped twice leading
to wrong matching results.

Bug: 528886
Change-Id: I26e201b4b0ef51cac08f940b76f381260fa925ca
Signed-off-by: Dmitry Pavlenko <pavlenko@tmatesoft.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge changes I8a37eaf8,Id8a5b591
David Pursehouse [Thu, 21 Dec 2017 23:31:54 +0000 (18:31 -0500)]
Merge changes I8a37eaf8,Id8a5b591

* changes:
  Remove maven profile jgit.java8
  Reenable failing the build on javadoc errors

6 years agoMerge changes I0f1df93b,Ifd40129b,I1b059e1a
Dave Borowitz [Thu, 21 Dec 2017 17:01:04 +0000 (12:01 -0500)]
Merge changes I0f1df93b,Ifd40129b,I1b059e1a

* changes:
  ConfigTest: Add some additional comment parsing tests
  Config: Drop backslash in invalid escape sequences in subsections
  Config: Match C git behavior more closely in escaping values

6 years agoMerge branch 'stable-4.9' 01/114601/1
Dave Borowitz [Thu, 21 Dec 2017 16:12:13 +0000 (11:12 -0500)]
Merge branch 'stable-4.9'

* stable-4.9:
  Make PackInserter public

Change-Id: I367c6111661f3005419e2becd695e04e65202f97

6 years agoMake PackInserter public 98/114598/1
Dave Borowitz [Thu, 21 Dec 2017 14:46:55 +0000 (09:46 -0500)]
Make PackInserter public

The intent with the setCompressionLevel and checkExisting methods (which
are already public) is for callers to be able to call them, but they
can't do that if the class itself is not public.

Change-Id: I014044fec3bfa1d33775500345efd60eb5d45bde

6 years agoConfigTest: Add some additional comment parsing tests 94/114594/2
Dave Borowitz [Thu, 21 Dec 2017 14:04:56 +0000 (09:04 -0500)]
ConfigTest: Add some additional comment parsing tests

Change-Id: I0f1df93bd1ceeb847771ea6484f9de539e8c177b

6 years agoConfig: Drop backslash in invalid escape sequences in subsections 91/114591/2
Dave Borowitz [Thu, 21 Dec 2017 13:55:45 +0000 (08:55 -0500)]
Config: Drop backslash in invalid escape sequences in subsections

These are ignored by C git when parsing:

$ git config -f - --list <<EOF
[foo "x\0y"]
bar = baz
[foo "x\qy"]
bar = baz
[foo "x\by"]
bar = baz
[foo "x\ny"]
bar = baz
[foo "x\ty"]
bar = baz
EOF
foo.x0y.bar=baz
foo.xqy.bar=baz
foo.xby.bar=baz
foo.xny.bar=baz
foo.xty.bar=baz

This behavior is different from value parsing, where an invalid escape
sequence is an error (which JGit already does as well):

$ git config -f - --list <<EOF
[foo]
bar = x\qy
EOF
fatal: bad config line 2 in standard input

Change-Id: Ifd40129b37d9a62df3d886d8d7e22f766f54e9d1

6 years agoConfig: Match C git behavior more closely in escaping values 90/114590/2
Dave Borowitz [Thu, 21 Dec 2017 13:41:52 +0000 (08:41 -0500)]
Config: Match C git behavior more closely in escaping values

So this happened:

$ git config -f foo.config foo.a 'x"y'
$ git config -f foo.config foo.b x\\y
$ git config -f foo.config foo.c $'x\ny'
$ git config -f foo.config foo.d $'x\ty'
$ git config -f foo.config foo.e $'x\by'
$ cat foo.config
[foo]
        a = x\"y
        b = x\\y
        c = x\ny
        d = x\ty
        e = y

That last line is my shell interpreting the backspace byte:

$ python -c 'print repr(open("foo.config").read())'
'[foo]\n\ta = x\\"y\n\tb = x\\\\y\n\tc = x\\ny\n\td = x\\ty\n\te = x\x08y\n'

Change-Id: I1b059e1afb544c39ddb587c07bf79a06e99d0a09

6 years agoRemove maven profile jgit.java8 80/114580/1
Matthias Sohn [Thu, 21 Dec 2017 13:00:02 +0000 (14:00 +0100)]
Remove maven profile jgit.java8

This profile isn't needed any longer since we require Java 8 as minimum
version.

Change-Id: I8a37eaf874473ff4004b9c074a810dddebde54c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoReenable failing the build on javadoc errors 29/114529/3
Matthias Sohn [Thu, 21 Dec 2017 10:55:27 +0000 (11:55 +0100)]
Reenable failing the build on javadoc errors

Change-Id: Id8a5b59119f3d40dea1bb46ef060a6abfff2f6bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix remaining javadoc errors raised by doclint 28/114528/1
Matthias Sohn [Thu, 21 Dec 2017 00:36:18 +0000 (01:36 +0100)]
Fix remaining javadoc errors raised by doclint

For now ignore doclint "missing" warnings.

Change-Id: I0e5af7a757f4d92ffeeb113f30576a35414d6781
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUpdate last jgit release version to 4.9.2.201712150930-r 27/114527/1
Matthias Sohn [Wed, 20 Dec 2017 23:11:46 +0000 (00:11 +0100)]
Update last jgit release version to 4.9.2.201712150930-r

Change-Id: I57ff69d2fdfe0b3e694f51ed01c0423343c2d14d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit util packages 49/114449/3
Matthias Sohn [Tue, 19 Dec 2017 22:06:46 +0000 (23:06 +0100)]
Fix javadoc in org.eclipse.jgit util packages

Change-Id: Ia655f45153bcf1d422ffffce6dcf914847e14c4c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit treewalk package 90/114390/3
Matthias Sohn [Tue, 19 Dec 2017 13:23:06 +0000 (14:23 +0100)]
Fix javadoc in org.eclipse.jgit treewalk package

Change-Id: I1f9d9a005c7228c9881762a78228accad2c7a6d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit transport package 87/114387/3
Matthias Sohn [Tue, 19 Dec 2017 10:55:51 +0000 (11:55 +0100)]
Fix javadoc in org.eclipse.jgit transport package

Change-Id: Id70e2c27e38bf12f87e66b28fbd0b06908494764
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' 09/114509/1
Dave Borowitz [Wed, 20 Dec 2017 19:39:11 +0000 (14:39 -0500)]
Merge branch 'stable-4.9'

* stable-4.9:
  PackInserter: Ensure objects are written at the end of the pack
  ObjectInserter: Add warning about mixing read-back with writes

Change-Id: I308e7c1c6b72e8d4d9b5d0f4f51e9815fc92d7d7

6 years agoPackInserter: Ensure objects are written at the end of the pack 00/114500/1
Dave Borowitz [Wed, 20 Dec 2017 17:36:03 +0000 (12:36 -0500)]
PackInserter: Ensure objects are written at the end of the pack

When interleaving reads and writes from an unflushed pack, we forgot to
reset the file pointer back to the end of the file before writing more
new objects. This had at least two unfortunate effects:
  * The pack data was potentially corrupt, since we could overwrite
    previous portions of the file willy-nilly.
  * The CountingOutputStream would report more bytes read than the size
    of the file, which stored the wrong PackedObjectInfo, which would
    cause EOFs during reading.

We already had a test in PackInserterTest which was supposed to catch
bugs like this, by interleaving reads and writes. Unfortunately, it
didn't catch the bug, since as an implementation detail we always read a
full buffer's worth of data from the file when inflating during
readback. If the size of the file was less than the offset of the object
we were reading back plus one buffer (8192 bytes), we would completely
accidentally end up back in the right place in the file.

So, add another test for this case where we read back a small object
positioned before a large object. Before the fix, this test exhibited
exactly the "Unexpected EOF" error reported at crbug.com/gerrit/7668.

Change-Id: I74f08f3d5d9046781d59e5bd7c84916ff8225c3b

6 years agoObjectInserter: Add warning about mixing read-back with writes 99/114499/1
Dave Borowitz [Wed, 20 Dec 2017 17:16:40 +0000 (12:16 -0500)]
ObjectInserter: Add warning about mixing read-back with writes

Change-Id: Ib0460d3c7df315d86f9adca5f66a8fd4c39e4060

6 years agoFix javadoc leftovers in org.eclipse.jgit api package 50/114450/2
Matthias Sohn [Tue, 19 Dec 2017 22:21:57 +0000 (23:21 +0100)]
Fix javadoc leftovers in org.eclipse.jgit api package

Change-Id: I2150889b5ed04e8739e2367fc9023b750b516398
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRemove unused imports 51/114451/2
Matthias Sohn [Tue, 19 Dec 2017 22:18:38 +0000 (23:18 +0100)]
Remove unused imports

Change-Id: I35370c66e54d93d9b0aa3995e300706956ec0923
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoReplace explicit calls to initCause where possible 63/114363/4
David Pursehouse [Tue, 19 Dec 2017 05:05:40 +0000 (14:05 +0900)]
Replace explicit calls to initCause where possible

Where the exception being thrown has a constructor that takes a
Throwable, use that instead of instantiating the exception and then
explicitly calling initCause.

Change-Id: I06a0df407ba751a7af8c1c4a46f9e2714f13dbe3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge changes I50095928,Idadec0ab,I1f2747d6,I6d2a7e28
David Pursehouse [Tue, 19 Dec 2017 23:02:11 +0000 (18:02 -0500)]
Merge changes I50095928,Idadec0ab,I1f2747d6,I6d2a7e28

* changes:
  LargeObjectException: Add constructor that takes Throwable
  InvalidPatternException: Add constructor that takes Throwable
  Don't unnecessarily explicitly call CorruptObjectException#initCause
  Use new StoredObjectRepresentationNotAvailableException constructor

6 years agoLargeObjectException: Add constructor that takes Throwable 62/114362/2
David Pursehouse [Tue, 19 Dec 2017 05:08:38 +0000 (14:08 +0900)]
LargeObjectException: Add constructor that takes Throwable

Change-Id: I500959286075f8ba4d0aa5820febd28c9c94ea1b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoInvalidPatternException: Add constructor that takes Throwable 61/114361/2
David Pursehouse [Tue, 19 Dec 2017 05:02:34 +0000 (14:02 +0900)]
InvalidPatternException: Add constructor that takes Throwable

Change-Id: Idadec0abc1c6d76f19f51a65a4b45df444c20486
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDon't unnecessarily explicitly call CorruptObjectException#initCause 57/114357/2
David Pursehouse [Tue, 19 Dec 2017 02:37:08 +0000 (11:37 +0900)]
Don't unnecessarily explicitly call CorruptObjectException#initCause

CorruptObjectException has a constructor that takes Throwable and
calls initCause with it.  Use that instead of instantiating the
exception and explicitly calling initCause.

Change-Id: I1f2747d6c4cc5249e93401b9787eb4ceb50cb995
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUse new StoredObjectRepresentationNotAvailableException constructor 56/114356/2
David Pursehouse [Tue, 19 Dec 2017 02:19:10 +0000 (11:19 +0900)]
Use new StoredObjectRepresentationNotAvailableException constructor

In 5e7eed4 a new StoredObjectRepresentationNotAvailableException
constructor was added, that takes a Throwable to initialize the
exception cause.

Update more call sites to use this constructor instead of first
instantiating it and explicitly calling initCause().

All callers now use the new constructor, so annotate the other one as
deprecated.

Change-Id: I6d2a7e289a95f0360ddebf904cfd8b6c18fef10c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFix javadoc in org.eclipse.jgit submodule package 82/113682/2
Matthias Sohn [Mon, 18 Dec 2017 23:21:39 +0000 (00:21 +0100)]
Fix javadoc in org.eclipse.jgit submodule package

Change-Id: Idc2a32a2e10d1cfc0b23a4f3fd1bf29840724336
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit storage/file and pack package 81/113681/2
Matthias Sohn [Mon, 18 Dec 2017 23:16:02 +0000 (00:16 +0100)]
Fix javadoc in org.eclipse.jgit storage/file and pack package

Change-Id: If1fee165782823dc21d896073f60ee838365463d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit revwalk package 80/113680/2
Matthias Sohn [Mon, 18 Dec 2017 23:01:55 +0000 (00:01 +0100)]
Fix javadoc in org.eclipse.jgit revwalk package

Change-Id: I3fabab8afa284b1919ab7bc656cab19e56ed474e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit patch and revplot package 79/113679/2
Matthias Sohn [Mon, 18 Dec 2017 22:45:58 +0000 (23:45 +0100)]
Fix javadoc in org.eclipse.jgit patch and revplot package

Change-Id: I6f1aba98bf7034cb51494c546806cf1b72dd1473
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit nls and notes package 78/113678/2
Matthias Sohn [Mon, 18 Dec 2017 22:29:46 +0000 (23:29 +0100)]
Fix javadoc in org.eclipse.jgit nls and notes package

Change-Id: I1b65fba5b4856f98974dc10f549540d401ef916f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit merge package 35/113635/4
Matthias Sohn [Mon, 18 Dec 2017 16:07:03 +0000 (17:07 +0100)]
Fix javadoc in org.eclipse.jgit merge package

Change-Id: I735d0f2e9f10531ed43b7b3dd6314c574392422f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit lib package 31/113631/3
Matthias Sohn [Mon, 18 Dec 2017 15:52:40 +0000 (16:52 +0100)]
Fix javadoc in org.eclipse.jgit lib package

Change-Id: I1e85a951488177993521ce177fdea212615e6164
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit storage/reftree package 28/113628/3
Matthias Sohn [Mon, 18 Dec 2017 15:00:44 +0000 (16:00 +0100)]
Fix javadoc in org.eclipse.jgit storage/reftree package

Change-Id: Ie206b5340ad2019a1e0bd2bcede2c1e5a279f2d5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit storage/reftable package 27/113627/3
Matthias Sohn [Mon, 18 Dec 2017 14:56:57 +0000 (15:56 +0100)]
Fix javadoc in org.eclipse.jgit storage/reftable package

Change-Id: I14764c5d5b2309d82fe2ccc0593120b51328bf41
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit storage/pack package 25/113625/3
Matthias Sohn [Mon, 18 Dec 2017 14:33:32 +0000 (15:33 +0100)]
Fix javadoc in org.eclipse.jgit storage/pack package

Change-Id: Id1b7d392e1bb36079edaf16450e73a044a318e7e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit storage/io package 24/113624/3
Matthias Sohn [Mon, 18 Dec 2017 14:18:21 +0000 (15:18 +0100)]
Fix javadoc in org.eclipse.jgit storage/io package

Change-Id: I2db781311af79510b26fd05cc0556623e75e3eff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit storage/file package 23/113623/3
Matthias Sohn [Mon, 18 Dec 2017 14:17:21 +0000 (15:17 +0100)]
Fix javadoc in org.eclipse.jgit storage/file package

Change-Id: Ieb2f66aef2cab7e2a6d8e35c5f5047da881994dd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit dfs package 20/113620/4
Matthias Sohn [Mon, 18 Dec 2017 13:45:52 +0000 (14:45 +0100)]
Fix javadoc in org.eclipse.jgit dfs package

Change-Id: I1f5e3dc3ba34b323ee7244dbefee207ce19e6021
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoStoredObjectRepresentationNotAvailableException: Add TODO to fix API in 5.0 55/114355/1
David Pursehouse [Tue, 19 Dec 2017 01:48:06 +0000 (10:48 +0900)]
StoredObjectRepresentationNotAvailableException: Add TODO to fix API in 5.0

Change-Id: I9a0e6acac1b88ddf257fe7b2b7d0142be20250ea
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoStoredObjectRepresentationNotAvailableException: Add constructor that takes cause 89/113589/3
David Pursehouse [Mon, 18 Dec 2017 05:34:13 +0000 (14:34 +0900)]
StoredObjectRepresentationNotAvailableException: Add constructor that takes cause

If the cause can be passed into the constructor, callers don't need to
instantiate it and then explicitly call initCause.

Note that the constructors in this class cause "non-API parameter type"
warnings because ObjectToPack is internal, however it's probably OK
since the only non-internal reference to it is in the pgm.debug package.

Change-Id: Ia4eab24e79f9afe6214ea8160137d941d4048319
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge changes Ifc34e96a,I72be0a0d
David Pursehouse [Mon, 18 Dec 2017 23:33:40 +0000 (18:33 -0500)]
Merge changes Ifc34e96a,I72be0a0d

* changes:
  Fix javadoc in org.eclipse.jgit rewalk package
  Fix javadoc in org.eclipse.jgit ketch package

6 years agoConfig: Rewrite subsection and value escaping and parsing 65/113665/2
Dave Borowitz [Mon, 18 Dec 2017 20:35:02 +0000 (15:35 -0500)]
Config: Rewrite subsection and value escaping and parsing

Previously, Config was using the same method for both escaping and
parsing subsection names and config values. The goal was presumably code
savings, but unfortunately, these two pieces of the git config format
are simply different.

In git v2.15.1, Documentation/config.txt says the following about
subsection names:

  "Subsection names are case sensitive and can contain any characters
  except newline (doublequote `"` and backslash can be included by
  escaping them as `\"` and `\\`, respectively).  Section headers cannot
  span multiple lines.  Variables may belong directly to a section or to
  a given subsection."

And, later in the same documentation section, about values:

  "A line that defines a value can be continued to the next line by
  ending it with a `\`; the backquote and the end-of-line are stripped.
  Leading whitespaces after 'name =', the remainder of the line after
  the first comment character '#' or ';', and trailing whitespaces of
  the line are discarded unless they are enclosed in double quotes.
  Internal whitespaces within the value are retained verbatim.

  Inside double quotes, double quote `"` and backslash `\` characters
  must be escaped: use `\"` for `"` and `\\` for `\`.

  The following escape sequences (beside `\"` and `\\`) are recognized:
  `\n` for newline character (NL), `\t` for horizontal tabulation (HT,
  TAB) and `\b` for backspace (BS).  Other char escape sequences
  (including octal escape sequences) are invalid."

The main important differences are that subsection names have a limited
set of supported escape sequences, and do not support newlines at all,
either escaped or unescaped. Arguably, it would be easy to support
escaped newlines, but C git simply does not:

  $ git config -f foo.config $'foo.bar\nbaz.quux' value
  error: invalid key (newline): foo.bar
  baz.quux

I468106ac was an attempt to fix one bug in escapeValue, around leading
whitespace, without having to rewrite the whole escaping/parsing code.
Unfortunately, because escapeValue was used for escaping subsection
names as well, this made it possible to write invalid config files, any
time Config#toText is called with a subsection name with trailing
whitespace, like {foo }.

Rather than pile hacks on top of hacks, fix it for real by largely
rewriting the escaping and parsing code.

In addition to fixing escape sequences, fix (and write tests for) a few
more issues in the old implementation:

* Now that we can properly parse it, always emit newlines as "\n" from
  escapeValue, rather than the weird (but still supported) syntax with a
  non-quoted trailing literal "\n\" before the newline. In addition to
  producing more readable output and matching the behavior of C git,
  this makes the escaping code much simpler.
* Disallow '\0' entirely within both subsection names and values, since
  due to Unix command line argument conventions it is impossible to pass
  such values to "git config".
* Properly preserve intra-value whitespace when parsing, rather than
  collapsing it all to a single space.

Change-Id: I304f626b9d0ad1592c4e4e449a11b136c0f8b3e3

6 years agoFix javadoc in org.eclipse.jgit rewalk package 19/113619/2
Matthias Sohn [Mon, 18 Dec 2017 13:05:44 +0000 (14:05 +0100)]
Fix javadoc in org.eclipse.jgit rewalk package

Change-Id: Ifc34e96a56df30e3b73bef812eea943623af7906
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit ketch package 18/113618/2
Matthias Sohn [Mon, 18 Dec 2017 13:04:41 +0000 (14:04 +0100)]
Fix javadoc in org.eclipse.jgit ketch package

Change-Id: I72be0a0d5ac7d3e957597803bd103dbbec141ba4

6 years agoFix javadoc in org.eclipse.jgit internal and fsck packages 16/113616/1
Matthias Sohn [Mon, 18 Dec 2017 12:25:04 +0000 (13:25 +0100)]
Fix javadoc in org.eclipse.jgit internal and fsck packages

Change-Id: Ib12da10aacda9389d594bf4f521e9a58d1935701
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit ignore package 14/113614/2
Matthias Sohn [Mon, 18 Dec 2017 12:17:49 +0000 (13:17 +0100)]
Fix javadoc in org.eclipse.jgit ignore package

Change-Id: I1a81d371420cd4cf90ab9e048026c0ab8a763018
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit hooks package 11/113611/3
Matthias Sohn [Mon, 18 Dec 2017 10:55:56 +0000 (11:55 +0100)]
Fix javadoc in org.eclipse.jgit hooks package

Change-Id: I3b644048eb0fc19f94ba8f9799b5a2310481103f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit gitrepo package 10/113610/3
Matthias Sohn [Mon, 18 Dec 2017 10:51:33 +0000 (11:51 +0100)]
Fix javadoc in org.eclipse.jgit gitrepo package

Change-Id: I2604c7bca87f005004d6d6c80fa9a39a7a1e3807
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit fnmatch package 09/113609/3
Matthias Sohn [Mon, 18 Dec 2017 10:45:55 +0000 (11:45 +0100)]
Fix javadoc in org.eclipse.jgit fnmatch package

Change-Id: I14384c3bf3c41f8e1c62ec117837c2fc782a832f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit events package 08/113608/3
Matthias Sohn [Mon, 18 Dec 2017 10:39:12 +0000 (11:39 +0100)]
Fix javadoc in org.eclipse.jgit events package

Change-Id: Ifcb9c67daeb9da84a1461a4f731523ac5df3a223
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit errors package 06/113606/3
Matthias Sohn [Mon, 18 Dec 2017 10:34:31 +0000 (11:34 +0100)]
Fix javadoc in org.eclipse.jgit errors package

Change-Id: I46aa5c3073b99a311a1a97fc57d8f29d32524482
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit dircache package 05/113605/3
Matthias Sohn [Mon, 18 Dec 2017 10:15:00 +0000 (11:15 +0100)]
Fix javadoc in org.eclipse.jgit dircache package

Change-Id: Ib485eb217ac6be70519816f8cc0396931043a3d1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoEmtpyCommitException: Add TODO to fix misspelled class name in 5.0 88/113588/2
David Pursehouse [Mon, 18 Dec 2017 05:22:54 +0000 (14:22 +0900)]
EmtpyCommitException: Add TODO to fix misspelled class name in 5.0

Change-Id: I5bb145d6d6cbaaa2d8cfb2febad7a008ca921236
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge "PushConnectionTest: Increase maxCommandBytes yet again"
Christian Halstrick [Mon, 18 Dec 2017 10:50:03 +0000 (05:50 -0500)]
Merge "PushConnectionTest: Increase maxCommandBytes yet again"

6 years agoMerge changes I7162d729,I2761ea91
David Pursehouse [Mon, 18 Dec 2017 10:49:51 +0000 (05:49 -0500)]
Merge changes I7162d729,I2761ea91

* changes:
  Fix javadoc org.eclipse.jgit diff package
  Fix javadoc in org.eclipse.jgit annotations and api packages

6 years agoMerge "Repeat: Fix javadoc to say 'annotation' instead of 'interface'"
Christian Halstrick [Mon, 18 Dec 2017 10:48:45 +0000 (05:48 -0500)]
Merge "Repeat: Fix javadoc to say 'annotation' instead of 'interface'"

6 years agoMerge "Remove redundant @SuppressWarnings("unused")"
Christian Halstrick [Mon, 18 Dec 2017 10:48:09 +0000 (05:48 -0500)]
Merge "Remove redundant @SuppressWarnings("unused")"

6 years agoMerge "PathTreeFilterHandler: Remove unused import"
Christian Halstrick [Mon, 18 Dec 2017 10:46:12 +0000 (05:46 -0500)]
Merge "PathTreeFilterHandler: Remove unused import"

6 years agoFix javadoc org.eclipse.jgit diff package 83/113583/4
Matthias Sohn [Sun, 17 Dec 2017 23:56:12 +0000 (00:56 +0100)]
Fix javadoc org.eclipse.jgit diff package

Change-Id: I7162d72916abc8533ad37e8b17335ff4a70d6519
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit annotations and api packages 78/113578/3
Matthias Sohn [Sun, 17 Dec 2017 23:18:40 +0000 (00:18 +0100)]
Fix javadoc in org.eclipse.jgit annotations and api packages

Change-Id: I2761ea91f8dfed16ea54e7a6646af03a30c15ec9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit blame package 80/113580/4
Matthias Sohn [Sun, 17 Dec 2017 23:36:39 +0000 (00:36 +0100)]
Fix javadoc in org.eclipse.jgit blame package

Change-Id: I116dacc7f4ace341ec6ffae2ab96b53496d89f64
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit attributes package 79/113579/4
Matthias Sohn [Sun, 17 Dec 2017 23:29:12 +0000 (00:29 +0100)]
Fix javadoc in org.eclipse.jgit attributes package

Change-Id: I12968f4be805266f285a518a014b8bd1d0c23bae
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPushConnectionTest: Increase maxCommandBytes yet again 51/113551/2
David Pursehouse [Sun, 17 Dec 2017 06:33:39 +0000 (15:33 +0900)]
PushConnectionTest: Increase maxCommandBytes yet again

It was already increased in 61a943e and 661232b but is still not
enough to take into account snapshot versions that are 100 or more
commits ahead of tag, i.e. 4.9.2.201712150930-r.105-gc1d37ca27

Change-Id: Ibeff73adae06b92fe5bb9c5eced9e4c6a08c437c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRepeat: Fix javadoc to say 'annotation' instead of 'interface' 86/113586/1
David Pursehouse [Mon, 18 Dec 2017 01:21:37 +0000 (10:21 +0900)]
Repeat: Fix javadoc to say 'annotation' instead of 'interface'

Change-Id: Ib0c4ec28d6b7e2fc0fe71f7dc53dd12ccd6e8a2f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRemove redundant @SuppressWarnings("unused") 85/113585/1
David Pursehouse [Mon, 18 Dec 2017 01:19:53 +0000 (10:19 +0900)]
Remove redundant @SuppressWarnings("unused")

These are now redundant since the parameters have javadoc.

Change-Id: I6bfde267e1712ee35871c30c8203c3b4dc5e136a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoPathTreeFilterHandler: Remove unused import 84/113584/1
David Pursehouse [Mon, 18 Dec 2017 01:17:37 +0000 (10:17 +0900)]
PathTreeFilterHandler: Remove unused import

Change-Id: I7a91210dcb775d0c9b46772f8ff3d84196ba3b10
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFix javadoc in org.eclipse.jgit.ui 72/113572/2
Matthias Sohn [Sun, 17 Dec 2017 20:46:10 +0000 (21:46 +0100)]
Fix javadoc in org.eclipse.jgit.ui

Change-Id: Iec68c73fc0d8d26fdb26850354059ea521ac7fe5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit.pgm 71/113571/2
Matthias Sohn [Sun, 17 Dec 2017 20:36:30 +0000 (21:36 +0100)]
Fix javadoc in org.eclipse.jgit.pgm

Change-Id: I74616f6e8ef69bef4db2f13a9b47ddf57714fd1f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit.lfs.server 70/113570/1
Matthias Sohn [Sun, 17 Dec 2017 19:59:02 +0000 (20:59 +0100)]
Fix javadoc in org.eclipse.jgit.lfs.server

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