]> source.dussan.org Git - jgit.git/log
jgit.git
10 years agoAdd isRebase to API of BranchConfig 24/30924/1
Robin Stocker [Sun, 3 Aug 2014 08:32:43 +0000 (18:32 +1000)]
Add isRebase to API of BranchConfig

Change-Id: I9819f49410e30d32c2157db0556a0dd6a0bcc5a4
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoEnhance BranchConfig API to expose branch.* options 15/30915/2
Robin Stocker [Sat, 2 Aug 2014 09:20:51 +0000 (19:20 +1000)]
Enhance BranchConfig API to expose branch.* options

With these, more code can use BranchConfig instead of directly accessing
the raw configuration values.

Change-Id: I4b52f97ff0e3fc8f097512806f043c615a3d2594
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdd IndexDiff tests for merge conflict state BOTH_ADDED 85/30585/5
Laurent Goubet [Mon, 28 Jul 2014 12:27:05 +0000 (14:27 +0200)]
Add IndexDiff tests for merge conflict state BOTH_ADDED

JGit handled this case improperly which these tests demonstrate. Fixed
by I25915880f304090fe90584c79bddf021231227a2.

Bug: 440537
Change-Id: Ia29c1d6cf8c0ce724cc3ff5ed9e0b396949b44bf
Signed-off-by: Laurent Goubet <laurent.goubet@obeo.fr>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoIndexDiffFilter should never filter entries with stage!=0 58/30858/2
Christian Halstrick [Fri, 1 Aug 2014 09:28:01 +0000 (11:28 +0200)]
IndexDiffFilter should never filter entries with stage!=0

If the IndexDiffFilter is asked whether it should include or filter out
a certain path and for that path there is a dircache entry with a stage
different from 0, then the filter should never filter out this entry.
IndexDiffFilter is an optimized version of AnyDiffFilter and there is no
case where the index contains non-0 stages but we still don't see any
diff for that path.

Change-Id: I25915880f304090fe90584c79bddf021231227a2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "HistogramDiff: Convert stack recursion to heap managed queue"
Robin Rosenberg [Sat, 2 Aug 2014 09:35:18 +0000 (05:35 -0400)]
Merge "HistogramDiff: Convert stack recursion to heap managed queue"

10 years agoFix Javadoc errors with Java 8 49/30549/2
Robin Stocker [Sun, 27 Jul 2014 05:13:36 +0000 (15:13 +1000)]
Fix Javadoc errors with Java 8

Bug: 440414
Change-Id: Icce87bd23a3698513b76246677f1d45ddbcaab47
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix API errors raised on ResolveMerger affecting API providers only 67/30767/2
Christian Halstrick [Wed, 30 Jul 2014 15:01:56 +0000 (17:01 +0200)]
Fix API errors raised on ResolveMerger affecting API providers only

In change If45bc3d078b3d3de87b758e71d7379059d709603 a new parameter was
added to 3 protected methods of ResolveMerger. This breaks the code of
developers which have subclassed ResolveMerger. The API baseline check
in Eclipse reports this as API breakage.

Since this will break only providers but not consumers of the API this
should be allowed also in minor versions. According to OSGi semantic
versioning
http://www.osgi.org/wiki/uploads/Links/SemanticVersioning.pdf
breaking providers in a minor version update is ok.

Therefore silence these errors using API filter rules.

Bug: 440757
Change-Id: Icabbd0e1de7e877c66a5c4a2c8391473f992a1aa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoImplement RepoCommand.Project.hashCode() since we override equals() 66/30766/2
Matthias Sohn [Wed, 30 Jul 2014 21:10:13 +0000 (23:10 +0200)]
Implement RepoCommand.Project.hashCode() since we override equals()

Bug: 440757
Change-Id: I16614c75b62b2fbef05419dd8667e3c50889abe4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRemove @Override annotation illegal for interfaces on Java 5 65/30765/2
Matthias Sohn [Wed, 30 Jul 2014 21:07:13 +0000 (23:07 +0200)]
Remove @Override annotation illegal for interfaces on Java 5

Bug: 440757
Change-Id: I11897e8e680722313f28d9d241e23e92eddeb966
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMark package org.eclipse.jgit.gitrepo.internal as x-internal 64/30764/2
Matthias Sohn [Wed, 30 Jul 2014 21:05:33 +0000 (23:05 +0200)]
Mark package org.eclipse.jgit.gitrepo.internal as x-internal

It's an internal package which isn't part of the API. Mark it x-internal
to silence @since tag warnings which are only raised for new API.

Bug: 440757
Change-Id: Id05deaca43f135cd1bfe83cf1f29787cbbdbecac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoSmall performance optimization for ignore rules/fnmatcher 27/30727/2
Andrey Loskutov [Wed, 30 Jul 2014 08:42:30 +0000 (10:42 +0200)]
Small performance optimization for ignore rules/fnmatcher

 - don't check empty segments generated by String.split()
 - don't continue to add segments if the matcher fails to match input
 - don't add empty heads
 - don't iterate over empty heads.

Bug: 440732
Change-Id: I7d04dccfe24d91275d17ba246662337d6dba66df
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdded toString() methods for better debugging of ignore rules 26/30726/2
Andrey Loskutov [Wed, 30 Jul 2014 08:38:53 +0000 (10:38 +0200)]
Added toString() methods for better debugging of ignore rules

Change-Id: Ie31687faa2df47ecaacace2504c3b4e93f1ea809
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix RevertCommand to correctly revert multiple commits at once. 26/30026/3
Maik Schreiber [Thu, 19 Jun 2014 10:54:14 +0000 (12:54 +0200)]
Fix RevertCommand to correctly revert multiple commits at once.

