]> source.dussan.org Git - jgit.git/log
jgit.git
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 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>
6 years agoFix javadoc in org.eclipse.jgit.lfs 69/113569/2
Matthias Sohn [Sun, 17 Dec 2017 19:48:52 +0000 (20:48 +0100)]
Fix javadoc in org.eclipse.jgit.lfs

Change-Id: I97b53c083da6aa31719d9e10369030ee33dd23dc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit.junit 68/113568/2
Matthias Sohn [Sun, 17 Dec 2017 18:50:13 +0000 (19:50 +0100)]
Fix javadoc in org.eclipse.jgit.junit

Change-Id: I1107e6a82849ac329361baabb5c481d86ea6dc9e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit.junit.http 67/113567/1
Matthias Sohn [Sun, 17 Dec 2017 18:49:40 +0000 (19:49 +0100)]
Fix javadoc in org.eclipse.jgit.junit.http

Change-Id: I8af6d07676a285f79635405e5891535a5adfd7e9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit.http.test 66/113566/1
Matthias Sohn [Sat, 16 Dec 2017 23:13:29 +0000 (00:13 +0100)]
Fix javadoc in org.eclipse.jgit.http.test

Change-Id: Ibd18dfed05d35bd70498d11c04c026a34114a87e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit.http.server 65/113565/1
Matthias Sohn [Sat, 16 Dec 2017 23:12:44 +0000 (00:12 +0100)]
Fix javadoc in org.eclipse.jgit.http.server

Change-Id: I732d773b21bbf64285493070964dd9e442eab5d8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit.http.apache 64/113564/1
Matthias Sohn [Sat, 16 Dec 2017 23:04:11 +0000 (00:04 +0100)]
Fix javadoc in org.eclipse.jgit.http.apache

Change-Id: I38a4854856b0103790a410b48c1c3d708b6500c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit.archive 63/113563/1
Matthias Sohn [Sat, 16 Dec 2017 23:01:03 +0000 (00:01 +0100)]
Fix javadoc in org.eclipse.jgit.archive

Change-Id: Ibef80b15f17e884f3085e324283cefc738236a4d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix javadoc in org.eclipse.jgit.ant 62/113562/1
Matthias Sohn [Sat, 16 Dec 2017 22:53:05 +0000 (23:53 +0100)]
Fix javadoc in org.eclipse.jgit.ant

Change-Id: I97231080ebe040ad44f7189de6109b9626424d2f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUpgrade maven-javadoc-plugin to 3.0.0 91/113291/3
David Pursehouse [Wed, 13 Dec 2017 01:35:23 +0000 (10:35 +0900)]
Upgrade maven-javadoc-plugin to 3.0.0

This version seems to be much stricter and reports a lot more errors
in the javadoc formatting.

Disable failOnError to prevent the build from failing due to these
newly reported problems. These should be fixed in a follow-up commit.

Change-Id: Ia403cbedf72cfe8bdaf09f30e42e3bf96084ae52
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUpgrade maven-surefire{-report}-plugin to 2.20.1 90/113290/3
David Pursehouse [Wed, 13 Dec 2017 01:36:56 +0000 (10:36 +0900)]
Upgrade maven-surefire{-report}-plugin to 2.20.1

Change-Id: If3979b36ac0e1fd66f31f8a92e76b0e47d066a3b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUpgrade maven-dependency-plugin to 3.0.2 89/113289/3
David Pursehouse [Wed, 13 Dec 2017 01:36:26 +0000 (10:36 +0900)]
Upgrade maven-dependency-plugin to 3.0.2

Change-Id: I1ed9f0e0ebdcadc4ddc56a78894b3a4220ae26ac
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUpgrade maven-shade-plugin to 3.1.0 88/113288/3
David Pursehouse [Wed, 13 Dec 2017 01:35:54 +0000 (10:35 +0900)]
Upgrade maven-shade-plugin to 3.1.0

Change-Id: I14d746dfbfcea0d87378894b74c0cd673253f566
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.9' 15/113515/2
David Pursehouse [Sat, 16 Dec 2017 13:04:01 +0000 (14:04 +0100)]
Merge branch 'stable-4.9'

