Commit Graph

3217 Commits

Author SHA1 Message Date
Robin Stocker f3fc379757 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>
2014-07-20 17:44:53 -04:00
Robin Rosenberg fd58cbcdee Don't prefix output from jgit status with '# '
C Git does not do it anymore

Bug: 439937
Change-Id: I20bdb787a00bba3e4adf269fd64ec6296bdc2a66
2014-07-19 07:31:45 -04:00
Konrad Kügler 48544e27ae 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>
2014-07-15 19:08:19 -04:00
Konrad Kügler e0fbae5dc3 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>
2014-07-15 19:00:58 -04:00
Konrad Kügler b9a0077062 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>
2014-07-14 14:54:52 -04:00
Konrad Kügler 0f679dbda5 Cherry-Pick: Support --no-commit
Change-Id: Ic4c313a8971a5aa15745518c49e2587a1a0fe8d4
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
2014-07-14 20:01:04 +02:00
Robin Rosenberg 89ad10ec27 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
2014-07-06 18:45:48 +02:00
Robin Rosenberg 71c18201c1 Eliminate warning about overlapping variable names
Change-Id: I7e749092c5b51e2857c186088e2c5c6c6d295367
2014-07-04 10:30:54 -04:00
Robin Rosenberg a03bdcbbb4 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
2014-07-02 00:36:38 +02:00
Robin Rosenberg 8032b64980 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
2014-07-02 00:34:41 +02:00
Matthias Sohn 6b0503c0c2 Merge "Clarify comments in message properties files (and fix grammar)" 2014-07-01 18:29:48 -04:00
Robin Rosenberg 0f14d3bf40 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>
2014-07-01 15:29:11 +02:00
Robin Stocker 26e0c533d0 Clarify comments in message properties files (and fix grammar)
Bug: 438261
Change-Id: I7b98475886ef789ae7635d8c9e008fc1aa00d534
Signed-off-by: Robin Stocker <robin@nibor.org>
2014-06-30 20:54:32 +10:00
Robin Stocker 10aee9b1b7 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>
2014-06-30 20:53:10 +10:00
Robin Rosenberg 844739baa1 Add a comment to the message properties files on how they are processed
Change-Id: I073f0c2c0729e6a5d3f1834203f0cfeb4c462eda
2014-06-29 15:55:53 +10:00
Robin Rosenberg 5054f36d4b Fix spelling error in error messgae
Change-Id: I5f712ba290592f7c5aa9ee865ff30383ad315247
2014-06-29 15:55:53 +10:00
Robin Rosenberg a9cd45cbd8 Remove duplicate string in CLIText.properties
Bug: 438261
Change-Id: Idd6839465ea36d072b1c4393f5abd2f39da02b62
2014-06-29 15:55:53 +10:00
Robin Rosenberg 350ba91585 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
2014-06-29 15:55:53 +10:00
Matthias Sohn 64dde09b85 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>
2014-06-21 01:28:55 +02:00
Matthias Sohn 7865d7100e Prepare 3.4.2-SNAPSHOT builds
Change-Id: If88217d84b88cda6d04c159418d5bc86233fe28c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-06-21 00:57:43 +02:00
Matthias Sohn 03f6e83c40 JGit v3.4.1.201406201815-r
Change-Id: I4383a90fd91a243cd5ce5d0ae4e53874b36c1f47
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-06-21 00:16:29 +02:00
Stefan Lay 4b2b3294b8 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>
2014-06-20 11:48:53 +02:00
Robin Rosenberg 79792c59b6 Remove no longer needed API breakage filters
Change-Id: I2ea2dec55c187b62662195bae810b3f0af8a2983
2014-06-15 23:34:59 +02:00
Robin Rosenberg 78cd2bb9e0 Remove an unnecessary semicolon
Change-Id: I6c5b085ae4a47d0026bd2b2341de76ab333936b9
2014-06-15 23:33:06 +02:00
Robin Rosenberg 447fd6a948 Remove an unnecessary $NON-NLS$ comment
Change-Id: I8335464061dac1c20de2b698f834e516ef78cf3d
2014-06-15 23:30:44 +02:00
Robin Rosenberg be025ff7d2 Merge "Enable NLS / TranslationBundle to be used in OSGi" 2014-06-15 15:58:29 -04:00
Dave Borowitz 7eb0b702fd Don't set REWRITE flag unless parent rewriting is requested
Change-Id: I65e3702ceb6c8854a2c358cfc2c2e3a9fb9486ff
2014-06-12 13:52:09 -07:00
Dave Borowitz eb69cef35c 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
2014-06-12 13:52:09 -07:00
Matthias Sohn 2a562b94d6 Add missing javadoc and since tag for RepoCommand.readFileFromRepo()
Change-Id: Ib0a98ce633e83c82a58b633c767e70d316b7254c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-06-12 10:50:03 +02:00
Dave Borowitz e23768f779 Merge "Refactor DefaultRemoteReader for easier code reuse" 2014-06-11 19:10:24 -04:00
Matthias Sohn 82060d02cb 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>
2014-06-11 17:49:58 +02:00
Matthias Sohn 126eb94f77 Prepare post 3.4.0 builds
Change-Id: I49f3741f3973b247a635f7c99b72309d2381a377
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-06-11 17:45:39 +02:00
Matthias Sohn d0daad884f JGit v3.4.0.201406110918-r
Change-Id: I56543234316f04bff4e45628bcb8286a6e52e31f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-06-11 15:20:26 +02:00
Yuxuan 'fishy' Wang afa2154e45 Refactor DefaultRemoteReader for easier code reuse
Change-Id: I7f326b4fc96198de7b424e15d8329bde7d7b39cf
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
2014-06-10 16:21:42 -07:00
Robin Rosenberg 83846d1f6d Merge "Fixed the problem with calling LsRemoteCommand without a local repository over the ssh and git:// protocols." 2014-06-10 15:49:29 -04:00
Robin Rosenberg 79004dd42a Add missing @since to RepoCommand.setInputStream
Change-Id: I2fa1a5c28a1521a837aeaeb994e5cce8d7c4e645
2014-06-10 09:59:17 +02:00
Yuxuan 'fishy' Wang acd7ed5269 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>
2014-06-09 13:26:52 -04:00
Dave Borowitz c8ddac2a86 Merge "Better way to handle relative URLs in manifest XML" 2014-06-09 13:26:25 -04:00
Anton Bannykh f4943de29b 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>
2014-06-08 16:42:02 +02:00
Robin Rosenberg dc66469e11 LsRemoteCommand - internal execute need not be protected
Change-Id: I04d054d9f19e4ee200f72b25962be4759cfe5d7e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-06-08 01:32:17 +02:00
Matthias Sohn be25ecb393 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>
2014-06-06 15:41:22 +02:00
Robin Rosenberg 4dc3ba4327 Merge "Fix DeltaTask infinite loop" 2014-06-06 07:40:37 -04:00
Robin Rosenberg 926627fa41 Merge "Make JavaDoc validator happy by declaring GitAPIException on callAsMap" 2014-06-06 07:11:10 -04:00
Yuxuan 'fishy' Wang 39001eacc1 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>
2014-06-05 17:40:37 -07:00
Hugo Arès d439c8dfe5 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>
2014-06-05 15:20:04 -04:00
Robin Rosenberg 64b0531c35 Prepare 3.5.0-SNAPSHOT builds
Change-Id: I53bd500188e09ae2e007a58b3cd89aa0805d6f2a
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2014-06-04 18:23:29 -04:00
Matthias Sohn f449f6b1c9 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>
2014-06-04 23:29:09 +02:00
Matthias Sohn 3b83e1a398 Prepare post 3.4 RC3 builds
Change-Id: I9730bb349d0295c811aa3a9ba0f67bd946e86d1e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-06-04 22:14:52 +02:00
Matthias Sohn dd06dcdcf2 JGit v3.4.0.201406041058-rc3
Change-Id: If0cfec023788cae7713dd1ccc250e221365ef984
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-06-04 16:58:04 +02:00
Jonathan Nieder 9b46a47fb7 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, 52500d3264 (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>
2014-06-04 10:26:01 -04:00