The fix is to move the new head commit to the newly-created revert
commit, so that additional revert commits will use the correct head.

Change-Id: I5de3a9a2a4c276e60af732e9c507cbbdfd1a4652
Signed-off-by: Maik Schreiber <blizzy@blizzy.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Remove overlapping submodules from repo manifest."
Shawn Pearce [Tue, 29 Jul 2014 23:28:11 +0000 (19:28 -0400)]
Merge "Remove overlapping submodules from repo manifest."

10 years agoRemove overlapping submodules from repo manifest. 99/30699/2
Yuxuan 'fishy' Wang [Tue, 29 Jul 2014 22:43:04 +0000 (15:43 -0700)]
Remove overlapping submodules from repo manifest.

Apparently repo allows projects overlapping, e.g. one project's path is "foo"
and another project's path is "foo/bar". This is not supported in git submodule.
At JGit repo side we'll skip all the submodules that are in subdirectories of
other submodules, and on repo side we'll make them submodules to resolve this
problem.

Change-Id: I6820c4ef400c530a36150b1228706adfcc43ef64
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "Added the missing export in MANIFEST.MF."
Shawn Pearce [Tue, 29 Jul 2014 23:01:13 +0000 (19:01 -0400)]
Merge "Added the missing export in MANIFEST.MF."

10 years agoMerge "RecursiveMerger should not fail on content-merge conflicts of parents"
Christian Halstrick [Tue, 29 Jul 2014 07:46:52 +0000 (03:46 -0400)]
Merge "RecursiveMerger should not fail on content-merge conflicts of parents"

10 years agoStrip trailing /s in repo base URI. 16/28216/7
Yuxuan 'fishy' Wang [Mon, 9 Jun 2014 18:27:52 +0000 (11:27 -0700)]
Strip trailing /s in repo base URI.

Change-Id: I71040db2cca69638cfad89acdc9179ee80592b27
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoRecursiveMerger should not fail on content-merge conflicts of parents 62/30562/2
Christian Halstrick [Fri, 25 Jul 2014 06:41:38 +0000 (08:41 +0200)]
RecursiveMerger should not fail on content-merge conflicts of parents

Previously when RecursiveMerger was trying to create a single virtual
common base for the merge it was failing when this lead to content-merge
conflicts. This is different from what native git is doing. When native
git's recursive merge algorithm creates a new common base it will merge
the multiple parents and simply take the merge result (potentially
including conflict markers) as common base. See my discussion with Shawn
here: http://www.spinics.net/lists/git/msg234959.html :

  > - How should workingtree, index (stage1,2,3) look like if during
that
  > merge of common ancestors a conflict occurs? Will I see in stage2
and
  > stage3 really see content of X1 and X2?

  Its done entirely in memory and never touches the working tree or
  index. When a conflict exists in the X1-X2 merge the conflict is
  preserved into the new virtual base.

There is still the possibility that the merge of parents lead to
conflicts. File/Folder conclicts, conflicts on filemodes. This commit
only fixes the situation for conflicts when merging content.

Bug: 438203
Change-Id: If45bc3d078b3d3de87b758e71d7379059d709603

10 years agoFixed message for exception thrown during recursive merge 61/30561/2
Christian Halstrick [Thu, 26 Jun 2014 11:42:21 +0000 (13:42 +0200)]
Fixed message for exception thrown during recursive merge