* stable-4.9:
  Prepare 4.9.3-SNAPSHOT builds
  JGit v4.9.2.201712150930-r
  Write packed-refs directly when cloning

Change-Id: I3b0fad9c45cdf3a918ddb8ea4a37b8d3403aae90
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.9.3-SNAPSHOT builds 17/113517/1
Matthias Sohn [Sat, 16 Dec 2017 02:49:03 +0000 (03:49 +0100)]
Prepare 4.9.3-SNAPSHOT builds

Change-Id: Ife3f2b0b5407227f89ded42358adbf01d53e14cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoDfsFsck: Skip unborn branches and symrefs to nowhere 09/113509/2
Zhen Chen [Fri, 15 Dec 2017 20:58:49 +0000 (12:58 -0800)]
DfsFsck: Skip unborn branches and symrefs to nowhere

The map returned by getAllRefs includes all refs, including symrefs like
HEAD that may not point to any object yet. That is a valid state (e.g.,
in a new repository that has just been created by "git init"), so skip
such refs.

Change-Id: Ieff8a1aa738b8d09a2990d075eb20601156b70d3
Signed-off-by: Zhen Chen <czhen@google.com>
6 years agoJGit v4.9.2.201712150930-r 75/113475/1 v4.9.2.201712150930-r
Matthias Sohn [Fri, 15 Dec 2017 14:29:36 +0000 (15:29 +0100)]
JGit v4.9.2.201712150930-r

Change-Id: I013964045d532659a4be3b81d6612b59bc9ffb14
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoWrite packed-refs directly when cloning 12/113412/5
Thomas Wolf [Thu, 14 Dec 2017 12:24:00 +0000 (13:24 +0100)]
Write packed-refs directly when cloning

When we are cloning we have no refs at all yet, and there cannot
(or at least should not) be any other thread doing something with
refs yet.

Locking loose refs is thus not needed, since there are no loose
refs yet and nothing should be trying to create them concurrently.

Let's skip the whole loose ref locking when we are cloning a repository.
As a result, JGit will write the refs directly to the packed-refs
file, and will not create the refs/remotes/ directories nor the
lock files underneath when cloning and packed refs are used. Since
no lock files are created, any problems on case-insensitive file
systems with tag or branch names that differ only in case are avoided
during cloning.

Detect if we are cloning based on the following heuristics:
* HEAD is a dangling symref
* There is no loose ref
* There is no packed-refs file

Note, however, that there may still be problems with such tag or
branch names later on. This is primarily a five-minutes-past-twelve
stop-gap measure to resolve the referenced bug, which affects the
Oxygen.2 release.

Bug: 528497
Change-Id: I57860c29c210568165276a123b855e462b6a107a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoConfigTest: Remove redundant assignment 49/113449/1
David Pursehouse [Fri, 15 Dec 2017 00:33:50 +0000 (09:33 +0900)]
ConfigTest: Remove redundant assignment

Change-Id: Ia913dbe6b7ad4b7000525fda8ca08cbc8dd87da6
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.9' 48/113448/1
David Pursehouse [Fri, 15 Dec 2017 00:21:28 +0000 (09:21 +0900)]
Merge branch 'stable-4.9'

* stable-4.9:
  Config: Remove the include functionality

Merged with "-s ours" because the fix on stable conflicts with
the fix already done here.

Change-Id: I85e394422d5dc40ca33ed3a78ddbf5cd1da1664a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoConfig: Remove the include functionality 47/113447/1
David Pursehouse [Thu, 14 Dec 2017 23:50:28 +0000 (08:50 +0900)]
Config: Remove the include functionality

The Config class must be safe to run against untrusted input files.
Reading arbitrary local system paths using include.path is risky for
servers, including Gerrit Code Review.

This was fixed on master [1] by making "readIncludedConfig" a noop
by default. This allows only FileBasedConfig, which originated from
local disk, to read local system paths.

However, the "readIncludedConfig" method was only introduced in [2]
which was needed by [3], both of which are only on the master branch.
On the stable branch only Config supports includes. Therefore this
commit simply disables the include functionality.

