]> source.dussan.org Git - jgit.git/log
jgit.git
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

11 years agoMerge "[RFC] archive: Switch to commons-compress as ZIP archiver"
Shawn Pearce [Tue, 4 Dec 2012 23:28:20 +0000 (18:28 -0500)]
Merge "[RFC] archive: Switch to commons-compress as ZIP archiver"

11 years agoMerge "Commit message may not necessarily be in UTF-8"
Shawn Pearce [Tue, 4 Dec 2012 15:00:30 +0000 (10:00 -0500)]
Merge "Commit message may not necessarily be in UTF-8"

11 years agoFix DeltaWindow.clear() to release loaded buffer bytes. 10/9010/2
Colby Ranger [Mon, 3 Dec 2012 20:23:14 +0000 (12:23 -0800)]
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

11 years ago[RFC] archive: Switch to commons-compress as ZIP archiver 07/9007/2
Jonathan Nieder [Mon, 3 Dec 2012 17:55:02 +0000 (09:55 -0800)]
[RFC] archive: Switch to commons-compress as ZIP archiver

The Apache Commons Compress library provides a similar interface to
java.util.zip with some features not found in java.util.zip, including
support for inclusion of metadata (file mode and symlink targets) and
support for multiple file formats (zip, .tar.xz, etc).

Use it, in preparation for making use of these features.  No
functional change intended yet.

A previous version of this patch used plexus-archiver.  That is a
heavier-weight dependency and offers a less convenient interface.

Thanks to James Moger and Chris Aniszczyk for advice.

Change-Id: Id01146950bb9c18dae0169311e3cde2c3bfa675e

11 years agoEnable reuse of FileTreeIterator and FileEntry for non subclasses 89/8989/2
Robin Stocker [Sat, 1 Dec 2012 22:51:09 +0000 (23:51 +0100)]
Enable reuse of FileTreeIterator and FileEntry for non subclasses

For EGit change I2c41d86b8b74c2a334433de1bbfed5b36af872bf,
ContainerTreeIterator also needs to create entries for File objects in
case of filtered resources. Instead of reimplementing FileEntry there,
make the constructor public so that it can be reused.

Also allow to pass a WorkingTreeIterator instead of a FileTreeIterator
in FileTreeIterator's constructor, which is enough and allows to pass
other subclasses.

Bug: 358901
Change-Id: Ie0f9c9434ef7d73a8d73d4fe46db4147ded1d267
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
11 years agoMerge "Support --cached in RmCommand"
Chris Aniszczyk [Mon, 3 Dec 2012 16:56:12 +0000 (11:56 -0500)]
Merge "Support --cached in RmCommand"

11 years agoSupport --cached in RmCommand 01/9001/2
Robin Stocker [Mon, 3 Dec 2012 13:59:39 +0000 (14:59 +0100)]
Support --cached in RmCommand

Also extend documentation and add examples.

Bug: 395599
Change-Id: Id1ddbc9da787472f82e58834092bc073224b262b
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
11 years agoAdd basic "jgit add" tests 28/8928/3
Jonathan Nieder [Thu, 29 Nov 2012 02:39:57 +0000 (18:39 -0800)]
Add basic "jgit add" tests

Change-Id: I056c2556c7db98bf57e2527dec11af7c3daf472a
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
11 years agoadd: Fix bad metaVar reference in <filepattern> help 27/8927/1
Jonathan Nieder [Thu, 29 Nov 2012 01:48:25 +0000 (17:48 -0800)]
add: Fix bad metaVar reference in <filepattern> help

Without this patch, "jgit add --help" throws two exceptions
(NoSuchFieldException: metavar_filepattern; MissingResourceException:
Can't find resource for bundle java.util.PropertyResourceBundle, key
metavar_filepattern) instead of printing a usage message, due to a
small typo and a missing declaration.

Change-Id: I4b848b3a8c7b1a49d8b9582809375daa4aca6b50

11 years agoCommit message may not necessarily be in UTF-8 78/8878/1
Robin Rosenberg [Tue, 27 Nov 2012 07:34:40 +0000 (08:34 +0100)]
Commit message may not necessarily be in UTF-8

Trying different encoding makes presentation nicer
to user.

Change-Id: I2d2c2a95d0b5cd709855d7a67cbc247478434d2f

12 years agoMerge "Do not warn about non-translated strings in the ant library"
Chris Aniszczyk [Sun, 25 Nov 2012 20:46:42 +0000 (15:46 -0500)]
Merge "Do not warn about non-translated strings in the ant library"

