Commit Graph

2461 Commits

Author SHA1 Message Date
Robin Rosenberg 69123920dd Remove debug printouts from PathFilterGroupTest
Change-Id: I4767e53efafe48d447ebe399fb2f8617072950ea
2013-01-30 19:46:19 +01:00
Robin Rosenberg 878e78b307 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
2013-01-30 11:38:19 -05:00
Tobias Pfeifer 0d09b1cab7 Extract method to output the first header line of a git diff
In order to be able to determine the range of the first header line
(e.g. "diff --git a/file1 b/file2") in subclasses, the code that formats
the first header line is extracted.

Required by egit's change: Ia61398146c0336ab332234f24d341561292554db

Change-Id: I9dd5eb964ed8b6869745c3162159b7425ac2c44a
Signed-off-by: Tobias Pfeifer <to.pfeifer@sap.com>
2013-01-30 13:27:50 +01:00
Matthias Sohn 404de6563d Merge "Align execution environment with JRE on the classpath in jgit.ant.test" 2013-01-29 12:05:29 -05:00
Robin Rosenberg eb60932930 Fix Check for FF_ONLY merges again
Added more FF-mode tests

Change-Id: I33eed5737d9411cc1cf214da62ce719916a1b736
2013-01-29 08:05:00 +01:00
Robin Rosenberg 83032e9f66 Merge "Check for FF_ONLY merges correctly" 2013-01-28 19:02:18 -05:00
Robin Rosenberg ee413067fd Merge changes Ife0cc2da,If38507ef
* changes:
  Speed up PathFilterGroup for large sets of paths
  Add test case for PathFilterGroup
2013-01-28 19:00:00 -05:00
Robin Rosenberg 642ff2cd7d Check for FF_ONLY merges correctly
Bug: 398192
Change-Id: I1253c0ea0632185bbf9f77e32f13ba5842a6e18e
2013-01-29 00:48:56 +01:00
Tomasz Zarna 96dc4207ef Align execution environment with JRE on the classpath in jgit.ant.test
Change-Id: Ic11ddce81dbcc7d703742c7e86941d2f43668617
2013-01-28 21:00:34 +01:00
Matthias Sohn 33bc4f7c05 Merge changes I25204d9e,Ia10d76e9
* changes:
  Attempt to stabilize GCTest
  Attempt to stabilize FileTreeIterator test on Windows
2013-01-24 15:57:11 -05:00
Robin Rosenberg e522d95a51 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
2013-01-23 08:27:12 +01:00
Robin Rosenberg db34152794 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
2013-01-23 07:55:28 +01:00
Colby Ranger aa2db859ea Merge "Reduce memory held and speed up DfsGarbageCollector." 2013-01-22 18:55:36 -05:00
Colby Ranger 7fbd6588be 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
2013-01-22 15:25:15 -08:00
Robin Stocker 75ddf2a0f4 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>
2013-01-23 00:24:54 +01:00
Matthias Sohn 35d4749011 Add new committers
Change-Id: I5ef1edb8efc4668ef4731094ea6dbbcaf200195d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-01-23 00:03:20 +01:00
Matthias Sohn db5aa8d8b2 Update to jsch 0.1.46
Change-Id: Ib7eb1ff175e3f9763653b0b0432b8ddc6b1c8938
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-01-23 00:03:20 +01:00
Matthias Sohn 86759c23c2 Merge "Fix NPE FS_Win32 when looking up git executable and home directory avoiding redundant code" 2013-01-22 08:28:49 -05:00
Robin Rosenberg 522fc6a9c6 Speed up PathFilterGroup for large sets of paths
The ByteArraySet is a distorted copy of ObjectIdSubclassMap.

Bug: 397185
Change-Id: Ife0cc2da6cc46431be94a6b14f64f6adbe983afb
2013-01-21 15:54:56 +01:00
Robin Rosenberg 05180574a9 Add test case for PathFilterGroup
This is needed to prepare for optimization.

Bug: 397185
Change-Id: If38507ef8cc5a161353cc07bf7cd1922f54d1f8a
2013-01-21 02:32:33 +01:00
Robin Rosenberg 910a69d4c8 Merge "Improve handling of checkout conflicts" 2013-01-20 14:01:38 -05:00
Robin Rosenberg 9f7b97c90a Merge changes I7e7fae12,I87ecca00
* changes:
  Add conflicts message before footer
  Only replace the ChangeId in the footer, not in the body
