Commit Graph

3145 Commits

Author SHA1 Message Date
Matthias Sohn d2d56e9efb JGit v3.4.0.201405211411-rc1
Change-Id: Ia3834770b9719f64cbdfd0338034c392fa3ae5db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-21 20:11:56 +02:00
Matthias Sohn 94953ac9ca Add script to create JGit release
Change-Id: I620a209406dd021f3e8e1dafcfb381631dfd25d2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-21 20:10:19 +02:00
Laurent Goujon 4cb0bd8a43 Adds support for SPNEGO
Adds support for Negotiate(SPNEGO) HTTP authentication method. This method
is set to have a higher priority as Digest HTTP authentication method.

Bug: 428836
Change-Id: Ib181096d39f538df1dd7d3f36516843777bf12ae
Signed-off-by: Laurent Goujon <lgoujon@twitter.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2014-05-21 11:00:26 -05:00
Laurent Goujon 0b5441a8ce Creates HttpAuthMethod type enum to support auth ordering
Refactors HttpAuthMethod to support more authentication methods,
still sorted by priority orders.

Bug: 428836
Change-Id: I049c1742e7afbc51f3f6033fa4d471b344813cfa
Signed-off-by: Laurent Goujon <lgoujon@twitter.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2014-05-21 10:48:35 -05:00
Laurent Goujon 0e7622a915 Detects background authentication and force use of jgit authentication
Sun HttpURLConnection is able to handle authentication like SPNEGO without
caller intervention. However, there are some restrictions:
- do not need user direct input (user,password for example)
- it doesn't work when request body is chunked/streamed (because it cannot be
replayed)

Unfortunately there is no real way to leverage HttpURLConnection authentication
work as the authentication header is stripped off the request before returning
to the caller. There's also no way to explicitly disable authentication in
HttpURLConnection (SPNEGO auth will always be attempted if a valid token can be
created by GSSAPI).

This is an issue for jgit since it is expected that the first request will be
used to detect authentication method, and reuse for the subsequent requests.

This patch modifies TransportHTTP to detect authentication done in the background
by HttpURLConnection and sets the jgit authentication method accordingly so it will
always work for future requests (assuming that the authentication method used by
HttpURLConnection is also supported by jgit).

Bug: 428836
Change-Id: I79f3b70ca2b8377e20da8e6a01914e43e96595ce
Signed-off-by: Laurent Goujon <lgoujon@twitter.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2014-05-21 10:29:57 -05:00
Laurent Goujon ff9c194b8a Adds GSSManager factory class, to be used for SPNEGO HTTP authentication
Adds a factory class for GSSManager. GSSManager is already a factory class but
it doesn't work well with SPNEGO HTTP authentication unless the
javax.security.auth.useSubjectCredsOnly system property is set to false.

On Sun JDK, Sun GSSManagerImpl can be configured directly for SPNEGO auth
(without setting any system property). For a better experience, the class
availability is detected by reflection and used instead.

Detection is only done once, and fallbacks to org.ietf.jgss.GSSManager.

Bug: 428836
Change-Id: Idb9123d1f4013966919db43043ec959d4b133ae2
Signed-off-by: Laurent Goujon <lgoujon@twitter.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2014-05-21 10:15:42 -05:00
Shawn Pearce 6d724dcd33 blame: Revert common subtree elimination "optimization"
This partially reverts 6de12836d7.

Performing a TreeWalk over 2 trees to identify and skip unmodified
subtrees to pass all blame onto an ancestor appears to be a micro
optimization that works for a very limited number of files.  In the
general case the 2 tree walk is slowing down blame more than it helps
to speed it up.

I keep coming up with files in multiple repositories where 6de128 is
making things worse, not better, and only one example where it
actually improved performance, render_view_impl.cc in chromium
as described in the commit message.

Change-Id: Ic6d5fff22acb5ab6485614a07bdb388e8c336679
2014-05-19 15:45:43 -04:00
Robin Rosenberg a5ee6fe904 Merge "Cherry-Pick: Support --mainline to pick merges" 2014-05-19 15:43:22 -04:00
Konrad Kügler b84057ad62 Cherry-Pick: Support --mainline to pick merges
By specifying a mainline parent, a merge is cherry picked as if this
parent was its only parent. If no mainline parent is given, cherry
picking merges is not allowed, as before.