12 years agoMerge "Do not warn about non-translated strings in the iplog generator"
Chris Aniszczyk [Sun, 25 Nov 2012 20:46:31 +0000 (15:46 -0500)]
Merge "Do not warn about non-translated strings in the iplog generator"

12 years agoMerge "Do not warn about non-translated strings in the http library"
Chris Aniszczyk [Sun, 25 Nov 2012 20:46:16 +0000 (15:46 -0500)]
Merge "Do not warn about non-translated strings in the http library"

12 years agoAdd a case statement for fast-forward merge 53/8853/1
Robin Rosenberg [Sun, 25 Nov 2012 20:11:28 +0000 (21:11 +0100)]
Add a case statement for fast-forward merge

This case was ommitted. Treat the same as a non-fastworwad
merge.

Change-Id: Ia81e2430dfe04c3ce9b6e2f8fb4b6c646293a174

12 years agoDo not warn about non-translated strings in the ant library 50/8850/1
Robin Rosenberg [Sat, 24 Nov 2012 11:24:27 +0000 (12:24 +0100)]
Do not warn about non-translated strings in the ant library

Ant tasks are generally not translated, hence don't warn about
untranslated strings

Change-Id: I60920ccdaf3c0139979bb4ef19eb42036bb7e07f

12 years agoDo not warn about non-translated strings in the iplog generator 49/8849/1
Robin Rosenberg [Sat, 24 Nov 2012 11:22:07 +0000 (12:22 +0100)]
Do not warn about non-translated strings in the iplog generator

This module is used by very few people so translation is not a priority
and hence we need no warnings about untranslated strings.

Change-Id: I11be2e9903583d1a3dade7bf3d5eb77a30152b7c

12 years agoDo not warn about non-translated strings in the http library 48/8848/1
Robin Rosenberg [Sun, 25 Nov 2012 16:19:06 +0000 (17:19 +0100)]
Do not warn about non-translated strings in the http library

The strings here are for machine-to-machine communications.

Change-Id: Ia0d19fce3d9843d18d329d9bc5b10d62c4125db8

12 years agoRevWalk support for shallow clones 45/8345/11
Marc Strapetz [Mon, 29 Oct 2012 15:34:33 +0000 (16:34 +0100)]
RevWalk support for shallow clones

StartGenerator now processes .git/shallow to have the
RevWalk stop for shallow commits.

See RevWalkShallowTest for tests.

Bug: 394543
CQ: 6908
Change-Id: Ia5af1dab3fe9c7888f44eeecab1e1bcf2e8e48fe
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd support for rebase interactive 'edit' command 81/7881/5
Dariusz Luksza [Wed, 3 Oct 2012 08:01:54 +0000 (10:01 +0200)]
Add support for rebase interactive 'edit' command

The 'edit' command allows you to change arbitrary commit
content and the message of any commit in the repository.

Bug: 394577
Change-Id: I43a44782cdb10b29f13784fa75ab37fe5d4da01b
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd support for rebase interactive 'reword' command 79/7779/6
Dariusz Luksza [Wed, 3 Oct 2012 07:59:30 +0000 (09:59 +0200)]
Add support for rebase interactive 'reword' command

'reword' command is used to change commit message of any
commit in git history.

Bug: 394575
Change-Id: Ic974e76dfd923fd6f0cb8f07d1a6fbecd9abbf31
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd GarbageCollectCommand to porcelain API 14/7614/6
Matthias Sohn [Wed, 12 Sep 2012 22:33:52 +0000 (00:33 +0200)]
Add GarbageCollectCommand to porcelain API

Bug: 394544
Change-Id: I73faa55d860db64efc3412fee27386df47552a75
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoHave git-ls tree to accept path args like git-ls-tree 34/1334/4
Ketan Padegaonkar [Sat, 31 Mar 2012 16:46:22 +0000 (18:46 +0200)]
Have git-ls tree to accept path args like git-ls-tree

Usage is:

jgit ls-tree [-r|--recursive] <tree-ish> [-- paths...]

Change-Id: I2e1c9c3cc8cddfa12ca4bfb9afc4df0492a9fce1
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd config constant for "mergeoptions" 53/8753/2
Tomasz Zarna [Sun, 18 Nov 2012 21:35:53 +0000 (22:35 +0100)]
Add config constant for "mergeoptions"

Bug: 336933
Change-Id: Idcc0fbc8a8143dd665e80e4d6f4a4adaeae287db
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd "jgit archive" tool that writes a tree as a ZIP file 33/8733/5
Jonathan Nieder [Fri, 16 Nov 2012 02:48:12 +0000 (18:48 -0800)]
Add "jgit archive" tool that writes a tree as a ZIP file

