]> source.dussan.org Git - jgit.git/log
jgit.git
11 years agoFixed problems occuring when changing user in gerrit configuration 04/10104/1
Tobias Pfeifer [Fri, 1 Feb 2013 15:05:31 +0000 (16:05 +0100)]
Fixed problems occuring when changing user in gerrit configuration

Bug: 399238
Change-Id: I255634bc9b3681f292190051daed22a4771d6e57
Signed-off-by: Tobias Pfeifer <to.pfeifer@sap.com>
11 years agoUpdate to latest orbit release 86/9986/4
Matthias Sohn [Mon, 28 Jan 2013 08:28:15 +0000 (09:28 +0100)]
Update to latest orbit release

Update 3rd party dependencies to respective latest approved version.

args4j 2.0.21 is not yet available on Maven central, hence compile
against 2.0.12 and package 2.0.21 until 2.0.21 has been published on
Maven central.

Change-Id: I41a34485970af41b4b5b2404e3d29c98979ddb48
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRemove PathFilterGroupTest2 45/10045/1
Robin Rosenberg [Wed, 30 Jan 2013 20:03:01 +0000 (21:03 +0100)]
Remove PathFilterGroupTest2

The test is not very useful for regression testing in its current form

Change-Id: I19d1a29ff693397ac795d414b83411f32fae56d8

11 years agoRemove debug printouts from PathFilterGroupTest 41/10041/1
Robin Rosenberg [Wed, 30 Jan 2013 18:46:19 +0000 (19:46 +0100)]
Remove debug printouts from PathFilterGroupTest

Change-Id: I4767e53efafe48d447ebe399fb2f8617072950ea

11 years agoFix stash apply using merge logic 77/9877/4
Robin Rosenberg [Thu, 24 Jan 2013 03:23:26 +0000 (04:23 +0100)]
Fix stash apply using merge logic

Instead of the complicated strange stuff, implement staah
apply as cherry-pick.

Provided there are no conflicts and it is requested that
the index should be applied, perform yet another cherry-pick,
but discard tha results thereof it that would result in conflicts.

Bug: 376035
Change-Id: I553f3a753e0124b102a51f8edbb53ddeff2912e2

11 years agoMerge "Align execution environment with JRE on the classpath in jgit.ant.test"
Matthias Sohn [Tue, 29 Jan 2013 17:05:29 +0000 (12:05 -0500)]
Merge "Align execution environment with JRE on the classpath in jgit.ant.test"

11 years agoFix Check for FF_ONLY merges again 88/9988/1
Robin Rosenberg [Tue, 29 Jan 2013 07:05:00 +0000 (08:05 +0100)]
Fix Check for FF_ONLY merges again

Added more FF-mode tests

Change-Id: I33eed5737d9411cc1cf214da62ce719916a1b736

11 years agoMerge "Check for FF_ONLY merges correctly"
Robin Rosenberg [Tue, 29 Jan 2013 00:02:18 +0000 (19:02 -0500)]
Merge "Check for FF_ONLY merges correctly"

11 years agoMerge changes Ife0cc2da,If38507ef
Robin Rosenberg [Tue, 29 Jan 2013 00:00:00 +0000 (19:00 -0500)]
Merge changes Ife0cc2da,If38507ef

* changes:
  Speed up PathFilterGroup for large sets of paths
  Add test case for PathFilterGroup

11 years agoCheck for FF_ONLY merges correctly 52/9852/2
Robin Rosenberg [Tue, 22 Jan 2013 23:04:08 +0000 (00:04 +0100)]
Check for FF_ONLY merges correctly

Bug: 398192
Change-Id: I1253c0ea0632185bbf9f77e32f13ba5842a6e18e

11 years agoAlign execution environment with JRE on the classpath in jgit.ant.test 26/9826/3
Tomasz Zarna [Tue, 22 Jan 2013 11:41:31 +0000 (12:41 +0100)]
Align execution environment with JRE on the classpath in jgit.ant.test

Change-Id: Ic11ddce81dbcc7d703742c7e86941d2f43668617

11 years agoMerge changes I25204d9e,Ia10d76e9
Matthias Sohn [Thu, 24 Jan 2013 20:57:11 +0000 (15:57 -0500)]
Merge changes I25204d9e,Ia10d76e9

* changes:
  Attempt to stabilize GCTest
  Attempt to stabilize FileTreeIterator test on Windows

11 years agoAttempt to stabilize GCTest 55/9855/1
Robin Rosenberg [Wed, 23 Jan 2013 07:27:12 +0000 (08:27 +0100)]
Attempt to stabilize GCTest

File system time stamps and System.currentTimeMillis() may not
necessarily be running on the same clock so add some slack.

Bug: 396662
Change-Id: I25204d9e3181e15368da2902447518c6ce205017

11 years agoAttempt to stabilize FileTreeIterator test on Windows 53/9853/1
Robin Rosenberg [Wed, 23 Jan 2013 06:55:13 +0000 (07:55 +0100)]
Attempt to stabilize FileTreeIterator test on Windows

My guess is that the higher resolution of timestamps provided by Java on
Windows causes this test to occasionally fail.

Bug: 396662
Change-Id: Ia10d76e95fe6156c7ad05972619160e461606805