2013-01-19 11:54:21 -05:00
Stefan Lay 215a74eceb 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
2013-01-19 11:38:33 -05:00
Stefan Lay 1ca7c581a3 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>
2013-01-19 17:37:09 +01:00
Robin Rosenberg 6a3c360984 Merge "Use correct method link in Javadoc" 2013-01-19 11:23:39 -05:00
Robin Rosenberg ab439eed6e Merge "Fix patch application WRT windows line endings." 2013-01-19 11:20:27 -05:00
Markus Duft 3d18f65af1 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
2013-01-19 13:29:02 +01:00
Colby Ranger 38b503601a Merge "Update DfsGarbageCollector to not read back a pack index." 2013-01-18 19:38:08 -05:00
Colby Ranger 7c58f6282a 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
2013-01-18 16:22:10 -08:00
Robin Rosenberg de390e1480 Merge "Define a tree filter for user-visible changes between two indexes" 2013-01-18 19:07:30 -05:00
Shawn Pearce 372b2c0ca6 Merge "Add additional FastForwardMode enums for different config contexts" 2013-01-18 11:28:07 -05:00
Tomasz Zarna 6a8da4c134 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
2013-01-18 12:04:17 +01:00
Dani Megert 5b13b579b3 Use correct method link in Javadoc
Change-Id: I7fb5a44910a4738bbb14ad025cee7cbedbba2d07
Signed-off-by: Dani Megert <Daniel_Megert@ch.ibm.com>
2013-01-18 09:17:53 +01:00
Colby Ranger 698705c754 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
2013-01-17 15:14:43 -08:00
Robin Rosenberg 5213f6e2e8 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
2013-01-15 19:13:46 -05:00
Colby Ranger 3f0176aea6 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
2013-01-15 15:12:55 -08:00
Colby Ranger 510a605546 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
2013-01-15 15:12:47 -08:00
Roberto Tyley 5dcc8693d7 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
2013-01-13 18:59:59 -05:00
Markus Duft baf7ca9cc0 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
2013-01-11 20:32:44 -05:00
Shawn Pearce 912ef3da19 Accept '-' instead of space in enum config values
This is necessary because some versions of JGit containing
the flawed c98abc9c05 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
2013-01-11 14:52:13 -08:00
Shawn Pearce 50eab4aa48 Revert "Add additional FastForwardMode enums for different config contexts"
This reverts commit c98abc9c05.

Change-Id: I1d2a0de81eb17860ee36b6d3d3c00959b880fb85
2013-01-11 14:39:51 -08:00
Shawn Pearce 5630686655 Fix enum parsing from Config files
Change-Id: Ib0b86ceab070d46903de7b55f2fd441714855141
2013-01-11 14:09:02 -08:00
Colby Ranger 8a63474518 Merge changes Ifc8fc3e5,I7c403b50
* changes:
  Remove packIndex field from FileObjDatabase openPack method.
  Update DfsObjDatabase API to open/write by pack extension.
2013-01-10 17:17:22 -05:00
Colby Ranger 82ecfb3e31 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
2013-01-10 14:02:28 -08:00
Colby Ranger 5d3c2b3def 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
2013-01-10 14:02:18 -08:00
Dave Borowitz 891a2d75e7 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
2013-01-10 10:56:37 -08:00
Tobias Pfeifer 8315439401 Fix NPE FS_Win32 when looking up git executable and home directory
avoiding redundant code

Bug: 397336
Change-Id: I60e1baa52e00c5ec3915b859bfc6a4572611cc89
2013-01-10 15:35:45 +01:00
Robin Rosenberg 4407423d29 Merge "Revert "Speed up PathFilterGroup.include for large set of paths"" 2013-01-09 18:57:35 -05:00
Robin Rosenberg bc07097ebe Revert "Speed up PathFilterGroup.include for large set of paths"
This reverts commit 576e5acdd0

The comparator is broken.

Change-Id: Ic59110b154613f3ff4a215a6c1293a4c15cd3885
2013-01-09 18:47:16 -05:00
Robin Rosenberg e74cfeb673 Delete the iplog generator, cont'd
Change-Id: I1f5e8dad3f61fde0d0573817d10e25a7384885d2
2013-01-09 19:33:32 +01:00