C Git's "git archive" command represents a tree object using a
standard archival format like tar, zip, or tgz, ready for consumption
by other, git-unaware users or tools.

Add a bare-bones analagous "jgit archive" command to show what is
possible, supporting only ZIP format for now.  It uses java.util.zip
which is not aware of the InfoZIP extensions for representing symlinks
and file permissions, so symlinks, executable files, and submodule
entries are represented as plain text files.

Making this functionality available from the library, improving
handling of special entries, and support for other output formats are
left for later patches.  Ultimately the intent is to offer a
TreeArchiveStream class for use by web frontends like Gitiles to offer
"download as zip/tgz/txz" links and use by, for example, code search
tools to get easy access to the content of git tree objects.

Test with "jgit archive my-favorite-tree >out.zip".

Change-Id: Ib590f173ceff3df4b58493cecccd6b9a1b355e3d

12 years agoAllow commandline tests to use raw output 46/8746/2
Jonathan Nieder [Fri, 16 Nov 2012 23:16:18 +0000 (15:16 -0800)]
Allow commandline tests to use raw output

Introduce a new CLIGitCommand.rawExecute() helper that behaves
just like execute() except that instead of processing its output
it returns it raw.

So now you can do

final byte[] expect = { 0, 1, 2, 3 };
final byte[] actual = CLIGitCommand.rawExecute(
"git show HEAD:goo.raw", db);
assertArrayEquals(expect, actual);

to test the output from "git show HEAD:goo.raw" without being
distracted by encoding issues.

Noticed while writing tests for a new "jgit archive" command that
writes its output in ZIP format.

Change-Id: I2fe6020a537975d0ccf414b7125d85d6cd86898c

12 years agoAdd support for pull with --rebase and --no-rebase 03/6003/4
Mikael Karlsson [Wed, 16 May 2012 16:34:38 +0000 (18:34 +0200)]
Add support for pull with --rebase and --no-rebase

Bug: 394501
Change-Id: I697e2fc82a46c03762111eb1de93e673a2643b4f
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoDeclare all thrown exceptions in Repository 20/8420/3
Dani Megert [Tue, 30 Oct 2012 14:55:14 +0000 (15:55 +0100)]
Declare all thrown exceptions in Repository

Bug 393155
Change-Id: If702f2e54b17e82890f016126ee7bde4bff4af1d
Signed-off-by: Dani Megert <Daniel_Megert@ch.ibm.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoImport non-java.* JRE packages 02/8502/2
Matthias Sohn [Sat, 3 Nov 2012 00:32:52 +0000 (01:32 +0100)]
Import non-java.* JRE packages

Otherwise loading javax.net.ssl.TrustManager fails if
osgi.compatibility.bootdelegation=false which became the Equinox default
since bug 344850 was fixed.

Bug: 392056
Change-Id: I464871723649095942dbf77da93890ac8ec39075
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdapt Status and CleanCommand to support cleaning directories 72/4972/17
Markus Duft [Fri, 13 Jul 2012 06:31:10 +0000 (08:31 +0200)]
Adapt Status and CleanCommand to support cleaning directories

This adds the possibility to:

 * retrieve untracked directories from the status
 * instruct the CleanCommand to clean those directories.
 * retrieve ignored paths from the status
 * instruct the CleanCommand to leave those ignored paths alone

Bug: 338717
Change-Id: Ibed0459005a5e306c010b9932f5b5fd107fb5448
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd reflog command to JGit CLI 94/8394/3
Tomasz Zarna [Sun, 4 Nov 2012 22:06:20 +0000 (23:06 +0100)]
Add reflog command to JGit CLI

Bug: 394497
Change-Id: Ib8bc1d9fd789d22fe5f10e03068a11cfdd3e46eb
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoCheckoutCommand: Support checking out ours and theirs 84/7884/5
Robin Stocker [Sat, 22 Sep 2012 23:57:20 +0000 (01:57 +0200)]
CheckoutCommand: Support checking out ours and theirs

The checkoutPaths body is split into two implementations, depending on
whether we are checking out the index or a branch. This improves
readability, as in the index case we now also need to have access to
DirCacheIterator.

Bug: 390147
Change-Id: I99fd599b25b2ace9bdd84535a56565286a3cb7f1
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoMake an exception for the formatting rules (turn off) for some files 08/8708/2
Robin Rosenberg [Wed, 14 Nov 2012 23:53:53 +0000 (00:53 +0100)]
Make an exception for the formatting rules (turn off) for some files