11 years agoMerge "Reduce memory held and speed up DfsGarbageCollector."
Colby Ranger [Tue, 22 Jan 2013 23:55:36 +0000 (18:55 -0500)]
Merge "Reduce memory held and speed up DfsGarbageCollector."

11 years agoReduce memory held and speed up DfsGarbageCollector. 51/9851/2
Colby Ranger [Tue, 22 Jan 2013 22:54:05 +0000 (14:54 -0800)]
Reduce memory held and speed up DfsGarbageCollector.

getObjectList() returns a list of ObjectToPack. These can hold on to a
lot of memory. Furthermore, binary searching for objects in a sorted
array can be slow. Improve the speed and reduce the memory by creating a
copy of the ObjectId and inserting it into an ObjectIdOwnerMap.

Change-Id: Ib5aa5b7447e05938b47fa55812a87b9872c20ea7

11 years agoEnable marking entries using TreeFilters in DiffEntry 16/6716/8
Robin Stocker [Mon, 25 Jun 2012 22:55:39 +0000 (00:55 +0200)]
Enable marking entries using TreeFilters in DiffEntry

This adds a new optional TreeFilter[] argument to DiffEntry.scan. All
filters will be checked during the scan to determine if an entry should
be "marked" with regard to that filter.

After having called scan, the user can then call isMarked(int) on the
entries to find out whether they matched the TreeFilter with the passed
index.

An example use case for this is in the file diff viewer of EGit's
History view, where we'd like to highlight entries that are matching the
current filter.

See EGit change I03da4b38d1591495cb290909f0e4c6e52270e97f.

Bug: 393610
Change-Id: Icf911fe6fca131b2567514f54d66636a44561af1
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd new committers 92/9692/2
Matthias Sohn [Tue, 15 Jan 2013 23:20:12 +0000 (00:20 +0100)]
Add new committers

Change-Id: I5ef1edb8efc4668ef4731094ea6dbbcaf200195d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoUpdate to jsch 0.1.46 91/9691/2
Matthias Sohn [Tue, 15 Jan 2013 23:16:54 +0000 (00:16 +0100)]
Update to jsch 0.1.46

Change-Id: Ib7eb1ff175e3f9763653b0b0432b8ddc6b1c8938
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Fix NPE FS_Win32 when looking up git executable and home directory avoiding...
Matthias Sohn [Tue, 22 Jan 2013 13:28:49 +0000 (08:28 -0500)]
Merge "Fix NPE FS_Win32 when looking up git executable and home directory avoiding redundant code"

11 years agoSpeed up PathFilterGroup for large sets of paths 07/9607/8
Robin Rosenberg [Sun, 20 Jan 2013 11:56:25 +0000 (12:56 +0100)]
Speed up PathFilterGroup for large sets of paths

The ByteArraySet is a distorted copy of ObjectIdSubclassMap.

Bug: 397185
Change-Id: Ife0cc2da6cc46431be94a6b14f64f6adbe983afb

11 years agoAdd test case for PathFilterGroup 05/9605/7
Robin Rosenberg [Thu, 10 Jan 2013 23:19:27 +0000 (00:19 +0100)]
Add test case for PathFilterGroup

This is needed to prepare for optimization.

Bug: 397185
Change-Id: If38507ef8cc5a161353cc07bf7cd1922f54d1f8a

11 years agoMerge "Improve handling of checkout conflicts"
Robin Rosenberg [Sun, 20 Jan 2013 19:01:38 +0000 (14:01 -0500)]
Merge "Improve handling of checkout conflicts"

11 years agoMerge changes I7e7fae12,I87ecca00
Robin Rosenberg [Sat, 19 Jan 2013 16:54:21 +0000 (11:54 -0500)]
Merge changes I7e7fae12,I87ecca00

* changes:
  Add conflicts message before footer
  Only replace the ChangeId in the footer, not in the body

11 years agoAdd conflicts message before footer 30/9530/9
Stefan Lay [Wed, 9 Jan 2013 13:02:51 +0000 (14:02 +0100)]
Add conflicts message before footer

In case of a conflict during cherry-pick or revert the commit message
was amended after the footer. This made the footer invalid. Many users
do not understand that they have to edit the commit message in order to
make it valid again.

Change-Id: I7e7fae125129e2a0d8950510550acda766531835
Bug: 367416

11 years agoOnly replace the ChangeId in the footer, not in the body 54/9554/6
Stefan Lay [Wed, 9 Jan 2013 13:02:13 +0000 (14:02 +0100)]
Only replace the ChangeId in the footer, not in the body

Additionally expose methods to find the first footer line and to find
the position of the ChangeId footer in the commit message in order to
enable reuse of these methods introduced for the fix.

Change-Id: I87ecca009ca3bff1ca0de3c436ebd95736bf5a10
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
11 years agoMerge "Use correct method link in Javadoc"
Robin Rosenberg [Sat, 19 Jan 2013 16:23:39 +0000 (11:23 -0500)]
Merge "Use correct method link in Javadoc"

11 years agoMerge "Fix patch application WRT windows line endings."
Robin Rosenberg [Sat, 19 Jan 2013 16:20:27 +0000 (11:20 -0500)]
Merge "Fix patch application WRT windows line endings."

11 years agoFix patch application WRT windows line endings. 14/6314/5
Markus Duft [Tue, 12 Jun 2012 05:02:58 +0000 (07:02 +0200)]
Fix patch application WRT windows line endings.