Change-Id: I391cb73bf8f49e2df61428c17b40fae8c86a8b76
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
2014-05-17 19:18:07 +02:00
Robin Rosenberg 1a9f122773 Fix a number of failing conflict situations
Adds further tests where the working tree is dirty (differs from
index) and where we have staged but uncommitted changes.

Fixed the test case 9 for file/directory conflicts.

Bug: 428819
Change-Id: Ie44a288b052abe936ebb74272d0fefef3b218a7a
Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
2014-05-17 19:06:07 +02:00
Robin Rosenberg f7ac527ca7 Merge "Archive: Add the ability to select one or more paths." 2014-05-17 13:00:26 -04:00
Robin Rosenberg 19ac1f75ab Fix failing ConfigTest on Windows
Trust the detection of features and just test CoreConfig.

Change-Id: I37f838d270a221a75d0d3842ba2f3f90aa1d6f01
2014-05-17 04:09:22 -04:00
Matthias Sohn 2aa2b3af31 Merge "Command line: implement checkout -- <path>" 2014-05-16 16:50:41 -04:00
Konrad Kügler 1350d27e90 Rebase: Write an empty "quiet" file to make C Git happy
C git tries to read this file from the rebase state directory and
complains about it not being there for rebases started by JGit. An empty
'quiet' file represents the (verbose) default.

Change-Id: I1844ccbf8d35442d7a8918b57b67eb9b9efd6352
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
2014-05-16 09:01:23 +02:00
Shaul Zorea 17604c77a8 Archive: Add the ability to select one or more paths.
Previously, it was only possible to archive the entire repository.
This patch introduces the ability to select specific files and
directories to archive.
Archiving the entire repository remains the default behaviour.

org.eclipse.jgit.api.ArchiveCommand: Adding setPaths(String... paths)
method.

Change-Id: Iedcd40fbfd71238b0088174bbe2717fae196e047
Signed-off-by: Shaul Zorea <shaulzorea@gmail.com>
2014-05-14 18:42:29 +03:00
Christian Halstrick 292cfab10d Fix wrong Exception messages
In two places we threw an IOException and the message was built using
JGitText.couldNotWriteFile. We specified 2 parameters, but this pattern
expects only one parameter. In both places we tried to rename a file,
that's why we wanted two parameters (src and target) for the exception
text.

I changed it to use JGitText.renameFileFailed which accepts two
parameters and fits better.

Change-Id: Ib8c2cf78f2b26ca2b97754fe91fdb20b30392415
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-14 00:52:06 +02:00
Robin Rosenberg 392f1e70a8 Merge "LsTree: quote paths in output" 2014-05-12 17:35:45 -04:00
Matthias Sohn bbf28b1cf4 Command line: implement checkout -- <path>
Change-Id: I3d261e6541fe0fcaa210587d2aa226e153071351
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-12 17:12:48 -04:00
Tomasz Zarna b13907f086 Fix javadoc errors caused by missing tags for declared exceptions
Change-Id: I587aae0ad217ed092f061682ffa66c724f221096
Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-12 00:40:16 +02:00
Yuxuan 'fishy' Wang 0b15b48f74 Handle repo copyfile in bare repositories.
Change-Id: Ie06f0c3d1bc9b2123102efaa5542ec3c232b72cd
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
2014-05-09 17:25:50 -07:00
Yuxuan 'fishy' Wang d998bc938a Handle the revision attribute in repo manifest.
Change-Id: I77fe073aeb13c58029551b7d6e1451a9b62dc766
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
2014-05-09 17:25:41 -07:00
Dave Borowitz b4abb0d849 LsTree: quote paths in output
Change-Id: Ic78d5b41e057fcd3282e97ac73ed506666f28f88
2014-05-07 11:41:55 -07:00
Yuxuan 'fishy' Wang 056135a148 Handle repo submodules for bare repositories.
Change-Id: Id028a7bc9600baf0f3e2316a1f4b99e53ccc746a
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
2014-05-07 11:03:51 -07:00
Matthias Sohn 7f394cf162 Fix manifests of source bundles
- don't mark them as singleton to allow coexistence of multiple versions
  in the same installation
- add missing version qualifier to Eclipse-SourceBundle header

see
https://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg10524.html

