summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Let ObjectWalk.markUninteresting also mark the root tree as"David Ostrovsky2015-04-262-28/+1
| | | | | | | | | | | | The Iff2de881 tried to fix missing tree ..." but introduced severe performance degradation (>10x in some cases) when acting as server (git push) and as client (replication). IOW cure is worse than the disease. This reverts commit c4797fe98655b3d52d0a90ba44fce6e053db3b8b. Change-Id: I4e6056eb352d51277867f857a0cab380eca153ac Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* JGit v3.7.0.201502260915-rv3.7.0.201502260915-rMatthias Sohn2015-02-2655-59/+59
| | | | | Change-Id: Iec17746cad81cfb1d775e782b30f9d8a13c938b6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Read user.name and email from environment first" into stable-3.7Christian Halstrick2015-02-252-8/+26
|\
| * Read user.name and email from environment firstMatthias Sohn2015-02-242-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to [1] user name and email are taken first from the environment variables: GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL In case (some of) these environment variables are not set, the information is taken from the git configuration. JGit doesn not yet support the environment variables GIT_AUTHOR_DATE and GIT_COMMITTER_DATE. [1] https://www.kernel.org/pub/software/scm/git/docs/git-commit-tree.html#_commit_information Bug: 460586 Change-Id: I3ba582b4ae13674cf319652b5b13ebcbb96dd8ec Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Provide more details in exceptions thrown when packfile is invalidMatthias Sohn2015-02-178-14/+25
|/ | | | | | | | | Mention packfile path in exceptions thrown when we detect that a packfile is invalid and make excplicit that corrupt packs are removed from the pack list. Change-Id: I454ada5f8e69307d3f34d1c1b8f3cb87607ddf35 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add log4j and slf4j-log4j bridge to jgit featureMatthias Sohn2015-02-177-3/+42
| | | | | | | CQ: 9207 CQ: 9241 Change-Id: Ic06a06da0a74f8fa494c0753cbe9ed2356c21ab3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use slf4j to log instead of printing to System.errMatthias Sohn2015-02-1711-30/+62
| | | | | | | CQ: 9206 Bug: 458445 Change-Id: Ic68fb7dbe0fb46bf30f157db45bf18d8f3a704c0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use Target Platform Definition DSL to generate target platformsMatthias Sohn2015-02-179-58/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | The "Target Platform Definition DSL and Generator" [1] heavily simplifies maintenance of target platforms. It allows to modularize target platform definitions which eliminates code duplication. The .target files understood by P2 and Tycho are generated from .tpd files which are written in the target platform definition DSL. In order to edit .tpd files and generate .target files install the "Target Platform Definition DSL and Generator" 2.0 or later [2] (Note: on Kepler you also need to add [3] to get Xtext 2.5 which is not available by default on Kepler). This tools is needed only if you need to change the Target Platform definition files (*.targetplatform and *.tpd) and re-generate the *.target files. In normal development you do not need this and can simply use the generated *.target themselves. In addition - update Orbit repository for 4.5 to Mars M5 - use latest released Orbit p2 repository for platform version Luna and earlier [1] https://github.com/mbarbero/fr.obeo.releng.targetplatform [2] http://mbarbero.github.io/fr.obeo.releng.targetplatform/p2/latest/ [3] http://download.eclipse.org/modeling/tmf/xtext/updates/releases/ Change-Id: Ia701972785c3e88aba66a7f15a2b3cf638727eea Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add option --orphan for checkoutRüdiger Herrmann2015-02-043-3/+19
| | | | | Change-Id: I546a93f3e147d8d6fc70094b22679c0d11cd8921 Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
* Prepare post 3.7.0.201502031740-rc1 buildsMatthias Sohn2015-02-0455-59/+59
| | | | Change-Id: Id3728e771a4441757de016cc9d68055f668126b0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v3.7.0.201502031740-rc1v3.7.0.201502031740-rc1Matthias Sohn2015-02-0355-59/+59
| | | | | Change-Id: Ia2ea65945b7e1d4120da3d6e6c9f6d5fdb642ae6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Support for the pre-commit hookLaurent Goubet2015-02-028-8/+169
| | | | | | | | | Introduce support for the pre-commit hook into JGit, along with the --no-verify commit command option to bypass it when rebasing / cherry-picking. Change-Id: If86df98577fa56c5c03d783579c895a38bee9d18 Signed-off-by: Laurent Goubet <laurent.goubet@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix FileUtils.testRelativize_mixedCase which failed on Mac OS XMatthias Sohn2015-02-021-19/+8
| | | | | | | HFS is case insensitive hence expecting it to return the result for case sensitive filesystem doesn't work. Change-Id: I292eab78e50711529a0412f9a54e174a3ac16109 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add a hook testMatthias Sohn2015-02-021-0/+106
| | | | Change-Id: I8059ef299aeb43373f4f45274030886171a20a8e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Introduce hook support into the FS implementationsLaurent Goubet2015-02-0212-0/+829
| | | | | | | | | | | This introduces the background plumbing necessary to run git hooks from JGit. This implementation will be OS-dependent as it aims to be compatible with existing hooks, mostly written in Shell. It is compatible with unix systems and windows as long as an Unix emulator such as Cygwin is in its PATH. Change-Id: I1f82a5205138fd8032614dd5b52aef14e02238ed Signed-off-by: Laurent Goubet <laurent.goubet@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* If a pack isn't found on disk remove it from pack listMatthias Sohn2015-01-273-0/+5
| | | | | | | | | If accessing a pack throws FileNotFoundException the pack was deleted and we need to remove it from the pack list. This can be caused e.g. by git gc. Change-Id: I5d10f87f364dadbbdbfb61b6b2cbdee9c7457f3d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Fix integer overflow in DiffFormatter when context is set to large int"Shawn Pearce2015-01-271-4/+4
|\
| * Fix integer overflow in DiffFormatter when context is set to large intIlmars Poikans2014-12-011-4/+4
| | | | | | | | | | | | | | | | | | | | In original code, if you call the DiffFormatter's setContext() method with Integer.MAX_VALUE (to get full-context diffs) the format() method will get into an infinite loop. Bug: 382680 Change-Id: I804e82cde9b84b8ff232a20fb5cbde04478315e7 Signed-off-by: Ilmars Poikans <ilmars@delibero.lv>
* | Merge "Make jgit.sh work on windows when JGIT_CLASSPATH is set"Shawn Pearce2015-01-271-2/+6
|\ \
| * | Make jgit.sh work on windows when JGIT_CLASSPATH is setChristian Halstrick2014-12-011-2/+6
| |/ | | | | | | | | | | | | | | | | | | | | jgit.sh was concatenating classpath entries with ":". On Windows systems using "Git for Windows" this caused problems when JGIT_CLASSPATH was set. Find out whether we are running on a platform which name starts with "MINGW" ("Git for Windows" sets this) and use ";" as classpath separator in this case. Change-Id: I7e8fc2bee6513f587612accfc456a83d6277ef4a
* | Merge "Handle invalid tree extensions"Shawn Pearce2015-01-271-1/+1
|\ \
| * | Handle invalid tree extensionsChristian Halstrick2015-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case the index contains wrong tree extensions don't throw a ArrayIndexOutOfBounds exception but revalidate the tree extension. It happened that the git index written by Git for Windows contained valid (means entryCount>0) tree extensions for pathes which are not existing in the index. Native git handles this inconsistency silently but JGit was crashing with a ArrayIndexOutOfBounds exception. Teach JGit to better recognize such cases and revalidate such extensions. It's hard to write a test because JGit doesn't write such extensions. It only reads, validates and makes use of them. But the bug tells how to create such situations. Bug: 457152 Change-Id: Id3ffd7dc7ae1c55674d88bf1b43953234fe0b68d
* | | InMemoryRepository: Ensure new ref targets exist in the repoDave Borowitz2015-01-261-0/+13
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ObjectInserter recently learned to read back inserted objects before they have been flushed. It is in general unsafe to create refs to such objects, but it is now much more possible to do so, by passing "new RevWalk(inserter.newReader())" into RefUpdate#execute(RevWalk). We can't change the RefUpdate interface to remove execute(RevWalk); nor would we necessarily want to, for performance reasons. And in any case, RefUpdate#safeParse explicitly ignores MissingObjectExceptions. But we can enforce object existence in InMemoryRepository, which will allow callers using this class in their tests to ensure they are using the RefDatabase correctly. Change-Id: I5c696ba23bcd2a536a0512fa7f5b6130961905c5
* | Merge "Ensure GitCommand's "callable" guard is thread-safe"Christian Halstrick2015-01-231-3/+4
|\ \
| * | Ensure GitCommand's "callable" guard is thread-safeMatthias Sohn2015-01-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | This way we can ensure that the same command instance can't be used concurrently in multiple threads. Bug: 458023 Change-Id: I4884a1ef2f609f9fb24dda4bd5819dffb9f174b6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge changes I05be0a5b,Ieee334f4Christian Halstrick2015-01-232-0/+17
|\ \ \ | | | | | | | | | | | | | | | | | | | | * changes: Document that repo returned by SubmoduleAddCommand needs to be closed Document that Git instance returned by CloneCommand needs to be closed
| * | | Document that repo returned by SubmoduleAddCommand needs to be closedMatthias Sohn2015-01-221-0/+11
| | | | | | | | | | | | | | | | | | | | Bug: 448570 Change-Id: I05be0a5b07f8e22f55637b9a3080362978368bcb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | Document that Git instance returned by CloneCommand needs to be closedMatthias Sohn2015-01-221-0/+6
| |/ / | | | | | | | | | | | | Bug: 448570 Change-Id: Ieee334f4d82cd71ba98b26abb8667e8f64cac665 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* / / Silence non-externalized string warnings in RepoCommandMatthias Sohn2015-01-221-4/+4
|/ / | | | | | | Change-Id: Ia25543c0d80817f8eb35c667ba5dcce046131a7c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge remote-tracking branch 'origin/stable-3.6'Matthias Sohn2015-01-213-10/+34
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/stable-3.6: Prepare 3.6.3-SNAPSHOT builds JGit v3.6.2.201501210735-r Don't remove pack from pack list for problems which could be transient Log reason for ignoring pack when IOException occurred Change-Id: I61141b52839511d58e5a5b193bfde31e9f444a6c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare 3.6.3-SNAPSHOT buildsstable-3.6Matthias Sohn2015-01-2155-266/+266
| | | | | | | | | | | | | | | Change-Id: Ie753dc77a23558d1993e959f48b7eb06557ea686 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.6.2.201501210735-rv3.6.2.201501210735-rMatthias Sohn2015-01-2155-59/+59
| | | | | | | | | | | | | | | Change-Id: I483fc7bbff1561721cf621dc67ce4a193624fa64 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Don't remove pack from pack list for problems which could be transientMatthias Sohn2015-01-213-15/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we hit a corrupt object or invalid pack remove the pack from the pack list. Other IOException could be transient hence we should not remove the pack from the list to avoid the problem reported on the Gerrit list [1]. It looks like in the reported case the pack was removed from the pack list causing MissingObjectExceptions which disappear when the server is restarted. [1] https://groups.google.com/forum/#!topic/repo-discuss/Qdmbl-YZ4NU Change-Id: I331626110d54b190e46cddc2c40f29ddeb9613cd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Log reason for ignoring pack when IOException occurredMatthias Sohn2015-01-153-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should help to identify the root cause of the problem discussed on the Gerrit list [1]. [1] https://groups.google.com/forum/#!topic/repo-discuss/Qdmbl-YZ4NU Change-Id: I871f70e4bb1227952e1544b789013583b14e2b96 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Fix RawText.getLineDelimiter() for empty first lineFrank Wagner2015-01-172-1/+8
| | | | | | | | | | | | | | | | | | Bug: 456776 Change-Id: Iae50be89ea6d5aee33bd938a937ac5ca578aabca Signed-off-by: Frank Wagner <frank.wagner@fr.ibm.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Silence API warning raised since 7fafd372Matthias Sohn2015-01-131-0/+9
| | | | | | | | | | | | | | | | | | | | | This new git capability isn't yet in the wild in the git-core camp. Hence we can silence this API warning. Change-Id: I9e030959f658c58344b04ef2f9edd28060f0c964 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | [pgm] Prevent commands from writing progress to System.errRüdiger Herrmann2015-01-136-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commands which report progress used to write to System.err. This is not desirable in cases where jgit.pgm is embedded. This change redirects progress output to the error stream that is configured by the command. Change-Id: I01fa5e167437e619448ac201fcb1cbf63bad96d7 Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Update atomic constantStefan Beller2015-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The atomic feature is now cooking in -next in git-core. Very rarely features are ejected from the the next branch in git-core, so I consider it reasonable to come up with this patch now to make the 2 implementations interoperable. Change-Id: I806a8ae3c045ca5936f69cb903baf9b99ee39181 Signed-off-by: Stefan Beller <sbeller@google.com>
* | | Merge "[pgm] Add missing help text for clone --bare option"Christian Halstrick2015-01-121-0/+1
|\ \ \
| * | | [pgm] Add missing help text for clone --bare optionMatthias Sohn2015-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | Bug: 456695 Change-Id: Ib6005e8453ecc871a9b72227e2593a3823f56010 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Add basic support for .gitattributesArthur Daussy2015-01-0718-23/+2090
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Core classes to parse and process .gitattributes files including support for reading attributes in WorkingTreeIterator and the dirCacheIterator. The implementation follows the git ignore implementation. It supports lazy reading attributes while walking the working tree. Bug: 342372 CQ: 9078 Change-Id: I05f3ce1861fbf9896b1bcb7816ba78af35f3ad3d Also-by: Marc Strapetz <marc.strapetz@syntevo.com> Also-by: Gunnar Wagenknecht <gunnar@wagenknecht.org> Also-by: Arthur Daussy <arthur.daussy@obeo.fr> Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org> Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com> Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | | AIOOB in ChangeIdUtil.indexOfChangeId if amended message is a newlineAndrey Loskutov2015-01-062-0/+6
| | | | | | | | | | | | | | | Bug: 456792 Change-Id: Idf38a0db7dc72d672ff185dcac2f41f0012a6673 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* | | Merge branch 'stable-3.6'Matthias Sohn2015-01-046-57/+203
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.6: Prepare 3.6.2-SNAPSHOT builds JGit v3.6.1.201501031845-r Trim author/committer name and email in commit header Rename detection should canonicalize line endings PathMatcher should respect "assumeDirectory" flag Change-Id: Idd48c6d94cf1ab09abc07f70d50890b1b78e1833 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare 3.6.2-SNAPSHOT buildsMatthias Sohn2015-01-0455-266/+266
| | | | | | | | | | | | | | | Change-Id: I9699d84af2d4b5382d8ee88ed3517d6b91305421 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.6.1.201501031845-rv3.6.1.201501031845-rMatthias Sohn2015-01-0455-59/+59
| | | | | | | | | | | | | | | Change-Id: I56e235a271f90ea2d8cdb7d99706f726d4a59c43 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Trim author/committer name and email in commit headerRüdiger Herrmann2015-01-032-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C Git trims name and email before inserting them into the commit header so that " A U Thor " and " author@example.com " becomes "A U Thor <author@example.com>" with a single separating space. This changes PersonIdent#toExternalString() to trim name and email before concatenating them. Change-Id: Idd77b659d0db957626824f6632e2da38d7731625 Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
| * | Rename detection should canonicalize line endingsMarc Strapetz2015-01-022-40/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Native Git canonicalizes line endings when detecting renames, more specifically it replaces CRLF by LF. See: hash_chars in diffcore-delta.c Bug: 449545 Change-Id: Iec2aab12ae9e67074cccb7fbd4d9defe176a0130 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | PathMatcher should respect "assumeDirectory" flagAndrey Loskutov2014-12-282-15/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The path matcher should not fail if the rule ends with trailing slash, target pattern does not ends with the slash and the "assumeDirectory" flag is set. E.g. */bin/ should also match a/bin if this pattern is threated as directory by WorkingTreeIterator (FileMode.TREE). The old code/tests have never tested directory rules with patterns *without* trailing slashes but with the "assumeDirectory" flag set. Unfortunately this is exactly what WorkingTreeIterator does... The tests are changed to test *both* cases now (with trailing slash and without) if the target pattern has trailing slash (represents directory). Bug: 454672 Change-Id: I621c1644d9e94df3eb9f6f09c6de0fe51f0950a4 Also-by: Markus Duft <markus.duft@salomon.at> Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* | | Add .mailmap to correct Shawn and Saša's log entriesShawn Pearce2015-01-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both myself and Saša Živkov have been using different names and email addresses in the JGit history. Configure .mailmap to map to consistent entries for us. Saša Živkov's entries were taken from the Gerrit Code Review .mailmap file. Change-Id: I3fad123c453c3a1e2972ae0616757fd34b003165
* | | Compare API changes against 3.6.0Matthias Sohn2014-12-281-1/+1
| | | | | | | | | | | | | | | Change-Id: I70d2e3f37d02a688436999844884510c2eb5cbda Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>