Previously the result of an application would have been \r\r\n in the
case of windows line endings, as RawText does not touch the \r, and
ApplyCommand adds "\r\n" if this is the ending of the first line in the
target file. Only always adding \n should be ok, since \r\n would be the
result if the file and the patch include windows line endings.

Also add according test.

Change-Id: Ibd4c4948d81bd1c511ecf5fd6c906444930d236e

11 years agoMerge "Update DfsGarbageCollector to not read back a pack index."
Colby Ranger [Sat, 19 Jan 2013 00:38:08 +0000 (19:38 -0500)]
Merge "Update DfsGarbageCollector to not read back a pack index."

11 years agoUpdate DfsGarbageCollector to not read back a pack index. 76/9776/1
Colby Ranger [Sat, 19 Jan 2013 00:22:10 +0000 (16:22 -0800)]
Update DfsGarbageCollector to not read back a pack index.

Previously, the Dfs GC excluded objects from packs by passing a
previously written index to the PackWriter. Reading back a file on
Dfs is slow. Instead, allow the PackWriter to expose the objects
included in a pack and forward that to invocations of excludeObjects() .

Change-Id: I377cb4ab07f62cf790505e1eeb0b2efe81897c79

11 years agoMerge "Define a tree filter for user-visible changes between two indexes"
Robin Rosenberg [Sat, 19 Jan 2013 00:07:30 +0000 (19:07 -0500)]
Merge "Define a tree filter for user-visible changes between two indexes"

11 years agoMerge "Add additional FastForwardMode enums for different config contexts"
Shawn Pearce [Fri, 18 Jan 2013 16:28:07 +0000 (11:28 -0500)]
Merge "Add additional FastForwardMode enums for different config contexts"

11 years agoAdd additional FastForwardMode enums for different config contexts 43/9743/2
Tomasz Zarna [Thu, 17 Jan 2013 20:38:43 +0000 (21:38 +0100)]
Add additional FastForwardMode enums for different config contexts

FastForwardMode is represented by different strings depending on context
it is set or get from. E.g. FastForwardMode.FF_ONLY for
branch.<name>.mergeoptions is "--ff-only" but for merge.ff it is "only".

Change-Id: I39ae93578e4783de80ebf4af29ae23b3936eec47

11 years agoUse correct method link in Javadoc 52/9752/1
Dani Megert [Fri, 18 Jan 2013 08:17:53 +0000 (09:17 +0100)]
Use correct method link in Javadoc

Change-Id: I7fb5a44910a4738bbb14ad025cee7cbedbba2d07
Signed-off-by: Dani Megert <Daniel_Megert@ch.ibm.com>
11 years agoRename PackConstants to PackExt, a typed pack file extension. 46/9746/2
Colby Ranger [Thu, 17 Jan 2013 23:00:38 +0000 (15:00 -0800)]
Rename PackConstants to PackExt, a typed pack file extension.

PackConstants previously contained string values for the pack and pack
index extension. Change PackConstant to be PackExt, a typed wrapper
around the string pack file extension.

Change-Id: I86ac4db6da8f33aa42d6f37cfcc119e819444318

11 years agoDefine a tree filter for user-visible changes between two indexes 37/9437/5
Robin Rosenberg [Thu, 3 Jan 2013 23:24:48 +0000 (00:24 +0100)]
Define a tree filter for user-visible changes between two indexes

The primary purpose of the filter is to detect an index change that
could possibly lead to a change in what files are visible in the staging
view and decorations. Besides what TreeFilter.ANY_DIFF does for trees in
general, this filter also looks at the assume-valid (CE_VALID) flag to
see whether changes should be ignored or not.

Change-Id: I13e9ed4ae62dc3851204fba598239edce07ca977

11 years agoRemove getReverseIndexSize() from DfsPackDescription. 90/9690/2
Colby Ranger [Tue, 15 Jan 2013 22:56:48 +0000 (14:56 -0800)]
Remove getReverseIndexSize() from DfsPackDescription.

The method is used in only one location (DfsPackFile). Furthermore,
PackIndex already does an explicit computation of the size in
DfsPackFile. Simplify the DfsPackDescription by removing the method
and do the calculation similar to PackIndex.

Change-Id: I1391fdaaf7c2c3226d96ada1ae8647bcdff4794e

11 years agoUse file extension with DfsPackDescription get/set file size. 89/9689/2
Colby Ranger [Tue, 15 Jan 2013 22:24:30 +0000 (14:24 -0800)]
Use file extension with DfsPackDescription get/set file size.

Previously the size getters and setters had explicit methods for index
and pack. Update the api to be based on the file extension. This will
make it possible to support other extensions in the future, such as
the forthcoming bitmap extensions.

Change-Id: Iab9d4abe0af65b2fc71ad71ef1db0feb6b3b5c58

11 years agoFix concurrent creation of fan-out object directories 72/9372/2
Roberto Tyley [Tue, 25 Dec 2012 09:10:51 +0000 (09:10 +0000)]
Fix concurrent creation of fan-out object directories

If multiple threads attempted to insert loose objects into the same new
fan-out directory, the creation of that directory was subject to a race
condition that could lead to an unnecessary IOException being thrown -
because an inserter could not 'create' a directory that had just been
generated by a different thread. All we require is that the directory
does indeed *exist*, so not being able to _create_ it is not actually a
fatal problem. Setting 'skipExisting' to 'true' on the call to mkdir()
fixes the issue.