Change-Id: Ie4e028038f5a1d3e18b0be06c3d2ea82e7f9068d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-07 11:32:42 +02:00
Dave Borowitz 79448bcf94 Merge changes I9ba0e70f,I1f38e055,Idb55a303
* changes:
  Do not rewrite parents in RevWalkTextBuiltins
  RevWalk: Allow disabling parent rewriting
  RevWalkTextBuiltin: Add -n to limit number of commits returned
2014-05-06 14:05:14 -04:00
Laurent Goubet 7424d58255 Allow callers to use different merging strategies
Signed-off-by: Laurent Goubet <laurent.goubet@obeo.fr>
Change-Id: I84e9d7b4b772b4ad7d3e7010aad78291d4d178fe
2014-05-06 16:30:34 +02:00
Dave Borowitz 99008648d1 Do not rewrite parents in RevWalkTextBuiltins
Default behavior of C git is to skip parent rewriting unless
particular history simplification or --parents flags are passed. Since
JGit has no such flags, JGit should not rewrite parents.

Change-Id: I9ba0e70fe6d5f49f975b71eea46f93198900f37d
2014-05-05 16:41:13 -07:00
Dave Borowitz dbf922ce91 RevWalk: Allow disabling parent rewriting
Previously, setting any TreeFilter on a RevWalk triggered parent
rewriting, which in the current StartGenerator implementation ends up
buffering the entire commit history in memory. Aside from causing poor
performance on large histories, this does not match the default
behavior of `git rev-list`, which does not rewrite parent SHAs unless
asked to via --parents/--children.

Add a new method setRewriteParents() to RevWalk to disable this
behavior. Continue rewriting parents by default to maintain backwards
compatibility.

Change-Id: I1f38e05526071c75ca58095e312663de5e6f334d
2014-05-05 16:41:08 -07:00
Dave Borowitz 614a477b07 RevWalkTextBuiltin: Add -n to limit number of commits returned
Implementing the -<#> flag from C git is less trivial.

Change-Id: Idb55a303304a6d4055aaf37d0b4dcf92c684e25f
2014-05-05 15:58:33 -07:00
Matthias Sohn 3a47e45c32 Prepare 3.4.0-SNAPSHOT builds
Change-Id: I5cf20c875c3e92e12c2b22465774ba42513b9add
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-06 00:04:09 +02:00
Matthias Sohn f6c42684d9 JGit v3.4.0.201405051725-m7
Change-Id: I8d941d22becdf019199a1c0fe28aa5835038647d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-05 23:33:03 +02:00
Robin Rosenberg f9c0783e7d Merge "Make the resolve merger slightly more sub-classable." 2014-05-05 15:09:03 -04:00
Shawn Pearce 561121e111 Merge "blame: Fix merges, where merge result differs only by whitespace" 2014-05-04 14:37:14 -04:00
Matthias Sohn 6cc9bb79c8 Update 4.4 target to use Luna M7 orbit repository
Change-Id: I9a19d5584deef970cc00a7b58beae84d55b20ddf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-04 01:51:38 +02:00
Konrad Kügler d5ee5ede3e AbstractPlotRenderer: Make private methods static where applicable
Change-Id: Iaf02502b02b2420c059f04bbe09254941301c727
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
2014-05-03 23:08:10 +02:00
Konrad Kügler e5f7fdcf4f PlotLane: Use identity hashCode and equals
Using the lane position and other data for equals/hashCode is not
useful.

Change-Id: I7af151d8a84544a77a486474c8ac71dd80090c66
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
2014-05-03 23:08:09 +02:00
Konrad Kügler c2fb432cde blame: Fix merges, where merge result differs only by whitespace
When blaming a merge commit with "Ignore whitespace changes" enabled,
don't discard blame candidates for other parents when we encounter a
parent that only has whitespace changes compared to the merge result.

The algorithm early prepares parents for blaming, removing the
appropriate blame regions from the list of regions still to blame. Only
at the end, the prepared blame candidates are submitted for blaming.

When looking at a non-first parent which only differs in whitespace to
the merge result, it submitted that parent, but only to blame it for the
(usually few) lines not already prepared to blame on other parents. Due
to an early return the blame candidates for the previous parents were
forgotten, leaving many lines unannotated.