During recursive merge jgit potentially has to merge multiple
common ancestors. If this fails because there are conflicts then
the exception thrown for that should have a message which states
this clearly. Previously a wrong message was given ("More than 200
merge bases ...")

Change-Id: Ia3c058d5575decdefd50390ed83b63668d31c1d1

10 years agoHistogramDiff: Convert stack recursion to heap managed queue 26/30526/4
Shawn Pearce [Fri, 25 Jul 2014 15:17:27 +0000 (08:17 -0700)]
HistogramDiff: Convert stack recursion to heap managed queue

Each time the longest common substring is found the diff algorithm
recurses to reprocess the regions before and after the common string.

Large files with many edits can trigger StackOverflowError as the
algorithm attempts to process a deeply split tree of regions. This
is especially prone to happen in servers where the Java stack size
may have been limited to 1M or even 256K.

To keep edits produced in order a queue is used to process edits
in a depth-first strategy.

Change-Id: Iae7260c6934efdffac7c7bee4d3633a8208924f7

10 years agoFix RecursiveMerger's internal use of merge to find a merge base 28/30128/5
Christian Halstrick [Fri, 18 Jul 2014 09:04:33 +0000 (11:04 +0200)]
Fix RecursiveMerger's internal use of merge to find a merge base

When RecursiveMerger tried to determine a common base tree it was
recursively tried to merge multiple common bases. But these intermediate
merges which have just been done to determine a single common base for
the final merge already filled some important fields (toBeCheckedOut,
toBeDeleted, ...). These side effects of the intermediate merges led to
wrong results of the final merge. One symptom was that after a recursive
merge which should be succesful you could still see leftover files in
the worktree: files which existed in the (virtual) common base but which
don't exist anymore in the branches to be merged.

The solution is easy: Clear the appropriate fields after common base
determination and start the final merge with a clean state.

Change-Id: I644ea9e1cb15360f7901bc0483cdb9286308c226
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
10 years agoHandle initial checkout correctly 26/30326/3
Christian Halstrick [Wed, 23 Jul 2014 13:30:06 +0000 (15:30 +0200)]
Handle initial checkout correctly

As described in native gits file "git-read-tree.txt" git has in a
special mode when doing the "initial" checkout. "Initial" means that the
index is empty before the checkout. This was not handled correctly in
JGit and is fixed in this commit. Also see
https://github.com/git/git/blob/master/Documentation/git-read-tree.txt#L181

Change-Id: I9b9d1bd9ebf349cfca420c891c7b099a18d07ba4

10 years agoAdded the missing export in MANIFEST.MF. 38/30438/1
Yuxuan 'fishy' Wang [Thu, 24 Jul 2014 15:17:10 +0000 (08:17 -0700)]
Added the missing export in MANIFEST.MF.

This fixes bug 440352.

Change-Id: I4b1c63087a97b7b2f3d7bdb5e066424a84ef6cef
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoUpdate SUBMITTING_PATCHES 56/30156/3
Robin Stocker [Sat, 19 Jul 2014 04:59:12 +0000 (14:59 +1000)]
Update SUBMITTING_PATCHES

It contained outdated information about attaching patches to bug
reports. Shorten it to the essentials.

Also format it using markdown and rename it to CONTRIBUTING.md, which is
a convention and doesn't include "patches" in the name.

Change-Id: I9ee73f16e6fa8fbf529ac0ca791e2375d4d56d68
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoDon't prefix output from jgit status with '# ' 59/30159/2
Robin Rosenberg [Sat, 19 Jul 2014 11:27:00 +0000 (13:27 +0200)]
Don't prefix output from jgit status with '# '

C Git does not do it anymore

Bug: 439937
Change-Id: I20bdb787a00bba3e4adf269fd64ec6296bdc2a66

10 years agoPreserve merges during pull if configured to do so 71/29771/5
Konrad Kügler [Fri, 23 May 2014 21:09:17 +0000 (23:09 +0200)]
Preserve merges during pull if configured to do so

Setting branch.<name>.rebase or pull.rebase to 'preserve' will preserve
merges during rebase. Also, pull.rebase is now consulted if there is no
branch-specific configuration.

Bug: 429664
Change-Id: I345fa295c7e774e0d0a8e6aba30fbfc3552e0084
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoRebase: Add --preserve-merges support 70/29770/3
Konrad Kügler [Mon, 19 May 2014 19:47:27 +0000 (21:47 +0200)]
Rebase: Add --preserve-merges support

With --preserve-merges C Git re-does merges using the rewritten merge
parents, discarding the old merge commit. For the common use-case of
pull with rebase this is unfortunate, as it loses the merge conflict
resolution (and other fixes in the merge), which may have taken quite
some time to get right in the first place.

To overcome this we use a two-fold approach:
If any of the (non-first) merge parents of a merge were rewritten, we
also redo the merge, to include the (potential) new changes in those
commits.
If only the first parent was rewritten, i.e. we are merging a branch
that is otherwise unaffected by the rebase, we instead cherry-pick the
merge commit at hand. This is done with the --mainline 1 and --no-commit
options to apply the changes introduced by the merge. Then we set up an
appropriate MERGE_HEAD and commit the result, thus effectively forging a
merge.

Apart from the approach taken to rebase merge commits, this
implementation closely follows C Git. As a result, both Git
implementations can continue rebases of each other.

Preserving merges works for both interactive and non-interactive rebase,
but as in C Git it is easy do get undesired outcomes with interactive
rebase.

CommitCommand supports committing merges during rebase now.

Bug: 439421
Change-Id: I4cf69b9d4ec6109d130ab8e3f42fcbdac25a13b2
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoRepository.writeMergeHeads to accept a list with subtypes of ObjectId 69/29769/2
Konrad Kügler [Fri, 16 May 2014 16:33:12 +0000 (18:33 +0200)]
Repository.writeMergeHeads to accept a list with subtypes of ObjectId

Allows to pass for example a List<RevCommit>.

Change-Id: I5522707060d7d3e0d848ba579956dc62f8fa0234
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoCherry-Pick: Support --no-commit 21/27621/5
Konrad Kügler [Mon, 19 May 2014 19:46:09 +0000 (21:46 +0200)]
Cherry-Pick: Support --no-commit

Change-Id: Ic4c313a8971a5aa15745518c49e2587a1a0fe8d4
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoHandle diff formatting when there is nothing to compare with 70/29170/4
Robin Rosenberg [Sun, 29 Jun 2014 20:31:26 +0000 (22:31 +0200)]
Handle diff formatting when there is nothing to compare with

DiffFormatter now suports either side being null and the log program
will output the diff for the first commit.

Bug: 395791
Change-Id: I378957b57e9ad1f7195ba416f402178453f0ebd3

10 years agoEliminate warning about overlapping variable names 29/29429/2
Robin Rosenberg [Thu, 3 Jul 2014 20:06:46 +0000 (22:06 +0200)]
Eliminate warning about overlapping variable names

Change-Id: I7e749092c5b51e2857c186088e2c5c6c6d295367

10 years agoDon't warn for methods that can be static 38/28538/5
Robin Rosenberg [Sun, 15 Jun 2014 19:36:15 +0000 (21:36 +0200)]
Don't warn for methods that can be static

Making the methods static would gain little in performance,
make the code harder to change. Removing unncessary warnings
is more important.

Change-Id: If3e6aa9c1d92e58b4e7a8e246cf4aace237d7a7b

10 years agoAdd new default settings from Eclipse 4.4 42/28542/5
Robin Rosenberg [Sun, 15 Jun 2014 19:53:53 +0000 (21:53 +0200)]
Add new default settings from Eclipse 4.4

These settings were added by Eclipse simply by touching
the project settings. Adding these makes it simpler to see
what local changes have been made.

Change-Id: Iab0aa62530312eb0c78b03b5c6a632742bcc4978

10 years agoMerge "Clarify comments in message properties files (and fix grammar)"
Matthias Sohn [Tue, 1 Jul 2014 22:29:48 +0000 (18:29 -0400)]
Merge "Clarify comments in message properties files (and fix grammar)"

10 years agoTry to fix intermittent test failure related to file timestamps 61/29161/6
Robin Rosenberg [Sat, 28 Jun 2014 13:31:11 +0000 (15:31 +0200)]
Try to fix intermittent test failure related to file timestamps

Improve how tests do a "touch" operation on files. Instead of doing
"f.setLastModified(System.currentTimeMillis)" open a Outputstream on the
file and directly close it again. This makes this method rely only on
one clock - the clock of the filesystem.

Bug: 436917
Change-Id: I68ef3c2878f28b12daebf2ef6a9fa0a5d6e0964d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoClarify comments in message properties files (and fix grammar) 86/29186/1
Robin Stocker [Mon, 30 Jun 2014 10:54:32 +0000 (20:54 +1000)]
Clarify comments in message properties files (and fix grammar)

Bug: 438261
Change-Id: I7b98475886ef789ae7635d8c9e008fc1aa00d534
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoFix incorrect "''" in CLIText.properties 85/29185/1
Robin Stocker [Mon, 30 Jun 2014 10:53:10 +0000 (20:53 +1000)]
Fix incorrect "''" in CLIText.properties

This message is not processed by MessageFormat.

Bug: 438261
Change-Id: If75d8f3cd3f356a56623eee96b64e8845de5eb38
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoAdd a comment to the message properties files on how they are processed 57/29157/2
Robin Rosenberg [Sat, 28 Jun 2014 09:25:53 +0000 (11:25 +0200)]
Add a comment to the message properties files on how they are processed

Change-Id: I073f0c2c0729e6a5d3f1834203f0cfeb4c462eda

10 years agoFix spelling error in error messgae 56/29156/2
Robin Rosenberg [Sat, 28 Jun 2014 09:18:36 +0000 (11:18 +0200)]
Fix spelling error in error messgae

Change-Id: I5f712ba290592f7c5aa9ee865ff30383ad315247

10 years agoRemove duplicate string in CLIText.properties 55/29155/3
Robin Rosenberg [Sat, 28 Jun 2014 08:30:01 +0000 (10:30 +0200)]
Remove duplicate string in CLIText.properties

Bug: 438261
Change-Id: Idd6839465ea36d072b1c4393f5abd2f39da02b62

10 years agoFix formatting errors in error messages 54/29154/4
Robin Rosenberg [Sat, 28 Jun 2014 08:24:15 +0000 (10:24 +0200)]
Fix formatting errors in error messages

{} is plain wrong and is not accepted by MessageFormat, the other risk
becoming wrong if another single quote is introduced in the future and
sets a bad example.

Bug: 438261
Change-Id: I2948ca90c10f6ec2574f7f2b9be0a72821ea4daf

10 years agoMerge branch 'stable-3.4' 42/28842/1
Matthias Sohn [Fri, 20 Jun 2014 23:28:55 +0000 (01:28 +0200)]
Merge branch 'stable-3.4'

* stable-3.4:
  Prepare 3.4.2-SNAPSHOT builds
  JGit v3.4.1.201406201815-r
  Allow retrying connecting SshSession in case of an exception

Change-Id: I7efb009b9e012637a16c57e2e93e074023b8e46c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare 3.4.2-SNAPSHOT builds 41/28841/1
Matthias Sohn [Fri, 20 Jun 2014 22:57:43 +0000 (00:57 +0200)]
Prepare 3.4.2-SNAPSHOT builds

Change-Id: If88217d84b88cda6d04c159418d5bc86233fe28c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.4.1.201406201815-r 38/28838/1 v3.4.1.201406201815-r
Matthias Sohn [Fri, 20 Jun 2014 22:16:29 +0000 (00:16 +0200)]
JGit v3.4.1.201406201815-r

Change-Id: I4383a90fd91a243cd5ce5d0ae4e53874b36c1f47
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAllow retrying connecting SshSession in case of an exception 76/28676/4
Stefan Lay [Wed, 18 Jun 2014 09:33:34 +0000 (11:33 +0200)]
Allow retrying connecting SshSession in case of an exception

Connecting to an SshSession may fail due to different reasons. Jsch for
example often throws an com.jcraft.jsch.JschException: verify: false.[1]
The issue is still not fixed in JSch 0.1.51.

In such a case it is worth retrying to connect. The number of connection
attempts can be configured using ssh_config parameter
"ConnectionAttempts" [2].

Don't retry if the user canceled authentication.

[1] http://sourceforge.net/p/jsch/bugs/58/
[2] http://linux.die.net/man/5/ssh_config

Bug: 437656
Change-Id: I6dd2a3786b7d3f15f5a46821d8edac987a57e381
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRemove no longer needed API breakage filters 41/28541/2
Robin Rosenberg [Sun, 15 Jun 2014 19:45:28 +0000 (21:45 +0200)]
Remove no longer needed API breakage filters

Change-Id: I2ea2dec55c187b62662195bae810b3f0af8a2983

10 years agoRemove an unnecessary semicolon 40/28540/2
Robin Rosenberg [Sun, 15 Jun 2014 19:39:18 +0000 (21:39 +0200)]
Remove an unnecessary semicolon

Change-Id: I6c5b085ae4a47d0026bd2b2341de76ab333936b9

10 years agoRemove an unnecessary $NON-NLS$ comment 39/28539/2
Robin Rosenberg [Sun, 15 Jun 2014 19:38:56 +0000 (21:38 +0200)]
Remove an unnecessary $NON-NLS$ comment

Change-Id: I8335464061dac1c20de2b698f834e516ef78cf3d

10 years agoMerge "Enable NLS / TranslationBundle to be used in OSGi"
Robin Rosenberg [Sun, 15 Jun 2014 19:58:29 +0000 (15:58 -0400)]
Merge "Enable NLS / TranslationBundle to be used in OSGi"

10 years agoDon't set REWRITE flag unless parent rewriting is requested 47/28447/1
Dave Borowitz [Thu, 12 Jun 2014 19:01:48 +0000 (12:01 -0700)]
Don't set REWRITE flag unless parent rewriting is requested

Change-Id: I65e3702ceb6c8854a2c358cfc2c2e3a9fb9486ff

10 years agoRename RewriteTreeFilter to TreeRevFilter and make it public 46/28446/1
Dave Borowitz [Thu, 12 Jun 2014 17:04:01 +0000 (10:04 -0700)]
Rename RewriteTreeFilter to TreeRevFilter and make it public

The current behavior of passing a TreeFilter to RevWalk has limited
usefulness, since the RevFilter derived from the TreeFilter is always
ANDed together with any other RevFilters. It is also tied fairly
tightly to the parent rewriting mechanism.

Make TreeRevFilter a generic RevFilter that matches modified paths
against any TreeFilter. This allows for more complex logic like
(modified this path OR authored by this person).

Leave the rewrite flag logic in this class, since it's closely tied to
the parent comparison code, but hidden behind a protected constructor.

Change-Id: Ia72ef591a99415e6f340c5f64583a49c91f1b82f

10 years agoAdd missing javadoc and since tag for RepoCommand.readFileFromRepo() 04/28404/1
Matthias Sohn [Thu, 12 Jun 2014 08:50:03 +0000 (10:50 +0200)]
Add missing javadoc and since tag for RepoCommand.readFileFromRepo()

Change-Id: Ib0a98ce633e83c82a58b633c767e70d316b7254c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Refactor DefaultRemoteReader for easier code reuse"
Dave Borowitz [Wed, 11 Jun 2014 23:10:24 +0000 (19:10 -0400)]
Merge "Refactor DefaultRemoteReader for easier code reuse"

10 years agoMerge branch 'stable-3.4' 69/28369/1
Matthias Sohn [Wed, 11 Jun 2014 15:48:46 +0000 (17:48 +0200)]
Merge branch 'stable-3.4'

* stable-3.4:
  Prepare post 3.4.0 builds
  JGit v3.4.0.201406110918-r

Change-Id: I1aa3b911c7ace01b82ab9844eec5432d4125b726
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare post 3.4.0 builds 68/28368/1
Matthias Sohn [Wed, 11 Jun 2014 15:45:04 +0000 (17:45 +0200)]
Prepare post 3.4.0 builds

Change-Id: I49f3741f3973b247a635f7c99b72309d2381a377
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.4.0.201406110918-r 50/28350/1 v3.4.0.201406110918-r
Matthias Sohn [Wed, 11 Jun 2014 13:20:26 +0000 (15:20 +0200)]
JGit v3.4.0.201406110918-r

Change-Id: I56543234316f04bff4e45628bcb8286a6e52e31f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRefactor DefaultRemoteReader for easier code reuse 08/28308/2
Yuxuan 'fishy' Wang [Tue, 10 Jun 2014 22:44:15 +0000 (15:44 -0700)]
Refactor DefaultRemoteReader for easier code reuse

Change-Id: I7f326b4fc96198de7b424e15d8329bde7d7b39cf
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "Fixed the problem with calling LsRemoteCommand without a local repository...
Robin Rosenberg [Tue, 10 Jun 2014 19:49:29 +0000 (15:49 -0400)]
Merge "Fixed the problem with calling LsRemoteCommand without a local repository over the ssh and git:// protocols."

10 years agoAdd missing @since to RepoCommand.setInputStream 64/28264/1
Robin Rosenberg [Tue, 10 Jun 2014 07:59:17 +0000 (09:59 +0200)]
Add missing @since to RepoCommand.setInputStream

Change-Id: I2fa1a5c28a1521a837aeaeb994e5cce8d7c4e645

10 years agoAdded setInputStream to RepoCommand. 80/28080/3
Yuxuan 'fishy' Wang [Thu, 5 Jun 2014 20:53:28 +0000 (13:53 -0700)]
Added setInputStream to RepoCommand.

Sometimes an input stream is more useful than the filename of the xml manifest.

Change-Id: Icb09ac751b3d8d7eb14427ad1aac8cee0c371c5f
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "Better way to handle relative URLs in manifest XML"
Dave Borowitz [Mon, 9 Jun 2014 17:26:25 +0000 (13:26 -0400)]
Merge "Better way to handle relative URLs in manifest XML"

10 years agoFixed the problem with calling LsRemoteCommand without a local repository over the... 48/28048/4
Anton Bannykh [Thu, 5 Jun 2014 13:54:01 +0000 (17:54 +0400)]
Fixed the problem with calling LsRemoteCommand without a local repository over the ssh and git:// protocols.

Bug: 436695
Change-Id: Ifd69fbc04156fa4dacdcba6225768f43843eee97
Signed-off-by: Anton Bannykh <anton.bannykh@gmail.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
10 years agoLsRemoteCommand - internal execute need not be protected 93/27593/2
Robin Rosenberg [Wed, 28 May 2014 08:00:30 +0000 (10:00 +0200)]
LsRemoteCommand - internal execute need not be protected

Change-Id: I04d054d9f19e4ee200f72b25962be4759cfe5d7e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoEnable passing version number to maven central scripts 85/28085/3
Matthias Sohn [Thu, 5 Jun 2014 23:24:03 +0000 (01:24 +0200)]
Enable passing version number to maven central scripts

Also check if the passed version matches the version pattern
<major>.<minor>.<micro>.<qualifier>-<classifier>

Change-Id: Ib7edf51fb5e89232909611de5b4811a62b4f3953
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Fix DeltaTask infinite loop"
Robin Rosenberg [Fri, 6 Jun 2014 11:40:37 +0000 (07:40 -0400)]
Merge "Fix DeltaTask infinite loop"

10 years agoMerge "Make JavaDoc validator happy by declaring GitAPIException on callAsMap"
Robin Rosenberg [Fri, 6 Jun 2014 11:11:10 +0000 (07:11 -0400)]
Merge "Make JavaDoc validator happy by declaring GitAPIException on callAsMap"

10 years agoBetter way to handle relative URLs in manifest XML 87/28087/2
Yuxuan 'fishy' Wang [Fri, 6 Jun 2014 00:25:34 +0000 (17:25 -0700)]
Better way to handle relative URLs in manifest XML

The old implementation will NOT strip the filename part from the baseUrl, e.g.
https://android.googlesource.com/platform/manifest with .. will be resolved to
https://android.googlesource.com/platform/, which is actually wrong. This
implementation will resolve it to https://android.googlesource.com/ to match the
behavior of repo.

Change-Id: Ia32c8b34e16eacdf37a0da7025bf0b5cc5f67ed2
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoFix DeltaTask infinite loop 71/28071/1
Hugo Arès [Thu, 5 Jun 2014 19:16:26 +0000 (15:16 -0400)]
Fix DeltaTask infinite loop

DeltaTask$Block.partitionTask was doing an infinite loop if number of
threads was greater than the totalWeight. The weightPerThread was 0
which was causing the infinite loop. Set the weightPerThread to a
minimal value of one.

Bug: 420915
Change-Id: Ia8e3ad956d53d8193937b7fa1bc19aafde9767ff
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
10 years agoPrepare 3.5.0-SNAPSHOT builds 07/27907/4
Robin Rosenberg [Wed, 4 Jun 2014 08:32:22 +0000 (10:32 +0200)]
Prepare 3.5.0-SNAPSHOT builds

Change-Id: I53bd500188e09ae2e007a58b3cd89aa0805d6f2a
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
10 years agoMerge branch 'stable-3.4' 00/28000/1
Matthias Sohn [Wed, 4 Jun 2014 21:28:49 +0000 (23:28 +0200)]
Merge branch 'stable-3.4'

* stable-3.4:
  Prepare post 3.4 RC3 builds
  JGit v3.4.0.201406041058-rc3
  blame: Un-break isFile check in tree walk
  Prepare post 3.4.0 RC2 builds
  JGit v3.4.0.201405281120-rc2
  Fix authentication type names broken by 0b5441a8
  Update Luna target platform to Orbit release R20140525021250

Change-Id: I344f1bbb8939bda01d524ec1a3218aa32bcc62f5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare post 3.4 RC3 builds 94/27994/1
Matthias Sohn [Wed, 4 Jun 2014 20:14:26 +0000 (22:14 +0200)]
Prepare post 3.4 RC3 builds

Change-Id: I9730bb349d0295c811aa3a9ba0f67bd946e86d1e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.4.0.201406041058-rc3 55/27955/1 v3.4.0.201406041058-rc3
Matthias Sohn [Wed, 4 Jun 2014 14:58:04 +0000 (16:58 +0200)]
JGit v3.4.0.201406041058-rc3

Change-Id: If0cfec023788cae7713dd1ccc250e221365ef984
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoblame: Un-break isFile check in tree walk 54/27754/2
Jonathan Nieder [Mon, 2 Jun 2014 19:03:45 +0000 (12:03 -0700)]
blame: Un-break isFile check in tree walk

Originally, blame's walk to find a scapegoat to blame for a file
walking backward from a commit used the test

treeWalk.getFileMode(0).getObjectType() != OBJ_BLOB

to throw out gitlink (submodule) entries.  Later, 52500d3264d2 (blame:
Micro optimize blob lookup in tree, 2014-04-17) changed that test to

(treeWalk.getRawMode(0) & TYPE_FILE) != TYPE_FILE

These checks are not the same, though: the older test accepts files
and symlinks, while the newer one accepts files, symlinks, and gitlink
(submodule) entries.  This is particularly broken in the submodule
case --- trying to parse the referred-to commit as a blob produces

caught an exception: GET /gerrit/+blame/master/plugins/reviewnotes HTTP/1.1
org.eclipse.jgit.errors.MissingObjectException: Missing blob 61702414c046dd6b811c9137b765f9db422f83db

Stick to just (possibly executable) files instead.  Symlinks are not
line-oriented data so blame on a symlink is not likely to be useful.

A quick grep for '& TYPE_' doesn't find any other instances of this
bug.

Change-Id: Iebcc91f1bee3c91adda51dccd6372e8302bf23fe
Signed-off-by: Jonathan Nieder <jrn@google.com>
10 years agoMake JavaDoc validator happy by declaring GitAPIException on callAsMap 94/27594/2
Robin Rosenberg [Fri, 30 May 2014 14:14:28 +0000 (16:14 +0200)]
Make JavaDoc validator happy by declaring GitAPIException on callAsMap

Change-Id: I9caa559a3d4eb0ec93d90cf1e18aed785ef85a84

10 years agoEnable NLS / TranslationBundle to be used in OSGi 80/27580/2
Rüdiger Herrmann [Fri, 30 May 2014 11:54:13 +0000 (13:54 +0200)]
Enable NLS / TranslationBundle to be used in OSGi

TranslationBundle#load() used to load resource bundles through
ResourceBundle#getBundle() without explicitly specifying a class loader.
In this case, the class laoder of the calling class (TranslationBundle
here) is used. This approach fails in runtime environments like OSGi
where there are multiple class loaders.

This change enables loading resource bundles in multi class loaders
environments. The fix is to pass the class loader of the
TranslationBundle-derived class to ResourceBundle#getBundle().

Bug: 436232
Change-Id: I39db61e012dc93ebf388a71bf6088a3310a22bac
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
10 years agoPrepare post 3.4.0 RC2 builds 74/27474/1
Matthias Sohn [Wed, 28 May 2014 15:40:46 +0000 (17:40 +0200)]
Prepare post 3.4.0 RC2 builds

Change-Id: Id8d784ba7b0aba7c6a00f459bf1ac54c1d36d061
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.4.0.201405281120-rc2 73/27473/1 v3.4.0.201405281120-rc2
Matthias Sohn [Wed, 28 May 2014 15:19:39 +0000 (17:19 +0200)]
JGit v3.4.0.201405281120-rc2

Change-Id: Ifd376f58cf867fc84d39582c49e971d998abf63d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRemove unused import 40/27340/2
Dani Megert [Tue, 27 May 2014 09:58:42 +0000 (11:58 +0200)]
Remove unused import

Change-Id: I6f59539350ab28605e2e1fe1f30354cd68aa7740
Signed-off-by: Dani Megert <Daniel_Megert@ch.ibm.com>
10 years agoMerge "Unit test for the updating behavior in RepoCommand API."
Shawn Pearce [Tue, 27 May 2014 21:02:02 +0000 (17:02 -0400)]
Merge "Unit test for the updating behavior in RepoCommand API."

10 years agoUnit test for the updating behavior in RepoCommand API. 49/27049/4
Yuxuan 'fishy' Wang [Wed, 21 May 2014 18:16:36 +0000 (11:16 -0700)]
Unit test for the updating behavior in RepoCommand API.

When update the manifest against a bare repository, RepoCommand will replace
every existing content from the repository with contents populated from the
manifest. Added note for that and a unit test to make sure this behavior.

Change-Id: I1d5960e84bca5aa2a4e86f424d2ddd4197894cdc
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoFix authentication type names broken by 0b5441a8 49/27249/4
Matthias Sohn [Sun, 25 May 2014 22:45:49 +0000 (00:45 +0200)]
Fix authentication type names broken by 0b5441a8

0b5441a8 introduced an enum for authentication types and changed the
case of digest and basic authentication type names to all uppercase.
This broke digest authentication at least when using Gerrit as the git
server.

According to RFC2617 [1] "Basic" and "Digest" is the literal to be used
in authentication headers and not "BASIC" [1] and "DIGEST" [2].
According to RFC4559 "Negotiate" [3] is used for SPNEGO based
authentication.

[1] http://tools.ietf.org/html/rfc2617#page-5
[2] http://tools.ietf.org/html/rfc2617#page-8
[3] http://tools.ietf.org/html/rfc4559#page-3

Bug: 435866
Change-Id: I6173aff9352d7def225cafe2d73e5176ad40dff0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRemove a bit of repetition and casting in PackFileTest 23/27323/1
Roberto Tyley [Sun, 25 May 2014 18:34:24 +0000 (19:34 +0100)]
Remove a bit of repetition and casting in PackFileTest

PackFileTest lives in o.e.j.internal.storage.file, so I think it's OK for
it to acknowledge the existence of FileRepository in order to avoid some
unnecessary casting, and probably nicer to avoid the repetition too.

Change-Id: I0de592a32f6178e6d6bf114848101e185b3111a1
Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com>
10 years agoUpdate Luna target platform to Orbit release R20140525021250 57/27257/1
Matthias Sohn [Mon, 26 May 2014 07:35:11 +0000 (09:35 +0200)]
Update Luna target platform to Orbit release R20140525021250

Change-Id: Id46d74e9b11b2a7ea78d17b8bc12c3ad027723f1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Adds a callAsMap() function to LsRemoteCommand."
Matthias Sohn [Sat, 24 May 2014 22:06:13 +0000 (18:06 -0400)]
Merge "Adds a callAsMap() function to LsRemoteCommand."

10 years agoAdds a callAsMap() function to LsRemoteCommand. 43/27143/4
Yuxuan 'fishy' Wang [Thu, 22 May 2014 21:04:16 +0000 (14:04 -0700)]
Adds a callAsMap() function to LsRemoteCommand.

The call() function of LsRemoteCommand returns Collection<Ref>, while its
internal is using Map<String, Ref> all the time. Sometimes the map is much more
useful to the caller so add a callAsMap() function to keep the API
compatibility.

Change-Id: Icb96b71277d5e2de59872aa777352dedc048c4e3
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "Fix reading past FileTreeIterator EOF in FileTreeIteratorJava7Test"
Robin Rosenberg [Sat, 24 May 2014 10:10:33 +0000 (06:10 -0400)]
Merge "Fix reading past FileTreeIterator EOF in FileTreeIteratorJava7Test"

10 years agoAllow to include untracked files in stash operations. 12/26212/3
Andreas Hermann [Thu, 8 May 2014 12:04:32 +0000 (14:04 +0200)]
Allow to include untracked files in stash operations.

Unstashed changes are saved in a commit which is added as an additional
parent to the stash commit.
This behaviour is fully compatible with C Git stashing of untracked
files.

Bug: 434411
Change-Id: I2af784deb0c2320bb57bc4fd472a8daad8674e7d
Signed-off-by: Andreas Hermann <a.v.hermann@gmail.com>
10 years agoFix for reflog corruption caused by multiline message 09/27109/3
Andreas Hermann [Thu, 15 May 2014 11:40:58 +0000 (13:40 +0200)]
Fix for reflog corruption caused by multiline message

If a client passes a multiline message as argument to ReflogWriter.log()
the Reflog gets corrupted and cannot be parsed. ReflogWriter.log() is
invoked implicitly from various commands such as StashCreate, Rebase and
many more. However the message is not always filtered for line feeds.

Such an example is the StashCreateOperation of EGit which passes
unchecked user input as commit message. If a multiline comment is pasted
to the stash create dialog, the reflog gets corrupted.

ReflogWriter now replaces line endings in log message with spaces.

Bug: 435509
Change-Id: I3010cc902e13bee4d7b6696dfd11ab51062739d3
Signed-off-by: Andreas Hermann <a.v.hermann@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoImprove layout of branches in the commit graph 53/25753/5
Konrad Kügler [Sun, 9 Mar 2014 12:44:41 +0000 (13:44 +0100)]
Improve layout of branches in the commit graph

The aim of this change is to place all commits of a branch on the same
lane and commits of other (side) branches on different lanes.

The algorithm treats first parents of a commit specially by placing them
on the same lane as the commit itself. When a commit is the first parent
of multiple children it could be placed on any of these children's
lanes. In this case it is placed on the longest child lane, as this is
usually the lane of the branch the commit actually was made on.

Other (non-first) parents are placed on new lanes. This creates a layout
that should make it easier to see branches and merges and follow linear
branch histories.
This differs from the previous approach, which sometimes plotted the
commits of a side branch on the same lane as the base branch commits and
further commits on the base branch appeared on a different lane.
This made the base branch appear as if it was the side branch and
the side branch appears to be the base branch.

In addition to lane assignment, also the plotting code changed to start
drawing a branch lane from the commit where it forks out. Previously it
started only when the first commit on the branch appeared.

Active lanes are continued with every commit that is processed.
Previously lanes were only continued when the next commit on the lane
was encountered. This could produce (temporarily) dangling commits if
the next commit on the lane was not processed yet.

CQ: 8299
Bug: 419359
Bug: 434945
Change-Id: Ibe547aa24b5948ae264f7d0f56a492a4ef335608
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPlotCommitList: Remove handling of children that have no lane yet 06/26806/3
Konrad Kügler [Sun, 18 May 2014 19:49:32 +0000 (21:49 +0200)]
PlotCommitList: Remove handling of children that have no lane yet

Child commits always have a lane assigned when their parents are
processed, so this code is no longer necessary.

Children only assign themselves to parents in
PlotCommitList.setupChildren(), which is called from enter(), when the
child is processed. If the child leaves enter() it should always have a
lane assigned. As a result of this, when processing a parent, all its
known children already have lanes assigned. If the underlying RevWalk
emits a parent before one of its children (which it should not do), the
parent does not know of the child emitted later, because setupChildren()
has not been called for the child yet. So even in this case, no child
without a lane is encountered when processing a (parent) commit.

Change-Id: I982adc5c114370ecfd699d96221a76463de900ca
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPlotCommitList: Refactor lane creation and position allocation 33/25633/4
Konrad Kügler [Sun, 27 Apr 2014 20:07:54 +0000 (22:07 +0200)]
PlotCommitList: Refactor lane creation and position allocation

This also properly removes the newly determinded lane position from the
freePositions set in handleBlockedLanes(). closeLane() does only recycle
active lanes, to avoid recycling lanes twice.

Change-Id: Icd019fcf7974441ed05686bb61d6de4e8bf4ab7c
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdd missing since tags 64/27064/1
Matthias Sohn [Wed, 21 May 2014 20:34:17 +0000 (22:34 +0200)]
Add missing since tags

Change-Id: I6090b81aa963731af369babbe71b05ac817ee3dc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRemove usage of IOException(Throwable) not available on Java 5 63/27063/1
Matthias Sohn [Wed, 21 May 2014 20:32:58 +0000 (22:32 +0200)]
Remove usage of IOException(Throwable) not available on Java 5

Change-Id: I386aa77fb78bed3fb38a3ce46eaeb47df95fdde3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare post 3.4.0 RC1 builds 59/27059/1
Matthias Sohn [Wed, 21 May 2014 20:04:11 +0000 (22:04 +0200)]
Prepare post 3.4.0 RC1 builds

Change-Id: Ia8d29046439bc9134acdf7c88ab85ea49c4ddf47
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.4.0.201405211411-rc1 51/27051/1 v3.4.0.201405211411-rc1
Matthias Sohn [Wed, 21 May 2014 18:11:56 +0000 (20:11 +0200)]
JGit v3.4.0.201405211411-rc1

Change-Id: Ia3834770b9719f64cbdfd0338034c392fa3ae5db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdd script to create JGit release 50/27050/1
Matthias Sohn [Wed, 21 May 2014 13:27:34 +0000 (15:27 +0200)]
Add script to create JGit release

Change-Id: I620a209406dd021f3e8e1dafcfb381631dfd25d2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdds support for SPNEGO 89/22489/3
Laurent Goujon [Mon, 24 Feb 2014 22:47:51 +0000 (14:47 -0800)]
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>
10 years agoCreates HttpAuthMethod type enum to support auth ordering 88/22488/2
Laurent Goujon [Mon, 24 Feb 2014 21:52:33 +0000 (13:52 -0800)]
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>
10 years agoDetects background authentication and force use of jgit authentication 87/22487/3
Laurent Goujon [Mon, 24 Feb 2014 21:23:00 +0000 (13:23 -0800)]
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>