Our rule to enforce javodocs for public members gives us a problem
because there are some patterns where javadoc make little sense so we
make the comments as small as possible, which our formatting rules do
not like, so disable it for those source files.

Change-Id: I6e3edb1e650ed45428b89cf41e6151b6536bca8a
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoHarmonize the JDT settings within JGit 03/8703/3
Robin Rosenberg [Tue, 13 Nov 2012 01:31:54 +0000 (02:31 +0100)]
Harmonize the JDT settings within JGit

Note the the settings are slightly less restrictive for test bundles.
-Also cleanup a couple of malformed javadocs
-Update compiler warnings/errors to include default values from Juno
-We now flag diagnosed null dereference as error. We didn't do that
 earlier because of some false positives.

Change-Id: I58386d63164e65d3d8d1998da3390d99bdc7381a
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoDirCacheEditor: Apply PathEdit for each stage 82/7882/5
Robin Stocker [Sat, 22 Sep 2012 23:37:09 +0000 (01:37 +0200)]
DirCacheEditor: Apply PathEdit for each stage

This behavior was defined in the Javadoc of PathEdit, but not actually
implemented.

It's necessary when one wants to use a PathEdit to check out a specific
stage in apply.

Bug: 390147
Change-Id: Iaed5cf60c554fc17e6c4d188caf4f0231da920d0
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd missing @since tags to mark API added in 2.2 30/8730/2
Matthias Sohn [Fri, 16 Nov 2012 01:04:58 +0000 (02:04 +0100)]
Add missing @since tags to mark API added in 2.2

Change-Id: I458167739210214fa54c4b3d62fac5abc82f96f7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd support for --no-ff while merging 95/8395/6
Tomasz Zarna [Mon, 29 Oct 2012 15:21:59 +0000 (16:21 +0100)]
Add support for --no-ff while merging

Bug: 394432
Change-Id: I373128c0ba949f9b24248874f77f3d68b50ccfd1
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd a test for org.eclipse.jgit.pgm.Tag 32/8632/4
Tomasz Zarna [Sun, 11 Nov 2012 22:38:44 +0000 (23:38 +0100)]
Add a test for org.eclipse.jgit.pgm.Tag

The test checks if an error is thrown when trying to create the same tag
for the second time.

Change-Id: I4ed2f6c997587f0ea23bd26a32fb64a2d48a980e
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoDo not fail when checking out HEAD 12/8512/3
Tomasz Zarna [Sun, 4 Nov 2012 20:57:12 +0000 (21:57 +0100)]
Do not fail when checking out HEAD

Change-Id: I99f5467477ed53101121a5a5d8a0910c55758401
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoPrefix an abnormal CLI command termination with 'fatal:' 33/8633/2
Tomasz Zarna [Sun, 11 Nov 2012 22:43:38 +0000 (23:43 +0100)]
Prefix an abnormal CLI command termination with 'fatal:'

Change-Id: I3d257666c6fbed7b238c575808f73ec518e811b9
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoMerge "CommitCommand: Ensure unmerged paths are added correctly with setOnly"
Chris Aniszczyk [Thu, 15 Nov 2012 23:43:54 +0000 (18:43 -0500)]
Merge "CommitCommand: Ensure unmerged paths are added correctly with setOnly"

12 years agoMerge "Fix formatting in org.eclipse.jgit.pgm.CLIText"
Matthias Sohn [Wed, 14 Nov 2012 22:34:34 +0000 (17:34 -0500)]
Merge "Fix formatting in org.eclipse.jgit.pgm.CLIText"

12 years agodiff, log -p: do not use outs before it is initialized 96/8696/1
Jonathan Nieder [Wed, 14 Nov 2012 20:14:20 +0000 (12:14 -0800)]
diff, log -p: do not use outs before it is initialized

Since commit caa362f20df1 (Check for write errors in standard out and
exit with error, 2012-09-14), running "jgit diff" results in a
NullPointerException:

| $ jgit diff
| java.lang.NullPointerException
| at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
| at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
| at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:688)
| at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:630)
| at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:616)
| at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:600)
| at org.eclipse.jgit.pgm.Diff.run(Diff.java:211)
| at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:166)
| at org.eclipse.jgit.pgm.Main.execute(Main.java:200)
| at org.eclipse.jgit.pgm.Main.run(Main.java:120)
| at org.eclipse.jgit.pgm.Main.main(Main.java:94)

