Commit Graph

2460 Commits

Author SHA1 Message Date
Robin Rosenberg 0421481978 Merge "Consider that some Java version on Linux only return integral timestamps" 2013-01-08 17:50:01 -05:00
Robin Rosenberg c5c683e7e9 Merge changes I3e9735c7,I76a16594
* changes:
  Speed up PathFilterGroup.include for large set of paths
  Speed up handling of "only" paths in the CommitCommand
2013-01-08 14:39:20 -05:00
Tomasz Zarna 928286ad8f Return info about config subsection when trying to get an invalid enum
Change-Id: Id4a72a68bdbd485619f4801683d38ad98f9841a2
2013-01-08 06:26:36 -05:00
Robin Rosenberg 3328f45dde Merge "Add additional FastForwardMode enums for different config contexts" 2013-01-08 06:25:27 -05:00
Tomasz Zarna c98abc9c05 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
2013-01-06 19:12:10 -05:00
Robin Rosenberg 576e5acdd0 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
2013-01-07 01:08:01 +01:00
Robin Rosenberg 549034500a 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
2013-01-07 01:08:01 +01:00
Robin Rosenberg 9e36b173a5 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
2013-01-07 01:05:10 +01:00
Matthias Sohn c2d1183e39 Merge "Do not install unnecessary Orbit bundles" 2013-01-05 12:39:39 -05:00
Matthias Sohn 00739e6f70 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>
2013-01-05 18:30:08 +01:00
Robin Rosenberg b7d11eace6 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
2013-01-05 01:23:23 +01:00
Robin Rosenberg 5c49b93191 Ignore removed files with an assume-valid index entry
Bug: 347067
Change-Id: I5472e69dc77e26b5f248a4a04295775cf5051215
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2013-01-03 19:02:59 -06:00
Robin Rosenberg c8c258169f Merge "Revert "Stop PathFilter after walking all matching paths"" 2013-01-01 15:58:04 -05:00
Shawn Pearce 0b6387fe7c Revert "Stop PathFilter after walking all matching paths"
This reverts commit 75eb6a147f.
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
2013-01-01 12:25:26 -05:00
Robin Rosenberg 315f1cfa5c 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>
2012-12-28 16:44:46 -06:00
Dave Borowitz 75eb6a147f 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
2012-12-27 12:24:50 -08:00
Colby Ranger 154e3c886b 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
2012-12-27 11:22:35 -08:00
Colby Ranger 5a3d35e9e2 Merge "Enforce max memory for DeltaWindow." 2012-12-27 12:33:13 -05:00
Colby Ranger 51beee5568 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
2012-12-27 09:23:30 -08:00
Robin Rosenberg 7314b6c2c0 Make jgit diff obey core.autocrlf
Change-Id: I0a756943d95ee20f189c154b27cd2972a116f550
2012-12-27 12:22:14 -05:00
Robin Rosenberg f71944ec76 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
2012-12-27 12:09:01 -05:00
Robin Rosenberg a57dd1c164 Declare essentially static methods as static
Change-Id: I83ca25fb569c0dbc36eb374d5437fcf2b65a6f68
2012-12-27 12:08:06 -05:00
Robin Rosenberg 04bc9b3ddc Add type argumente to some raw reclaration
Change-Id: Ief195fb5c55f75172f0428fdac8c8874292ae566
2012-12-27 11:57:34 -05:00
Robin Rosenberg 92893d1f92 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
2012-12-27 17:29:13 +01:00
Robin Rosenberg c310fa0c80 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
2012-12-27 16:57:38 +01:00
Tomasz Zarna 03d50dc50b Add org.eclipse.jgit.pgm.Reset to commands catalog
Change-Id: I7acfd051a07be889b27cfcfc1f396d86a9f86ab2
Signed-off-by: Tomasz Zarna <tzarna@gmail.com>
2012-12-22 13:01:22 +01:00
Matthias Sohn 706f8eb9fc Prepare 2.3.0 builds
Change-Id: I0ca539e8cfe444f96c64dc56d1f0ef33b66e0cff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-21 00:48:45 +01:00
Matthias Sohn 60035eb249 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>
2012-12-21 00:36:24 +01:00
Matthias Sohn 2d78a8da97 Prepare post 2.2.0.201212191850-r builds
Change-Id: I1a0fe51c71551fcfc98f5dd435eb283fd661b77a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-21 00:31:26 +01:00
Matthias Sohn aa357c2a9f JGit v2.2.0.201212191850-r
Change-Id: Idc49f17d03886b6a1e61a94ff81e32625c8675d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-20 00:59:41 +01:00
Robin Rosenberg f4e8964e1f 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
2012-12-16 13:39:18 +01:00
Matthias Sohn 903ba8b8fd 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>
2012-12-16 00:58:05 +01:00
Robin Rosenberg 3f7909b6cb Merge "Fix hidden field warning" into stable-2.2 2012-12-15 08:10:09 -05:00
Robin Rosenberg 3154f3c5bb Merge "Fix empty control block warnings" into stable-2.2 2012-12-15 08:09:14 -05:00
Robin Rosenberg fbdf76d1cc 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
2012-12-15 11:26:55 +01:00
Robin Rosenberg af54f16635 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
2012-12-15 11:00:55 +01:00
Matthias Sohn bf0dc41362 Fix hidden field warning
Change-Id: Ic52527c32f8167db3c7bb7fa0297c86fee21da27
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-12 08:32:33 +01:00
Matthias Sohn 7b1d7ac90e Fix empty control block warnings
Change-Id: I7c546fa89f5e1933cff6648b2e03e07db61273e8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-12 08:31:45 +01:00
Robin Rosenberg 138a2b06c8 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>
2012-12-12 08:30:17 +01:00
Shawn Pearce 20e3779e10 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
2012-12-07 12:28:36 -08:00
Shawn Pearce 76830dff4c Merge "archive: Add tar support" 2012-12-05 20:13:14 -05:00
Shawn Pearce c9a8844586 Merge "archive: Add --format option that switches between formats" 2012-12-05 20:11:25 -05:00
Shawn Pearce 7096f6f8ba Merge "archive: Record executable and symlink bits" 2012-12-05 20:10:02 -05:00
Matthias Sohn 8d062dec0c [findBugs] Don't pass null for non-null parameter in RebaseCommand
Change-Id: Iee4d50aa9c6b75f9906d2c51a940ddc90a944192
2012-12-05 18:16:57 -05:00
Jonathan Nieder 78009782cd 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
2012-12-04 15:37:42 -08:00
Jonathan Nieder 345ab401ce archive: Add --format option that switches between formats
Prepare for .tar support.

Change-Id: Ieb07702da1a54b41ae764fbb425f70826907b593
Improved-by: Shawn O. Pearce <spearce@spearce.org>
2012-12-04 15:36:32 -08:00
Jonathan Nieder 7123cbf470 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
2012-12-04 15:34:07 -08:00
Shawn Pearce 72ee3280e0 Merge "[RFC] archive: Switch to commons-compress as ZIP archiver" 2012-12-04 18:28:20 -05:00
Shawn Pearce e9a1df6c56 Merge "Commit message may not necessarily be in UTF-8" 2012-12-04 10:00:30 -05:00
Colby Ranger b9e485661d Fix DeltaWindow.clear() to release loaded buffer bytes.
It is possible for the buffer to be set but not the index. It
ocurrs when an exception occurs during creating an index, but
after the buffer is loaded. Furthermore, the cleared DeltaWindowEntry
should have been ent and not res.

Change-Id: I2e0d79540316635bf7aa43efd225e4eb38230844
2012-12-03 12:46:53 -08:00