[1] https://git.eclipse.org/r/#/c/113371/
[2] https://git.eclipse.org/r/#/c/111847/
[3] https://git.eclipse.org/r/#/c/111848/

Bug: 528781
Change-Id: I9a3be3f1d07c4b6772bff535a2556e699a61381c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.9' 72/113372/1
David Pursehouse [Thu, 14 Dec 2017 02:05:01 +0000 (11:05 +0900)]
Merge branch 'stable-4.9'

* stable-4.9:
  InMemoryRepository: Make inner class MemObjDatabase static

Change-Id: I62bb5957de1ae3bc6030ea2181b09efccc48252b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMake Config.readIncludedConfig a noop by default 71/113371/2
Shawn Pearce [Thu, 14 Dec 2017 01:35:38 +0000 (17:35 -0800)]
Make Config.readIncludedConfig a noop by default

The Config class must be safe to run against untrusted input files.
Reading arbitrary local system paths using include.path is risky for
servers, including Gerrit Code Review.  Return null by default to
incide the include should be ignored.

Only FileBasedConfig which originated from local disk should be trying
to read local system paths.  FileBasedConfig already overrides this
method with its own implementation.

Change-Id: I2ff31753868aa1bbac4a6843a4c23e50bd6f46f3

6 years agoDfsBlockCache.hasBlock0: quickly check for file in cache 70/113370/1
Shawn Pearce [Thu, 14 Dec 2017 01:10:51 +0000 (17:10 -0800)]
DfsBlockCache.hasBlock0: quickly check for file in cache

This can be useful for sophisticated pre-read algorithms to quickly
determine if a file is likely already in cache, especially small
reftables which may be smaller than a typical DFS block size.

Change-Id: I7756948063b722ff650c9ba82060ff9ad554b0ba

6 years agoMerge branch 'stable-4.9' 85/113285/1
David Pursehouse [Wed, 13 Dec 2017 00:51:44 +0000 (09:51 +0900)]
Merge branch 'stable-4.9'

* stable-4.9:
  TransportCommand#setTimeout: Specify units for timeout in Javadoc
  Fix typo in key of a JGitText externalized string

Change-Id: Icb60537d2e99cb6e928d9fe07f66695ed69081b5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUpdpate oxygen orbit to R20170919201930 and remove old orbit repos 66/112766/3
Matthias Sohn [Sun, 3 Dec 2017 10:11:22 +0000 (11:11 +0100)]
Updpate oxygen orbit to R20170919201930 and remove old orbit repos

Change-Id: I2bf09cc3b08ebc762390e2892b966b11027e2e89
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove use of deprecated X509HostnameVerifier 65/112765/3
Matthias Sohn [Fri, 1 Dec 2017 23:03:42 +0000 (00:03 +0100)]
Remove use of deprecated X509HostnameVerifier

Change-Id: I318f5457ade3d11b2ac1c99f6ef382a0a147a352
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUpdate Apache httpclient to 4.5.2 and httpcore to 4.4.6 64/112764/3
Matthias Sohn [Sun, 3 Dec 2017 10:04:41 +0000 (11:04 +0100)]
Update Apache httpclient to 4.5.2 and httpcore to 4.4.6

CQ: 15051
CQ: 15052
Change-Id: I532cd73253601ce1d2926850af2519aae6744a9c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove unused API filters 34/112934/2
David Pursehouse [Wed, 6 Dec 2017 10:48:36 +0000 (19:48 +0900)]
Remove unused API filters

Change-Id: Ie8bfa4e8473c2a68a6308de7dbf29ccbca97495d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoInMemoryRepository: Make inner class MemObjDatabase static 52/112952/3
David Pursehouse [Wed, 6 Dec 2017 14:31:38 +0000 (23:31 +0900)]
InMemoryRepository: Make inner class MemObjDatabase static

FindBugs reports:

  This class is an inner class, but does not use its embedded reference
  to the object which created it. This reference makes the instances
  of the class larger, and may keep the reference to the creator object
  alive longer than necessary. If possible, the class should be made
  static.