That patch replaced most uses of System.out with a wrapper, with
changes like the following:

 class Diff extends TextBuiltin {
private final DiffFormatter diffFmt = new DiffFormatter( //
- new BufferedOutputStream(System.out));
+ new BufferedOutputStream(outs));

outs is not set for TextBuiltin objects until init() has been run.
Moving the initialization to after the super.init() call gets
"jgit diff" and "jgit log -p" working well again.

Change-Id: I80fcf259c4fb733990bd16e52bcf94e66d820826

12 years agoCommitCommand: Ensure unmerged paths are added correctly with setOnly 23/8323/2
Robin Stocker [Sat, 20 Oct 2012 20:00:13 +0000 (22:00 +0200)]
CommitCommand: Ensure unmerged paths are added correctly with setOnly

With bug 391855, PathEdit will be changed to apply an edit for each
stage. With that, CommitCommand would no longer work correctly when
committing an unmerged path.

This changes it to use a DirCacheBuilder which allows us to correctly
replace the entries for the three stages with one, which is not possible
with PathEdit.

Bug: 391859
Change-Id: I6dc180aec7e2cbf8d1e91f50482c95bc420f79de

12 years agoFix formatting in org.eclipse.jgit.pgm.CLIText 34/8634/1
Tomasz Zarna [Sun, 11 Nov 2012 22:45:28 +0000 (23:45 +0100)]
Fix formatting in org.eclipse.jgit.pgm.CLIText

Change-Id: Ia87f28fa440cb354bf591713c8aadbe3969edbf1

12 years agoFix redundant null check warning in Repository 98/8598/1
Robin Stocker [Thu, 8 Nov 2012 13:17:13 +0000 (14:17 +0100)]
Fix redundant null check warning in Repository

rev is always null because of `if (rev != null) return ...` above.

Change-Id: I8168aefd344e0c4b0c68caea1a3daee66c07173b

12 years agoMerge "Add the an event and listener for a dfs PackIndex being loaded."
Colby Ranger [Fri, 2 Nov 2012 17:27:36 +0000 (13:27 -0400)]
Merge "Add the an event and listener for a dfs PackIndex being loaded."

12 years agoAdd the an event and listener for a dfs PackIndex being loaded. 90/8490/2
Colby Ranger [Fri, 2 Nov 2012 16:18:48 +0000 (09:18 -0700)]
Add the an event and listener for a dfs PackIndex being loaded.

The DfsPackFile will fire any static repository listeners on the event
just before the PackIndex is loaded.

Change-Id: Ie51098106bd5a1a32feae7d2dd068abf02b030ee

12 years agoAdd ReflogCommandTest#testAmendReflog 80/8480/3
Tomasz Zarna [Thu, 1 Nov 2012 23:36:55 +0000 (00:36 +0100)]
Add ReflogCommandTest#testAmendReflog

Add a test for reflog with an amend commit and add assertions for
branch comments

Change-Id: Ie44076ff1abf1f8954b85d8c74ac6cb41ab789cb
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoResetCommand: Use DirCacheBuilder in resetIndex 88/8388/2
Robin Stocker [Sun, 28 Oct 2012 14:57:43 +0000 (15:57 +0100)]
ResetCommand: Use DirCacheBuilder in resetIndex

With bug 391855, DirCacheEditor's PathEdit will be applied for each
stage. For an unmerged path, this would result in 3 equal entries for
the same path.

By using a DirCacheBuilder, the code is simpler and does not have the
above problem with unmerged paths.

Bug: 391860
Change-Id: I785deeaeb8474f8c7a7fbc9ef00d3131fac87e41
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoResetCommand: Correctly reset unmerged paths in resetIndexForPaths 87/8387/2
Robin Stocker [Sun, 28 Oct 2012 14:35:21 +0000 (15:35 +0100)]
ResetCommand: Correctly reset unmerged paths in resetIndexForPaths

The previous implementation used a PathEdit, which does not reset the
stage of the entry.

Bug: 391860
Change-Id: If26d3a35abfee85424ad69de724f06a28b6e9efb
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoMerge "Add isIndexLoaded() to DfsPackFile."
Shawn Pearce [Thu, 1 Nov 2012 17:07:23 +0000 (13:07 -0400)]
Merge "Add isIndexLoaded() to DfsPackFile."

12 years agoMerge "[blame] Don't pass null to PersonIdent constructor"
Shawn Pearce [Thu, 1 Nov 2012 16:48:23 +0000 (12:48 -0400)]
Merge "[blame] Don't pass null to PersonIdent constructor"