summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Optimize RefAdvertiser for wire protocolShawn Pearce2016-06-183-5/+211
| | | | | | | | | | | | | The native wire protocol sends ref advertisements in the pkt-line format, which requires encoding the ObjectId and ref name onto a byte sequence. Busy servers show this is a very high source of garbage, which pushes the garbage collector harder when there are many refs in the repository (e.g. 70k, in a Gerrit managed repository). Optimize the side band advertiser by retaining the CharsetEncoder, minimizing the amount of temporary garbage built during encoding. Change-Id: I406c654bf82c1eb94b38862da2425e98396134cb
* Merge branch 'stable-4.4'Matthias Sohn2016-06-144-23/+113
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.4: Prepare 4.4.1-SNAPSHOT builds JGit v4.4.0.201606070830-r Prepare 4.4.0-SNAPSHOT builds JGit v4.4.0.201606011500-rc2 Prepare 4.4.0-SNAPSHOT builds JGit v4.4.0.201605250940-rc1 Update Orbit repository for Neon to R20160520211859 Fix computation of id in WorkingTreeIterator with autocrlf and smudging Prepare 4.3.2-SNAPSHOT builds JGit v4.3.1.201605051710-r Prepare 4.4.0-SNAPSHOT builds JGit v4.4.0.201605041135-m1 Run Maven build in release.sh concurrently to speedup release Change-Id: I25ef0497a4455b8229b453e1023abb4631d4b6d3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 4.4.1-SNAPSHOT buildsMatthias Sohn2016-06-0756-304/+304
| | | | | | | | | | Change-Id: I4fe1c84b1418126f5b245b8a4f72bb7e37f48eae Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.4.0.201606070830-rv4.4.0.201606070830-rMatthias Sohn2016-06-0756-59/+59
| | | | | | | | | | Change-Id: I5c771a62ac0420424a655a4025c62a4bc28dc44e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 4.4.0-SNAPSHOT buildsMatthias Sohn2016-06-0156-59/+59
| | | | | | | | | | Change-Id: Ib41dfe4103f013ba87a1ce62ee24bc9e10300eff Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.4.0.201606011500-rc2v4.4.0.201606011500-rc2Matthias Sohn2016-06-0156-59/+59
| | | | | | | | | | Change-Id: Ifd7b7baba7d676a630e2f742d369c4186ea450a6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Merge branch 'master' into stable-4.4Matthias Sohn2016-06-0148-89/+409
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Fix javadoc errors and unused imports introduced by ddd0fe25 RepoCommand: record manifest shallow recommendation in .gitmodules RepoCommand: record manifest groups as submodule labels Remove the deprecated TestRepository.getClock() method Replace use of deprecated method Repository.getRef() [findBugs] Prevent potential NPE in FileLfsRepository.getOutputStream() Better report on client side if push failed due to too large object [findBugs] Prevent potential NPE in CloneCommand.init() RepoCommand: remove --record-remote-branches RepoCommandTest: Improve assertion message for remote branch recording Change-Id: I4fbce4f84925a933fcc9a48058ed6793f5821b97 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare 4.4.0-SNAPSHOT buildsMatthias Sohn2016-05-2556-59/+59
| | | | | | | | | | | | | | | Change-Id: Iba6e423294d3315465648d19087a674a73b5ef28 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v4.4.0.201605250940-rc1v4.4.0.201605250940-rc1Matthias Sohn2016-05-2556-59/+59
| | | | | | | | | | | | | | | Change-Id: Idd8e1664730b979cfbd9a2196081a48a1efa3330 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Update Orbit repository for Neon to R20160520211859Matthias Sohn2016-05-252-3/+3
| | | | | | | | | | | | Change-Id: I5e051a652848d8aae0d10c9e1bd42f6b320145f9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Merge branch 'master' into stable-4.4Matthias Sohn2016-05-2440-57/+672
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: JGit CLI: allow to call git init with specific directory Redirect all Show output to outs Support git config [include] section with absolute path(s) Added filter for merge and non-merges commits. [findBugs] Prevent potential NPE in FS_POSIX.readUmask() [findBugs] Fix calculation of host header in SignerV4 Update Orbit repository to S20160518051658 for Neon RC2 Fix StashApply regarding handling of untracked files GC should not pack objects only referenced by ORIG_HEAD,... Make sure to overwrite files when "reset --hard" detects conflicts Allow setting FileMode to executable when applying patches in ApplyCommand Fix config value get to return last instead of 1st just like git Remove UTF-8 checking duplication in Config lib subclasses Update Maven plugins Fix type parameter in javadoc in TestRepository.delete(String ref) TestRepository: Add delete() method Make BaseReceivePack.setAtomic public ReceivePack: Pass atomic setting from client to BatchRefUpdate Change-Id: I5c9c5b7ccb23fb48b44b3da10b2c5d876d043d24 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * \ \ Merge branch 'stable-4.3' into stable-4.4Matthias Sohn2016-05-2414-55/+179
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.3: Fix computation of id in WorkingTreeIterator with autocrlf and smudging Prepare 4.3.2-SNAPSHOT builds JGit v4.3.1.201605051710-r Scan loose ref before packed in case gc about to remove the loose Fix possible NPEs when reporting transport errors Fix calling of clean/smudge filters from Checkout,MergeCommands Fix ApplyCommand when result of patch is an empty file Change-Id: I829f06699f6670e519d04c927bdba4b82df29199 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | | Fix computation of id in WorkingTreeIterator with autocrlf and smudgingChristian Halstrick2016-05-233-21/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit failed to do checkouts when the index contained smudged entries and autocrlf was on. In such cases the WorkingTreeIterator calculated the SHA1 sometimes on content which was not correctly filtered. The SHA1 was computed on content which two times went through a lf->crlf conversion. We used to tell the treewalk whether it is a checkin or checkout operation and always use the related filters when reading any content. If on windows and autocrlf is true and we do a checkout operation then we always used a lf->crlf conversion on any text content. That's not correct. Even during a checkout we sometimes need the crlf->lf conversion. E.g. when calculating the content-id for working-tree content we need to use crlf->lf filtering although the overall operation type is checkout. Often this bug does not have effects because we seldom compute the content-id of filesystem content during a checkout. But we do need to know whether a file is dirty or not before we overwrite it during a checkout. And if the index entries are smudged we don't trust the index and compute filesystem-content-sha1's explicitly. This caused EGit not to be able to switch branches anymore on Windows when autocrlf was true. EGit denied the checkout because it thought workingtree files are dirty because content-sha1 are computed on wrongly filtered content. Bug: 493360 Change-Id: I1072a57b4c529ba3aaa50b7b02d2b816bb64a9b8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | | Prepare 4.3.2-SNAPSHOT buildsMatthias Sohn2016-05-1956-301/+301
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I71997a8be83841765111cb7b55506bd8edd8adad Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | | JGit v4.3.1.201605051710-rv4.3.1.201605051710-rMatthias Sohn2016-05-0556-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I25fb72cc17d7a27b0b69746d907dac9ccd4d7997 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | Prepare 4.4.0-SNAPSHOT buildsMatthias Sohn2016-05-0456-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ib95be1300b1b95cc7e8153170d509282bdc4e328 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | JGit v4.4.0.201605041135-m1v4.4.0.201605041135-m1Matthias Sohn2016-05-0456-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ic9b6d7dae293887c3ac3a11f92e153501abad1dc Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | Run Maven build in release.sh concurrently to speedup releaseMatthias Sohn2016-05-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iad8696825bb81becab945cd9ed2c33bea3778e17 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | Update Neon orbit repository to final release R20160520211859Matthias Sohn2016-06-103-5/+5
| | | | | | | | | | | | | | | | | | | | Change-Id: I7c439ab7679472217426453bd0a7c443ebd4b009 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | Merge "Add method to read time unit from config"Shawn Pearce2016-06-104-0/+219
|\ \ \ \ \
| * | | | | Add method to read time unit from configHugo Arès2016-06-064-0/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Time units supported: -milliseconds (1 ms, 2 milliseconds) -seconds (1 s, 1 sec, 1 second, 2 seconds) -minutes (1 m, 1 min, 1 minute, 2 minutes) -hours (1 h, 1 hr, 1 hour, 2 hours) -days (1 d, 1 day, 2 days) -weeks (1 w, 1 week, 2 weeks) -months (1 mon, 1 month, 2 months) -years (1 y, 1 year, 2 years) This functionality is implemented in Gerrit ConfigUtil class. Add it to JGit so it can eventually be remove from Gerrit. Change-Id: I2d6564ff656b6ab9424a9360624061c94fd5f413 Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
* | | | | | http transport does not use authentication fallbackChristian Pontesegger2016-06-063-13/+41
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git servers supporting HTTP transport can send multiple WWW-Authenticate challenges [1] for different authentication schemes the server supports. If authentication fails now retry all authentication types proposed by the server. [1] https://tools.ietf.org/html/rfc2617#page-3 Bug: 492057 Change-Id: I01d438a5896f9b1008bd6b751ad9c7cbf780af1a Signed-off-by: Christian Pontesegger <christian.pontesegger@web.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | Add $NON-NLS to suppress "Non-externalized string literal" warningsHugo Arès2016-06-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1643775c6b200a5963ac1a6ca9b4d6e807e0b45a Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
* | | | | BatchRefUpdate: Include command message in toString()Dave Borowitz2016-06-021-1/+5
| | | | | | | | | | | | | | | | | | | | Change-Id: I359f33af5aa84af77c3628e6cd9a5ee3f7f38d49
* | | | | Merge "DfsBlock: throw DataFormatException on 0 bytes"Shawn Pearce2016-06-022-2/+10
|\ \ \ \ \
| * | | | | DfsBlock: throw DataFormatException on 0 bytesShawn Pearce2016-06-012-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setInput should always push at least 1 byte into the Inflater. If 0 bytes (or negative!) are being sent the DfsBlock is inconsistent with the position passed in. This indicates a severe programming problem in the caller, and may cause an infinite loop in DfsReader. Today we saw a handful of live examples of this but don't know what the cause is. Guard against this error condition and throw with a more verbose failure, which may prevent an infinite loop. Callers will eventually catch DataFormatException and rethrow with more detail about the object that cannot be inflated, with the DFE in the chain. Change-Id: I64ed2a471520e48283675c6210c6db8a60634635
* | | | | | Merge "Add missing @Test annotation in RepositoryCacheTest"Christian Halstrick2016-06-021-0/+1
|\ \ \ \ \ \
| * | | | | | Add missing @Test annotation in RepositoryCacheTestHugo Arès2016-06-011-0/+1
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | Change-Id: I25a9b294084f7b9769efa67001a4973647da4079 Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
* | | | | | Merge "Add missing @Test annotations"Christian Halstrick2016-06-022-0/+2
|\ \ \ \ \ \ | |_|/ / / / |/| | | | |
| * | | | | Add missing @Test annotationsHugo Arès2016-06-012-0/+2
| |/ / / / | | | | | | | | | | | | | | | | | | | | Change-Id: Ie5ffcbf18233dc9b3eb232f714b5b58b6b93f4e0 Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
* | | | | Merge "Prepare 4.5.0-SNAPSHOT builds"Matthias Sohn2016-06-0156-304/+304
|\ \ \ \ \
| * | | | | Prepare 4.5.0-SNAPSHOT buildsMatthias Sohn2016-06-0156-304/+304
| |/ / / / | | | | | | | | | | | | | | | | | | | | Change-Id: I572fe9fea0e5ca0bec4648c916ae95a5b1ccf125 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* / / / / DfsInserter: Optionally disable existing object checkDave Borowitz2016-06-012-1/+42
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using a DfsInserter for high-throughput insertion of many objects (analogous to git-fast-import), we don't necessarily want to do a random object lookup for each. It'll be faster from the inserter's perspective to insert the duplicate objects and let a later GC handle the deduplication. Change-Id: Ic97f5f01657b4525f157e6df66023f1f07fc1851
* | | | Fix javadoc errors and unused imports introduced by ddd0fe25Matthias Sohn2016-06-013-5/+6
| | | | | | | | | | | | | | | | Change-Id: I2d17115843e453c71febd4a58527effe658b48fd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | RepoCommand: record manifest shallow recommendation in .gitmodulesStefan Beller2016-05-314-5/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git core learned about the submodule.<name>.shallow option in .gitmodules files, which is a recommendation to clone a submodule shallow. A repo manifest may record a clone depth recommendation as an optional field, which contains more information than a binary shallow/nonshallow recommendation, so any attempted conversion may be lossy. In practice the clone depth recommendation is either '1' or doesn't exist, which is the binary behavior we have in Git core. Change-Id: I51aa9cb6d1d9660dae6ab6d21ad7bae9bc5325e6 Signed-off-by: Stefan Beller <sbeller@google.com>
* | | | RepoCommand: record manifest groups as submodule labelsStefan Beller2016-05-313-8/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git core learned about attributes in pathspecs: pathspec: allow querying for attributes The pathspec mechanism is extended via the new ":(attr:eol=input)pattern/to/match" syntax to filter paths so that it requires paths to not just match the given pattern but also have the specified attrs attached for them to be chosen. (177161a5f7, 2016-05-20) We intend to use these pathspec attribute patterns for submodule grouping, similar to the grouping in repo. So the RepoCommand which translates repo manifest files into submodules should propagate this information along. This requires writing information to the .gitattributes file instead of the .gitmodules file. For now we just overwrite any existing .gitattributes file and do not care about prior attributes set. If this becomes an issue we need to figure out how to correctly amend the grouping information to an existing .gitattributes file. Change-Id: I0f55b45786b6b8fc3d5be62d7f6aab9ac00ed60e Signed-off-by: Stefan Beller <sbeller@google.com>
* | | | Remove the deprecated TestRepository.getClock() methodTerry Parker2016-05-311-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gitles was the holdout and TestRepository.getClock() was removed via: https://gerrit.googlesource.com/gitiles/+/f10481d8384d1695e6981b805c4e5e462e4b71ea Change-Id: I90c0fc17be4891545b097a49763b0f0c202cc004 Signed-off-by: Terry Parker <tparker@google.com>
* | | | Replace use of deprecated method Repository.getRef()Matthias Sohn2016-05-3135-58/+58
| | | | | | | | | | | | | | | | Change-Id: Iecf2b8deafc4991cc3333702fb9fa0638be7b914 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | [findBugs] Prevent potential NPE in FileLfsRepository.getOutputStream()Matthias Sohn2016-05-301-1/+4
| | | | | | | | | | | | | | | | Change-Id: I6f91997e8a976e5f4ace91c082d8b9adf1451adc Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Better report on client side if push failed due to too large objectMatthias Sohn2016-05-304-4/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGits PushCommand and BasePackPushConnection were throwing a generic exception when the pushed pack-file was rejected by the server since it contained too large objects. Teach JGit to better analyze the server's response to detect this situation and throw a more specific exception. Detect this situation by parsing the status line sent by the server. This change only recognizes the response sent by a JGit based server. All other servers which report such problems in a different way still lead to a generic TransportExceptions. Also see https://git.eclipse.org/r/#/c/46348/ Change-Id: I8d6d65e4585ebb3846f7207e7d1a2f82fa9cbd86 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | [findBugs] Prevent potential NPE in CloneCommand.init()Matthias Sohn2016-05-303-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | File.listFiles() returns null if the File is not a directory, improve validation of directory and gitDir to fix this. Change-Id: I763d08835faf96a0beb8e706992df0908526bd2c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Merge "RepoCommandTest: Improve assertion message for remote branch recording"Terry Parker2016-05-261-2/+2
|\ \ \ \
| * | | | RepoCommandTest: Improve assertion message for remote branch recordingStefan Beller2016-05-251-2/+2
| | |_|/ | |/| | | | | | | | | | | | | | Change-Id: Ic14e9f9c4bf007b464e463f5047ec5a8d0b9236c Signed-off-by: Stefan Beller <sbeller@google.com>
* / | | RepoCommand: remove --record-remote-branchesStefan Beller2016-05-252-5/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | This function only works in bare mode, and the command line works in non-bare mode, so there's no point in pretending to support it here. Change-Id: Ia017aded93d072bdb9947ec08c424256c3abe438 Signed-off-by: Stefan Beller <sbeller@google.com>
* | | JGit CLI: allow to call git init with specific directoryRüdiger Herrmann2016-05-223-2/+102
| | | | | | | | | | | | | | | | | | | | | | | | With this change it is possible to initialize repositories with 'git init /path/to/new/repo' Change-Id: Ia9b288b4fb34887e8f5e2f3f270e521c44d41b6a Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Redirect all Show output to outsRüdiger Herrmann2016-05-211-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | The Show command wrote all diffs to System.out instead of 'outs. Bug: 494143 Change-Id: Ibc78e9a058b7a32d536e03e294c1d933b6c26ba7 Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Support git config [include] section with absolute path(s)Marco Miller2016-05-215-1/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per [1], but limited to absolute paths indeed. No support yet for tilde or $HOME expansion. Support for the --[no-]includes options ([1]) is not part of this commit scope either, but those options' defaults are in effect as described in [1]. [1] https://git-scm.com/docs/git-config Included path can be a config file that includes other path-s in turn. An exception is thrown if too many recursions (circular includes) happen because of ill-specified config files. Change-Id: I700bd7b7e1625eb7de0180f220c707d8e7b0930b Signed-off-by: Marco Miller <marco.miller@ericsson.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Added filter for merge and non-merges commits.Alcemir Santos2016-05-203-0/+136
| | | | | | | | | | | | | | | | | | | | | | | | Added the option to retrieve either merge or non-merge commits in the LogCommand. Change-Id: Ie0e1c515a823f2392783f1a47d385c31230e8167 Signed-off-by: Alcemir Santos <alcemir.santos@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | [findBugs] Prevent potential NPE in FS_POSIX.readUmask()Matthias Sohn2016-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | BufferedReader.readLine() returns null if the end of the stream has been reached. Change-Id: I83102bbfb1316407247e0f29023077af9e8d9606 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | [findBugs] Fix calculation of host header in SignerV4Matthias Sohn2016-05-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | We ignored the returned concatenation of host name and port number. Fix this and use a StringBuilder to avoid creation of unnecessary String objects. Change-Id: I61fac639d4a4c95412eb41a0f9131d0c38aca794 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>