I found this issue as a real world occurrence while working on The BFG
Repo Cleaner (https://github.com/rtyley/bfg-repo-cleaner), a tool which
concurrently performs a lot of object creation.

In order to demonstrate the problem here I've added a small test case
which reliably reproduces the issue on the few different hardware
systems I've tried. The error thrown when the race-condition arises is
this:

java.io.IOException: Creating directory /home/roberto/repo.git/objects/e6 failed
at org.eclipse.jgit.util.FileUtils.mkdir(FileUtils.java:182)
at org.eclipse.jgit.storage.file.ObjectDirectory.insertUnpackedObject(ObjectDirectory.java:590)
at org.eclipse.jgit.storage.file.ObjectDirectoryInserter.insertOneObject(ObjectDirectoryInserter.java:113)
at org.eclipse.jgit.storage.file.ObjectDirectoryInserter.insert(ObjectDirectoryInserter.java:91)
at org.eclipse.jgit.lib.ObjectInserter.insert(ObjectInserter.java:329)

Change-Id: I88eac49bc600c56ba9ad290e6133d8a7113125ab

11 years agoImprove handling of checkout conflicts 73/5373/9
Markus Duft [Fri, 13 Jul 2012 06:25:25 +0000 (08:25 +0200)]
Improve handling of checkout conflicts

This converts a checkout conflict exception into a RebaseResult /
MergeResult containing the conflicting paths, which enables EGit (or
others) to handle the situation in a user-friendly way

Change-Id: I48d9bdcc1e98095576513a54a225a42409f301f3

11 years agoAccept '-' instead of space in enum config values 34/9634/2
Shawn Pearce [Fri, 11 Jan 2013 22:42:35 +0000 (14:42 -0800)]
Accept '-' instead of space in enum config values

This is necessary because some versions of JGit containing
the flawed c98abc9c0586c73ef7df4172644b7dd21c979e9d were
used in the wild and wrote bad configuration files. We now
must accept this value in addition to the preferred case.

Change-Id: I3ed5451735658df6381532499130e5186805024a

11 years agoRevert "Add additional FastForwardMode enums for different config contexts" 33/9633/1
Shawn Pearce [Fri, 11 Jan 2013 22:39:51 +0000 (14:39 -0800)]
Revert "Add additional FastForwardMode enums for different config contexts"

This reverts commit c98abc9c0586c73ef7df4172644b7dd21c979e9d.

Change-Id: I1d2a0de81eb17860ee36b6d3d3c00959b880fb85

11 years agoFix enum parsing from Config files 32/9632/1
Shawn Pearce [Fri, 11 Jan 2013 22:09:02 +0000 (14:09 -0800)]
Fix enum parsing from Config files

Change-Id: Ib0b86ceab070d46903de7b55f2fd441714855141

11 years agoMerge changes Ifc8fc3e5,I7c403b50
Colby Ranger [Thu, 10 Jan 2013 22:17:22 +0000 (17:17 -0500)]
Merge changes Ifc8fc3e5,I7c403b50

* changes:
  Remove packIndex field from FileObjDatabase openPack method.
  Update DfsObjDatabase API to open/write by pack extension.

11 years agoRemove packIndex field from FileObjDatabase openPack method. 02/9602/2
Colby Ranger [Thu, 10 Jan 2013 21:01:17 +0000 (13:01 -0800)]
Remove packIndex field from FileObjDatabase openPack method.

Previously, the FileObjDatabase required both the pack file path and
index file path to be passed to openPack().  A future change to add
a bitmap index will add a .bitmap file parallel to the pack file
(similar to the .idx file). Update the PackFile to support
automatically loading pack index extensions based on the pack file
path.

Change-Id: Ifc8fc3e57f4afa177ba5a88df87334dbfa799f01

11 years agoUpdate DfsObjDatabase API to open/write by pack extension. 93/9593/5
Colby Ranger [Thu, 10 Jan 2013 17:58:48 +0000 (09:58 -0800)]
Update DfsObjDatabase API to open/write by pack extension.

Previously, the DfsObjDatabase had a hardcoded getPackFile() and
getPackIndex() methods which opens a .pack and .idx file, respectively.
A future change to add a bitmap index will need to be stored in a
parallel .bitmap file. Update the DfsObjDatabase to support opening and
writing of files for any pack extension.

Change-Id: I7c403b501e242096a2d435f6865d6025a9f86108

11 years agoPeel tags during resolve of foo^ 96/9596/1
Dave Borowitz [Thu, 10 Jan 2013 18:53:54 +0000 (10:53 -0800)]
Peel tags during resolve of foo^

Once we start talking about parents of tags, we are in the commit
graph, so treat all objects from this point as commits. This fixes
spurious IncorrectObjectTypeExceptions on resolving expressions like
tag^^.

Change-Id: I29ece1fdb49c9c5b9ca415efcd1876bc72e97120

11 years agoFix NPE FS_Win32 when looking up git executable and home directory 49/9549/2
Tobias Pfeifer [Wed, 9 Jan 2013 11:04:13 +0000 (12:04 +0100)]
Fix NPE FS_Win32 when looking up git executable and home directory
avoiding redundant code

Bug: 397336
Change-Id: I60e1baa52e00c5ec3915b859bfc6a4572611cc89

11 years agoMerge "Revert "Speed up PathFilterGroup.include for large set of paths""
Robin Rosenberg [Wed, 9 Jan 2013 23:57:35 +0000 (18:57 -0500)]
Merge "Revert "Speed up PathFilterGroup.include for large set of paths""

11 years agoRevert "Speed up PathFilterGroup.include for large set of paths" 78/9578/1
Robin Rosenberg [Wed, 9 Jan 2013 23:47:16 +0000 (18:47 -0500)]
Revert "Speed up PathFilterGroup.include for large set of paths"

This reverts commit 576e5acdd054e2dcd8cde3fe4d822bc3609850c1

The comparator is broken.

Change-Id: Ic59110b154613f3ff4a215a6c1293a4c15cd3885

11 years agoDelete the iplog generator, cont'd 62/9562/1
Robin Rosenberg [Wed, 9 Jan 2013 18:33:32 +0000 (19:33 +0100)]
Delete the iplog generator, cont'd

Change-Id: I1f5e8dad3f61fde0d0573817d10e25a7384885d2

11 years agoDelete the iplog generator 56/9556/1
Matthias Sohn [Wed, 9 Jan 2013 12:56:32 +0000 (13:56 +0100)]
Delete the iplog generator

It stopped working when we moved to the Eclipse foundation's Gerrit
server since it doesn't use the Gerrit internal user store but LDAP.
Instead, since 2.0, we use the Eclipse foundation's automatic IP log
generator [1] to generate IP logs for releasing jgit and egit.

[1] http://www.eclipse.org/projects/ip_log_selector.php

Change-Id: I98dc65efb62909bc0258e6c680df0c93a57e9677
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Consider that some Java version on Linux only return integral timestamps"
Robin Rosenberg [Tue, 8 Jan 2013 22:50:01 +0000 (17:50 -0500)]
Merge "Consider that some Java version on Linux only return integral timestamps"

11 years agoMerge changes I3e9735c7,I76a16594
Robin Rosenberg [Tue, 8 Jan 2013 19:39:20 +0000 (14:39 -0500)]
Merge changes I3e9735c7,I76a16594

* changes:
  Speed up PathFilterGroup.include for large set of paths
  Speed up handling of "only" paths in the CommitCommand

11 years agoReturn info about config subsection when trying to get an invalid enum 33/9133/2
Tomasz Zarna [Mon, 10 Dec 2012 10:20:06 +0000 (11:20 +0100)]
Return info about config subsection when trying to get an invalid enum

Change-Id: Id4a72a68bdbd485619f4801683d38ad98f9841a2

11 years agoMerge "Add additional FastForwardMode enums for different config contexts"
Robin Rosenberg [Tue, 8 Jan 2013 11:25:27 +0000 (06:25 -0500)]
Merge "Add additional FastForwardMode enums for different config contexts"

11 years agoAdd additional FastForwardMode enums for different config contexts 91/8991/5
Tomasz Zarna [Fri, 7 Dec 2012 21:45:01 +0000 (22:45 +0100)]
Add additional FastForwardMode enums for different config contexts

FastForwardMode should be represented by different enums depending on
context it is set or get from. E.g. FastForwardMode.FF_ONLY for
branch.<name>.mergeoptions is "--ff-only" but for merge.ff it is "only".

Change-Id: I3ecc16d48e715b81320b73ffae4caf3558f965f2

11 years agoSpeed up PathFilterGroup.include for large set of paths 11/9411/5
Robin Rosenberg [Tue, 1 Jan 2013 14:06:07 +0000 (15:06 +0100)]
Speed up PathFilterGroup.include for large set of paths

This requires that we internally sort all paths so content of
directories follow the directory immediately.

Bug: 397185
Change-Id: I3e9735c7bdd99437929da8f9c9d4960a1273054b

11 years agoSpeed up handling of "only" paths in the CommitCommand 08/9408/3
Robin Rosenberg [Mon, 31 Dec 2012 18:17:19 +0000 (19:17 +0100)]
Speed up handling of "only" paths in the CommitCommand

Use binary search to reduce the number of lookups for very large number
of paths.

Change-Id: I76a16594b756bffd95298897414485a9cd637819

11 years agopgm: Attempt to detect a broken pipe and exit silently 07/9407/2
Robin Rosenberg [Sun, 30 Dec 2012 19:57:27 +0000 (20:57 +0100)]
pgm: Attempt to detect a broken pipe and exit silently

When piping output to another program, the other pipe may exit
before we are done. An example is "jgit log|head". The result is
that errno get set to EPIPE. Unfortunately Java does not have
specific exception for this so we have to look at the exception
message and hope that the number of variants are small.

The detection here seem to work on Windows, Linux and OS X and it
seems the message is usually not localized.

Change-Id: Id6968ea7a53ae27ba5496303f1a479e41e41fdcc

11 years agoMerge "Do not install unnecessary Orbit bundles"
Matthias Sohn [Sat, 5 Jan 2013 17:39:39 +0000 (12:39 -0500)]
Merge "Do not install unnecessary Orbit bundles"

11 years agoDo not install unnecessary Orbit bundles 45/9445/2
Matthias Sohn [Fri, 4 Jan 2013 00:40:29 +0000 (01:40 +0100)]
Do not install unnecessary Orbit bundles

The org.eclipse.jgit.orbit.feature introduced recently in order to
install 3rd party Orbit dependencies is a too coarse grained approach
and has the effect to install some dependencies only needed for
org.eclipse.jgit.pgm when installing org.eclipse.jgit.feature.

Hence include the required 3rd party bundles into the respective jgit
features directly in order to avoid this problem.

Bug: 397356
Change-Id: I3a4a07de42808e787515a6865875d9513542d3f8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoConsider that some Java version on Linux only return integral timestamps 77/9477/2
Robin Rosenberg [Sat, 5 Jan 2013 00:21:07 +0000 (01:21 +0100)]
Consider that some Java version on Linux only return integral timestamps

This logic is similar to what we do on Windows, but in this case it's
Java that truncates the timestamps, not Git.

Bug: 395410
Change-Id: Ie55dcb9fa583f5c3dd10d7a1b582e5b04b45858d

11 years agoIgnore removed files with an assume-valid index entry 12/9412/2
Robin Rosenberg [Tue, 1 Jan 2013 14:50:15 +0000 (15:50 +0100)]
Ignore removed files with an assume-valid index entry

Bug: 347067
Change-Id: I5472e69dc77e26b5f248a4a04295775cf5051215
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
11 years agoMerge "Revert "Stop PathFilter after walking all matching paths""
Robin Rosenberg [Tue, 1 Jan 2013 20:58:04 +0000 (15:58 -0500)]
Merge "Revert "Stop PathFilter after walking all matching paths""

11 years agoRevert "Stop PathFilter after walking all matching paths" 13/9413/1
Shawn Pearce [Tue, 1 Jan 2013 17:25:26 +0000 (12:25 -0500)]
Revert "Stop PathFilter after walking all matching paths"

This reverts commit 75eb6a147ffa8089e48d409f0215a16c755305e7.
Applications that want a PathFilter to abort the walk early should be
using PathFilterGroup. When a PathFilterGroup is created with exactly
one path its implementation is the same that 75eb6 tried to perform,
but has been long documented as having the behavior of breaking a
higher level OR filter graph node.

Change-Id: I6c85d75c474784471c32e866eef3402b9f193c08

11 years agoUpdate the revert command and things relating to revert 54/8354/6
Robin Rosenberg [Tue, 23 Oct 2012 22:48:31 +0000 (00:48 +0200)]
Update the revert command and things relating to revert

Cherry-pick has been fixed, but even though revert does
basically the same thing, the fixes were not carried over here.

- Recognize the revert-states, analogous to the cherry picking states
- Make reset handle a revert-in-progress
- Update REVERT_HEAD and MERGE_MSG when revert fails due to conflicts
- Clear revert state on commit and reset
- Format the message similarily to how cherry-pick does. This is
  not exactly how C Git does it.

The interface is still not the same as for cherry-picking.

Change-Id: I8ea956fcbc9526d62a2365360feea23a9280eba3
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
11 years agoStop PathFilter after walking all matching paths 88/9388/1
Dave Borowitz [Thu, 27 Dec 2012 17:29:44 +0000 (09:29 -0800)]
Stop PathFilter after walking all matching paths

After the current path of the TreeWalk is no longer a prefix of the
PathFilter's path, there can be no more matching entries, but TreeWalk
will happily keep walking the rest of a (potentially very large and
recursive) tree unless StopWalkException is thrown. So, throw
StopWalkException from PathFilter.include() at the earliest
opportunity.

Change-Id: If6c4f395a3d5ed5b71bf68de23be9f2b0620e7f1

11 years agoDo not enforce DeltaWindow maxMemory when zero. 87/9387/1
Colby Ranger [Thu, 27 Dec 2012 19:21:20 +0000 (11:21 -0800)]
Do not enforce DeltaWindow maxMemory when zero.

The maxMemory for a DeltaWindow can be optionally disabled when it is
less than or equal to zero. Respect this configuration when enforcing
the limits on object load.

Change-Id: Ic0f4ffcabf82105f8e690bd0eb5e6be485a313b3

11 years agoMerge "Enforce max memory for DeltaWindow."
Colby Ranger [Thu, 27 Dec 2012 17:33:13 +0000 (12:33 -0500)]
Merge "Enforce max memory for DeltaWindow."

11 years agoEnforce max memory for DeltaWindow. 85/9385/3
Colby Ranger [Thu, 27 Dec 2012 16:48:39 +0000 (08:48 -0800)]
Enforce max memory for DeltaWindow.

Previously, memory limits were enforced at the start of each iteration
of the delta search, based on objects that were currently loaded in
memory. However, new objects added to the window may be expanded in a
future iteration of the search and thus were not accounted for correctly
at the start of the search. To fix this, memory limits are now enforced
before each object is loaded.

Change-Id: I898ab43e7bf5ee7189831f3a68bb9385ae694b8f

11 years agoMake jgit diff obey core.autocrlf 94/7294/3
Robin Rosenberg [Sun, 19 Aug 2012 18:14:45 +0000 (20:14 +0200)]
Make jgit diff obey core.autocrlf

Change-Id: I0a756943d95ee20f189c154b27cd2972a116f550

11 years agoHide deprecation warnings in some test classes 60/9260/4
Robin Rosenberg [Sat, 15 Dec 2012 11:01:25 +0000 (12:01 +0100)]
Hide deprecation warnings in some test classes

These test classes heavily rely on Tree and associated classes. They
are convenient for building test cases and hence not yet replaced, but
there is a deprecation warning at about every line, which is not helpful.

Change-Id: Ia7cc8f3bb980dc03055b94748b6c7529a82ea5a5

11 years agoDeclare essentially static methods as static 58/9258/4
Robin Rosenberg [Sat, 15 Dec 2012 10:57:04 +0000 (11:57 +0100)]
Declare essentially static methods as static

Change-Id: I83ca25fb569c0dbc36eb374d5437fcf2b65a6f68

11 years agoAdd type argumente to some raw reclaration 56/9256/3
Robin Rosenberg [Sat, 15 Dec 2012 10:41:32 +0000 (11:41 +0100)]
Add type argumente to some raw reclaration

Change-Id: Ief195fb5c55f75172f0428fdac8c8874292ae566

11 years agoDo not perform character translation on copies in patches 80/8880/2
Robin Rosenberg [Tue, 27 Nov 2012 07:51:31 +0000 (08:51 +0100)]
Do not perform character translation on copies in patches

Translation is unnecessary and risks damaging the file. Also
ensure that we close the file if an I/O error occurs.

Change-Id: Ieae6eb941fdeaa61f2611f4cd14dd39117aa12f9

11 years agoMark non-externalizable strings as such 51/8851/4
Robin Rosenberg [Sun, 25 Nov 2012 16:17:20 +0000 (17:17 +0100)]
Mark non-externalizable strings as such

A few classes such as Constanrs are marked with @SuppressWarnings, as are
toString() methods with many liternal, but otherwise $NLS-n$ is used for
string containing text that should not be translated. A few literals may
fall into the gray zone, but mostly I've tried to only tag the obvious
ones.

Change-Id: I22e50a77e2bf9e0b842a66bdf674e8fa1692f590

11 years agoAdd org.eclipse.jgit.pgm.Reset to commands catalog 66/9366/1
Tomasz Zarna [Sat, 22 Dec 2012 12:01:22 +0000 (13:01 +0100)]
Add org.eclipse.jgit.pgm.Reset to commands catalog

Change-Id: I7acfd051a07be889b27cfcfc1f396d86a9f86ab2
Signed-off-by: Tomasz Zarna <tzarna@gmail.com>
11 years agoPrepare 2.3.0 builds 43/9343/2
Matthias Sohn [Thu, 20 Dec 2012 23:34:13 +0000 (00:34 +0100)]
Prepare 2.3.0 builds

Change-Id: I0ca539e8cfe444f96c64dc56d1f0ef33b66e0cff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge branch 'stable-2.2' 42/9342/1
Matthias Sohn [Thu, 20 Dec 2012 23:33:06 +0000 (00:33 +0100)]
Merge branch 'stable-2.2'

* stable-2.2:
  Prepare post 2.2.0.201212191850-r builds
  JGit v2.2.0.201212191850-r

Change-Id: Iebe7c45eacb8abee21d1900e27143ccaa2724e28
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare post 2.2.0.201212191850-r builds 41/9341/1 stable-2.2
Matthias Sohn [Thu, 20 Dec 2012 23:30:45 +0000 (00:30 +0100)]
Prepare post 2.2.0.201212191850-r builds

Change-Id: I1a0fe51c71551fcfc98f5dd435eb283fd661b77a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v2.2.0.201212191850-r 17/9317/1 v2.2.0.201212191850-r
Matthias Sohn [Wed, 19 Dec 2012 23:59:41 +0000 (00:59 +0100)]
JGit v2.2.0.201212191850-r

Change-Id: Idc49f17d03886b6a1e61a94ff81e32625c8675d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge remote-tracking branch 'gerrit/stable-2.2' 62/9262/1
Robin Rosenberg [Sun, 16 Dec 2012 12:39:10 +0000 (13:39 +0100)]
Merge remote-tracking branch 'gerrit/stable-2.2'

* gerrit/stable-2.2:
  Ensure that jgit p2 repository is self-contained
  Fix hidden field warning
  Fix empty control block warnings

Change-Id: Ifa0751be7db9401081a1a5c28a0102a2d0c692f9

11 years agoEnsure that jgit p2 repository is self-contained 37/9237/4
Matthias Sohn [Sat, 29 Sep 2012 13:43:22 +0000 (15:43 +0200)]
Ensure that jgit p2 repository is self-contained

Add a new feature for the 3rd party dependencies jgit needs and include
this in org.eclipse.jgit.feature. This ensures that the jgit p2
repository is self-contained and downstream consumers don't need to find
the dependencies elsewhere. We don't add the jetty dependencies needed
to install the test feature org.eclipse.jgit.junit since this is only
used by egit tests.

Change-Id: I60425c746cd50f1875ef8597a8bbefb598b8c982
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Fix hidden field warning" into stable-2.2
Robin Rosenberg [Sat, 15 Dec 2012 13:10:09 +0000 (08:10 -0500)]
Merge "Fix hidden field warning" into stable-2.2

11 years agoMerge "Fix empty control block warnings" into stable-2.2
Robin Rosenberg [Sat, 15 Dec 2012 13:09:14 +0000 (08:09 -0500)]
Merge "Fix empty control block warnings" into stable-2.2

11 years agoMerge branch 'stable-2.2' 55/9255/1
Robin Rosenberg [Sat, 15 Dec 2012 10:26:13 +0000 (11:26 +0100)]
Merge branch 'stable-2.2'

* stable-2.2:
  DirCacheIterator: Fix reset() and back()
  Cleanup unused import and Java 6 syntax in Archive

Change-Id: Icc59b28a4066c4781ea8d6270dfe20eb63b4185e

11 years agoDirCacheIterator: Fix reset() and back() 52/9252/2
Robin Rosenberg [Fri, 14 Dec 2012 23:30:42 +0000 (00:30 +0100)]
DirCacheIterator: Fix reset() and back()

reset() was broken and probably only worked when the position was
at the beginning. More serious was that back() sometimes descended
into the tree rather than skipping backward at the same level. Sometimes
this would result in false conflicts, but one could suspect silent
errors too. back() is called by the NamingConflictTreeWalk when looking
for directory/file conflicts.

Also added toString to DirCacheTree to simplify debugging.

Bug: 396127
Change-Id: Iaa1b4e20e623d84c2e5ac26748f42e991080dbcd

11 years agoFix hidden field warning 77/9177/1
Matthias Sohn [Wed, 12 Dec 2012 07:32:11 +0000 (08:32 +0100)]
Fix hidden field warning

Change-Id: Ic52527c32f8167db3c7bb7fa0297c86fee21da27
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix empty control block warnings 76/9176/1
Matthias Sohn [Wed, 12 Dec 2012 07:31:45 +0000 (08:31 +0100)]
Fix empty control block warnings

Change-Id: I7c546fa89f5e1933cff6648b2e03e07db61273e8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoCleanup unused import and Java 6 syntax in Archive 54/9154/2
Robin Rosenberg [Thu, 6 Dec 2012 23:25:57 +0000 (00:25 +0100)]
Cleanup unused import and Java 6 syntax in Archive

@Override for implementation of interface is Java 6. JGit's execution
environment is still Java 5.

Change-Id: I48d10b3bf81a60938da86e026053b2f3d5e24ad3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoDisable response compression on /git-receive-pack URLs 11/9111/1
Shawn Pearce [Fri, 7 Dec 2012 20:19:13 +0000 (12:19 -0800)]
Disable response compression on /git-receive-pack URLs

Compressing the response with gzip causes the stream to delay
flushing until gzip has seen the entire response message, or buffers
fill up and the compressed data has to be sent. This hides the
resolving progress monitor from the client, as well as any other
progress messages the server might be trying to send.

Disable compression in receive, matching what /git-upload-pack has.

Change-Id: Ic8d8abe1f43c3f540d1ee7c43a8947a555307d94

11 years agoMerge "archive: Add tar support"
Shawn Pearce [Thu, 6 Dec 2012 01:13:14 +0000 (20:13 -0500)]
Merge "archive: Add tar support"

11 years agoMerge "archive: Add --format option that switches between formats"
Shawn Pearce [Thu, 6 Dec 2012 01:11:25 +0000 (20:11 -0500)]
Merge "archive: Add --format option that switches between formats"

11 years agoMerge "archive: Record executable and symlink bits"
Shawn Pearce [Thu, 6 Dec 2012 01:10:02 +0000 (20:10 -0500)]
Merge "archive: Record executable and symlink bits"

11 years ago[findBugs] Don't pass null for non-null parameter in RebaseCommand 16/9016/2
Matthias Sohn [Mon, 3 Dec 2012 23:30:18 +0000 (00:30 +0100)]
[findBugs] Don't pass null for non-null parameter in RebaseCommand

Change-Id: Iee4d50aa9c6b75f9906d2c51a940ddc90a944192

11 years agoarchive: Add tar support 18/9018/3
Jonathan Nieder [Tue, 4 Dec 2012 00:08:04 +0000 (16:08 -0800)]
archive: Add tar support

Unlike ZIP files, tar files do not treat symlinks as ordinary files
with a different mode, so tar support involves a little more code than
would be ideal.

Change-Id: Ica2568f4a0e443bf4b955ef0c029bc8eec62d369

11 years agoarchive: Add --format option that switches between formats 17/9017/3
Jonathan Nieder [Tue, 4 Dec 2012 00:06:48 +0000 (16:06 -0800)]
archive: Add --format option that switches between formats

Prepare for .tar support.

Change-Id: Ieb07702da1a54b41ae764fbb425f70826907b593
Improved-by: Shawn O. Pearce <spearce@spearce.org>
11 years agoarchive: Record executable and symlink bits 08/9008/3
Jonathan Nieder [Mon, 3 Dec 2012 18:41:25 +0000 (10:41 -0800)]
archive: Record executable and symlink bits

Setting the mode for a zip entry is now as simple as
"entry.setUnixMode(mode)", so do that.

The test checks using the system's "zipinfo" command (from InfoZIP)
that the mode has been recorded correctly on systems that happen to
have a "zipinfo" command, using org.junit.Assume to distinguish them.

Change-Id: I4236c102fd76f18d01b2dc926eeb9b9fa11a61b7