bug: 433024
Change-Id: I43c9caf2078b92b05e652dbed2192568907bf199
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
2014-05-03 15:17:08 +02:00
Jean-Jacques Lafay 8b65a4e6c6 Fix push to repo with non-fetched refs
When JGit uses bitmaps (which is the case after a gc), the push command
doesn't go through the code where MissingObjectExceptions are caught
for remote objects not found locally.

Fixed by removing earlier non-locally-found remote objects.

This was seen withing gerrit, see:
https://code.google.com/p/gerrit/issues/detail?id=2025

Bug: 426044
Change-Id: Ieda718a0530e3680036edfa0963ab88fdd1362c0
Signed-off-by: Jean-Jacques Lafay <jeanjacques.lafay@gmail.com>
Signed-off-by: Doug Kelly <dougk.ff7@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-04-30 17:43:44 -04:00
Robin Rosenberg 3ea72de46b Make org.eclipse.jgit.packaging a general project
This makes it easy to edit the pom.xml from within Eclipse.

Change-Id: I4718217caadbfe892b7cbb557e0d3d6b40d48321
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-04-28 09:06:58 +02:00
Matthias Sohn 8e4018390e Merge changes I2515a6ed,Ib6b24035
* changes:
  Fix ArrayIndexOutOfBoundsException in CreateBranchCommand
  Add methods to Repository to handle remote names
2014-04-27 09:34:02 -04:00
Robin Rosenberg 36f58ef867 Fix ArrayIndexOutOfBoundsException in CreateBranchCommand
If remote name contains / or there was a branch directly under the
refs/remotes namespace (wrong) the computation of remote name and
suggested local branch name would fail. Fix this by looking at the
configured remotes. A ref under refs/remotes that does not match a
remote configuration is not considered a remote tracking branch anymore.

This patch does not fix all similar errors in EGit/JGit.

Bug: 411002
Bug: 400414
Change-Id: I2515a6ed05f9104c387ce4e43b24dae942ae2473
2014-04-27 10:38:33 +02:00
Robin Rosenberg 6605255d99 Add methods to Repository to handle remote names
Instead of requiring the caller to know how to list remote
names or parse remote branch names, add a few utilities for
that.

Change-Id: Ib6b2403532f4abbce594a03c0b9da49d30b19f70
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2014-04-27 10:35:21 +02:00
Konrad Kügler ca207b938d Fix BlameResult.computeRange JavaDoc to exclude end index
Change-Id: Ifd7dd86e3848eb7a522ba5c49d5c216777484f3b
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
2014-04-26 14:31:47 +02:00
Bogdan Gheorghe 8923e67a16 Add API to permit the setting of additional HTTP headers
Signed-off-by: Bogdan Gheorghe <gheorghe@ca.ibm.com>
Change-Id: I1047f318bb5c63850f45ba85d73c97fe8bf70a6c
2014-04-25 19:01:58 -04:00
Robin Rosenberg cd1f3ecb92 cleanup: remove some unused imports
Change-Id: I549b934b86753acc362364c8986bfe6457affd12
2014-04-25 19:00:01 -04:00
Robin Rosenberg eac7175cce Making ArchiveFormats breaks the API, but that's ok
Add compatibility filters to hide the breakage.

Change-Id: Icc1fdc29f15d734d488e49c9c37a18f5ac937903
2014-04-25 18:59:20 -04:00
Matthias Sohn 2d579ff789 Add jacoco instrumentation for code coverage reports
See http://mickaelistria.wordpress.com/2012/10/08/sonar-at-eclipse-org/

Change-Id: Idd7df8125e0792e9bba924eadbc1320230cfa624
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-04-26 00:58:09 +02:00
Shawn Pearce d8754aa4f4 Merge changes Ia4df9808,I83e8a321,Id0e7663b,Ib809b00c,I88a6ee07
* changes:
  Commit changes generated during repo command
  Added implementation of copyfile rule.
  Added groups support to repo subcommand.
  Added the command line of jgit repo.
  Implemented first part of the repo sub-command.
2014-04-25 14:01:06 -04:00
Yuxuan 'fishy' Wang dc4c673902 Commit changes generated during repo command
Change-Id: Ia4df9808294d2069dcc5973bcb69b4499c7dcacd
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
2014-04-25 13:42:35 -04:00
Shawn Pearce 06af8f5cc2 Merge "Automatically reload known_hosts file" 2014-04-25 12:34:37 -04:00