Change-Id: I9f49de32b4cd81b7ef1239b390353689263bf66e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoTransportCommand#setTimeout: Specify units for timeout in Javadoc 97/113197/1
David Turner [Mon, 11 Dec 2017 20:20:25 +0000 (15:20 -0500)]
TransportCommand#setTimeout: Specify units for timeout in Javadoc

Change-Id: Iadf0e2c6483794e43a5326f6be6bb34c19b00564
Signed-off-by: David Turner <dturner@twosigma.com>
6 years agoFix typo in key of a JGitText externalized string 27/113127/1
Matthias Sohn [Sun, 10 Dec 2017 17:33:23 +0000 (18:33 +0100)]
Fix typo in key of a JGitText externalized string

Change-Id: I0d22e24a0aa3b17339ef68849554f7c99b350dde
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix typo in key of a JGitText externalized string 24/113124/1
Matthias Sohn [Sun, 10 Dec 2017 17:33:23 +0000 (18:33 +0100)]
Fix typo in key of a JGitText externalized string

Change-Id: I0d22e24a0aa3b17339ef68849554f7c99b350dde
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' 23/113123/1
Matthias Sohn [Sun, 10 Dec 2017 17:10:25 +0000 (18:10 +0100)]
Merge branch 'stable-4.9'

* stable-4.9:
  Fix IllegalThreadStateException if stderr closed without exiting

Change-Id: I8a6a6788c2bb000171233b88d9592ed0640ad15e

6 years agoFix IllegalThreadStateException if stderr closed without exiting 22/113122/1
Dmitry Pavlenko [Thu, 7 Dec 2017 18:36:35 +0000 (19:36 +0100)]
Fix IllegalThreadStateException if stderr closed without exiting

If some process executed by FS#readPipe lived for a while after
closing stderr, FS#GobblerThread#run failed with an
IllegalThreadStateException exception when accessing p.exitValue()
for the process which is still alive.

Add Process#waitFor calls to wait for the process completion.

Bug: 528335
Change-Id: I87e0b6f9ad0b995dbce46ddfb877e33eaf3ae5a6
Signed-off-by: Dmitry Pavlenko <pavlenko@tmatesoft.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge "URIishTest: more Windows file-protocol tests"
Thomas Wolf [Sat, 9 Dec 2017 21:27:18 +0000 (16:27 -0500)]
Merge "URIishTest: more Windows file-protocol tests"

6 years agoURIishTest: more Windows file-protocol tests 83/113083/2
Marc Strapetz [Sat, 9 Dec 2017 11:12:24 +0000 (12:12 +0100)]
URIishTest: more Windows file-protocol tests

Change-Id: Id5fbd8bb9cd05da89d27e9532612d64ae84a55ba
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
6 years agoPackInserterTest: Prevent potential NPE dereferencing Path.getFileName() 49/113049/1
David Pursehouse [Fri, 8 Dec 2017 08:21:35 +0000 (17:21 +0900)]
PackInserterTest: Prevent potential NPE dereferencing Path.getFileName()

Path.getFileName() may return null if the path has zero elements.

Enclose the dereference in a null-check.

Change-Id: I7ea3d3f07edc13a80b593d28e8fd512a4e1ed56b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoCloneCommand: Refactor listing of files in deleteChildren 48/113048/1
David Pursehouse [Fri, 8 Dec 2017 08:13:10 +0000 (17:13 +0900)]
CloneCommand: Refactor listing of files in deleteChildren

File.listFiles() returns null if the given File does not represent a
directory, so we can just test for null instead of making a separate
call to FS.DETECTED.isDirectory()

This also avoids a false-positive error from SpotBugs which claims
that there is a potential null-pointer exception on dereferencing the
result of Files.listFiles().

Change-Id: I18e09e391011db997470f5a09d8e38bb604c0213
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSpecify consistent version range for junit in OSGi manifests 38/113038/2
David Pursehouse [Thu, 7 Dec 2017 22:29:51 +0000 (07:29 +0900)]
Specify consistent version range for junit in OSGi manifests

There are several different version ranges specified in the various
manifest files.

Align them all to the same range:  [4.12,5.0.0)

Change-Id: I02205b8b8546c9f53ed431b5fd9abf6ddcda4423
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>