]> source.dussan.org Git - jgit.git/log
jgit.git
12 years agoRemove unused import introduced with 8f706db5 17/7917/1
Matthias Sohn [Tue, 25 Sep 2012 21:13:54 +0000 (23:13 +0200)]
Remove unused import introduced with 8f706db5

Also cleanup wildcards in import statements.

Change-Id: I28c1435ae7482de1209aeefc755a230ef5b8c15d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Provide a convenient read() in RepositoryTestCase"
Christian Halstrick [Tue, 25 Sep 2012 20:56:58 +0000 (16:56 -0400)]
Merge "Provide a convenient read() in RepositoryTestCase"

12 years agoMerge "Add the intended file to avoid breakage"
Christian Halstrick [Tue, 25 Sep 2012 20:41:56 +0000 (16:41 -0400)]
Merge "Add the intended file to avoid breakage"

12 years agoProvide a convenient read() in RepositoryTestCase 83/7883/2
Robin Stocker [Sat, 22 Sep 2012 23:45:23 +0000 (01:45 +0200)]
Provide a convenient read() in RepositoryTestCase

For reading a file by its repository-relative path, analogous to
writeTrashFile.

Change-Id: I112de0d57c2ee1bd425de6cbf561a57fea7147f0

12 years agoAdd the intended file to avoid breakage 10/7910/2
Robin Rosenberg [Mon, 24 Sep 2012 22:51:20 +0000 (00:51 +0200)]
Add the intended file to avoid breakage

This case breaks when the default is to disallow empty commits.

Change-Id: Ibc223092eefe9f4b21374717dee5a9399bf890f9

12 years agoMerge "Allow @ in branch names and tighten syntax checking"
Robin Rosenberg [Mon, 24 Sep 2012 18:36:57 +0000 (14:36 -0400)]
Merge "Allow @ in branch names and tighten syntax checking"

12 years agoMerge "FileBasedConfig supports UTF-8 byte order marker"
Robin Rosenberg [Mon, 24 Sep 2012 18:35:22 +0000 (14:35 -0400)]
Merge "FileBasedConfig supports UTF-8 byte order marker"

12 years agoMerge "Fix typo in AnyObjectId#abbreviate"
Robin Rosenberg [Mon, 24 Sep 2012 18:22:24 +0000 (14:22 -0400)]
Merge "Fix typo in AnyObjectId#abbreviate"

12 years agoMerge "Add toString for TrackingRefUpdate"
Robin Rosenberg [Mon, 24 Sep 2012 18:21:11 +0000 (14:21 -0400)]
Merge "Add toString for TrackingRefUpdate"

12 years agoFileBasedConfig supports UTF-8 byte order marker 30/7830/2
Marc Strapetz [Wed, 19 Sep 2012 14:57:50 +0000 (16:57 +0200)]
FileBasedConfig supports UTF-8 byte order marker

Change-Id: I1f5dc07182dbf6bba2a9f4807fdd25b475da4ead

12 years agoMerge "Refuse to checkout unmerged paths from index"
Christian Halstrick [Mon, 24 Sep 2012 09:08:36 +0000 (05:08 -0400)]
Merge "Refuse to checkout unmerged paths from index"

12 years agoFix typo in AnyObjectId#abbreviate 92/7892/1
Robin Stocker [Sun, 23 Sep 2012 22:34:33 +0000 (00:34 +0200)]
Fix typo in AnyObjectId#abbreviate

Change-Id: I5796dc81727a8e1923189e9490a55c4af6ad053e

12 years agoAdd toString for TrackingRefUpdate 91/7891/1
Robin Stocker [Sun, 23 Sep 2012 22:01:04 +0000 (00:01 +0200)]
Add toString for TrackingRefUpdate

Makes it much easier to debug the results of
OperationResult#getTrackingRefUpdates (which otherwise requires digging
into a TreeMap structure).

Change-Id: I90da5385ee47c441404728f252eb3a100c48ee1c

12 years agoComment an empty block which is ok 89/7889/1
Robin Rosenberg [Sat, 22 Sep 2012 22:53:29 +0000 (00:53 +0200)]
Comment an empty block which is ok

Change-Id: I552d4481e17a12b0bd707d5386f29026ae0856fb

12 years agoRemove unnecessary @SuppressWarnings 88/7888/1
Robin Rosenberg [Sat, 22 Sep 2012 14:50:27 +0000 (16:50 +0200)]
Remove unnecessary @SuppressWarnings

Change-Id: Ic7b8494713d59574ee8f064a5c1042b48aedf012

12 years agoRemove uses of TextBuiltin.out in favor of outw 87/7887/1
Robin Rosenberg [Sat, 22 Sep 2012 14:40:16 +0000 (16:40 +0200)]
Remove uses of TextBuiltin.out in favor of outw

These came from patches in review in parallel with the introduction
of the exception throwing print writer.

Change-Id: I1c27fa276eb1fcf12ad19792049c35cb52518c16

12 years agoAllow @ in branch names and tighten syntax checking 69/7569/8
Robin Rosenberg [Sun, 23 Sep 2012 13:18:19 +0000 (15:18 +0200)]
Allow @ in branch names and tighten syntax checking

Valid refs are defined by git-check-ref-format(1). In addition
we will not try to perform a lookup of an invalid ref name in
Repository.resolve().

Reported by R Shapiro in the Eclipse JGit Forum.

Change-Id: I0b098eec9ecb98a9ce16b1cfb476729aaf2fb190

12 years agoMerge "The constructor CmdLineException(String) is deprecated"
Robin Rosenberg [Sun, 23 Sep 2012 08:59:33 +0000 (04:59 -0400)]
Merge "The constructor CmdLineException(String) is deprecated"

12 years agoThe constructor CmdLineException(String) is deprecated 35/5135/3
Tomasz Zarna [Mon, 12 Mar 2012 09:53:30 +0000 (10:53 +0100)]
The constructor CmdLineException(String) is deprecated

Use CmdLineException(CmdLineParser, String) instead. The new constructor
has been added in args4j 2.0.12, so in pom.xml that would be the minimum
version. Set the upper boundary in pom.xml to 2.1.0 (exclusive), just
like in the MANIFEST.MF.

Change-Id: If45d809e4ffa11a3572d958ce121422fb03cf8f3
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
12 years agoRefuse to checkout unmerged paths from index 80/7880/2
Robin Stocker [Sat, 22 Sep 2012 19:27:01 +0000 (21:27 +0200)]
Refuse to checkout unmerged paths from index

Without this check, the checkout was done but the result was a "both
deleted" status when inspecting it with C Git.

Found this while working on bug 390147.

Change-Id: Ic3693f2c651827239e838bf7f37da842a7ae9707

12 years agoMerge changes Ic2b78ba9,Ia13e63ed
Shawn O. Pearce [Sat, 22 Sep 2012 23:53:52 +0000 (19:53 -0400)]
Merge changes Ic2b78ba9,Ia13e63ed

* changes:
  Use '406 Not Acceptable' when info/refs is disabled
  Compress large /info/refs responses on HTTP

12 years agoSuppress boxing warnings where we know they are ok 71/7771/5
Robin Rosenberg [Fri, 21 Sep 2012 23:15:39 +0000 (01:15 +0200)]
Suppress boxing warnings where we know they are ok

Invoke the wrapper types' valueOf via static imports.
For booleans used in asserts, add a new assert in
the JUnit utility package since out current version of JUnit
does not have the assert(boolean, boolean) method.

Change-Id: I9099bd8efbc8c133479344d51ce7dabed8958a2b

12 years agoMerge "Fixed instability in some GC tests."
Matthias Sohn [Thu, 20 Sep 2012 20:29:03 +0000 (16:29 -0400)]
Merge "Fixed instability in some GC tests."

12 years agoFixed instability in some GC tests. 51/7851/1
Sasa Zivkov [Thu, 20 Sep 2012 14:50:25 +0000 (16:50 +0200)]
Fixed instability in some GC tests.

Some GC tests were sporadically failing. The reason was that they used
the setExpireAgeMillis method to define object expiration before
invoking the prune method. Depending on the CPU load during the test
run, the prune method may reach an object (which is considered
non-expired by the test) too late and actually prune it.

To make the test stable we now use the setExpire(Date expire) method and
define a time instant before which objects are considered to be expired.
This way the outcome of the prune method doesn't depend on the CPU load.

Change-Id: Ifc3323ca55ae56dbccdbc90a282ec3cf18ad7297
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
12 years agoFix the javadoc for GC.setExpire 50/7850/1
Sasa Zivkov [Thu, 20 Sep 2012 14:18:59 +0000 (16:18 +0200)]
Fix the javadoc for GC.setExpire

Clarify expiration of objects with the modification time exactly at the
given time instant.

Change-Id: I2000aec89c8d6a95700380b0a32275d2d658f67e
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
12 years agoUse '406 Not Acceptable' when info/refs is disabled 47/7847/1
Shawn O. Pearce [Thu, 20 Sep 2012 02:19:20 +0000 (19:19 -0700)]
Use '406 Not Acceptable' when info/refs is disabled

Instead of a confusing 403 Forbidden error indicating the dumb file
service is disabled on this server, use 406 Not Acceptable to mean
the client sent a request for content (the plain info/refs file)
that this server does not want to provide.

The stock C Git client will report HTTP 406 error if it predates
1.6.6 or something goes wrong with the smart request and it tried
falling back to the dumb request. This may help to debug cases where
a broken proxy server exists between the client and the server and
has mangled a prior smart info/refs response.

Change-Id: Ic2b78ba9502e4bbdff7cc3ba1fd284cf7616412b

12 years agoCompress large /info/refs responses on HTTP 46/7846/1
Shawn O. Pearce [Thu, 20 Sep 2012 00:33:07 +0000 (17:33 -0700)]
Compress large /info/refs responses on HTTP

Enable streaming compression for any response that is bigger than
the 32 KiB buffer used by SmartOutputStream. This is useful on the
info/refs file which can have many branches and tags listed, and
is often bigger than 32 KiB, but also compresses by at least 50%.

Disable streaming compression on large git-upload-pack responses,
as these are usually highly compressed Git pack data. Trying to
compress these with gzip will only waste CPU time and additional
transfer space with the gzip wrapper. Small git-upload-pack data
is usually text based negotiation responses and can be squeezed
smaller with a little bit of CPU usage.

Change-Id: Ia13e63ed334f594d5e1ab53a97240eb2e8f550e2

12 years agoUse x-friends instead of x-internal to expose jgit for internal use 91/7791/4
Robin Rosenberg [Mon, 17 Sep 2012 18:19:53 +0000 (20:19 +0200)]
Use x-friends instead of x-internal to expose jgit for internal use

This prevents a lot of unnecessary warnings about disouraged usage of
the org.eclipse.jgit.internal package within JGit itself.

Change-Id: Ia6683902809425fd7245e7d5d344c2ff8f317ebb

12 years agoPrepare 2.2.0 builds 19/7819/1
Matthias Sohn [Wed, 19 Sep 2012 07:10:12 +0000 (09:10 +0200)]
Prepare 2.2.0 builds

Change-Id: I386ba70541d644e58661d26713b309371e0f9257
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge branch 'stable-2.1' 18/7818/1
Matthias Sohn [Wed, 19 Sep 2012 07:02:04 +0000 (09:02 +0200)]
Merge branch 'stable-2.1'

* stable-2.1:
  Prepare for 2.1 maintenance changes
  JGit v2.1.0.201209190230-r
  Introduce "never" as parseable date
  Introduce ParseExceptions for GitDateParser
  Support config param "gc.pruneexpire"

Change-Id: If149d7f968a3425d9425f6ba9ce135a8341776a7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoPrepare for 2.1 maintenance changes 14/7814/1 stable-2.1
Matthias Sohn [Wed, 19 Sep 2012 07:00:33 +0000 (09:00 +0200)]
Prepare for 2.1 maintenance changes

Change-Id: I436f36a7c6dc86916eb4cde038b27f9fb183465a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoJGit v2.1.0.201209190230-r 13/7813/1 v2.1.0.201209190230-r
Matthias Sohn [Wed, 19 Sep 2012 06:56:17 +0000 (08:56 +0200)]
JGit v2.1.0.201209190230-r

Change-Id: I9f94bce9a25644575a068c8fa459f74e06b02030
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Fix resolving expression with ~ and ^ than extends beyond history"
Robin Rosenberg [Tue, 18 Sep 2012 22:00:38 +0000 (18:00 -0400)]
Merge "Fix resolving expression with ~ and ^ than extends beyond history"

12 years agoFix resolving expression with ~ and ^ than extends beyond history 35/7735/3
Dave Borowitz [Tue, 18 Sep 2012 17:49:35 +0000 (19:49 +0200)]
Fix resolving expression with ~ and ^ than extends beyond history

resolve("foo~X") where X is greater than the distance from foo to the
root should return null, but 2a2362fb introduced a bug causing it to
either return resolve("foo") or NPE. Add a test for the correct
behavior.

Also add an analogous test for foo^X where X is greater than the
number of parents (which was not broken by that commit).

Change-Id: Ic580081ece57c8c2df29b652897b425ecb34e11f

12 years agoIntroduce "never" as parseable date 95/7795/4
Robin Rosenberg [Tue, 18 Sep 2012 17:23:17 +0000 (19:23 +0200)]
Introduce "never" as parseable date

For configuration parameter like "gc.pruneexpire" we need to understand
the value "never". Never is handled as a date so far into the future
that it will never happen. The actual value currently used is the
constant GitDateParser.NEVER.

Change-Id: I7744eaee9bf5026da517151c212c88325c348d6c
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
12 years agoIntroduce ParseExceptions for GitDateParser 94/7794/1
Christian Halstrick [Mon, 17 Sep 2012 19:15:39 +0000 (21:15 +0200)]
Introduce ParseExceptions for GitDateParser

Instead of just returning null when something was not parseable we
should throw a real ParseException. This allows us to distinguish
between specifications which are unparseable and those which represent
no date (e.g. "never")

Change-Id: Ib3c1aa64b65ed0e0270791a365f2fa72ab78a3f4

12 years agoSupport config param "gc.pruneexpire" 93/7793/1
Christian Halstrick [Mon, 17 Sep 2012 19:21:00 +0000 (21:21 +0200)]
Support config param "gc.pruneexpire"

Make GC honor the config parameter gc.pruneexpire. If the parameter is
not set then the default is "2.weeks.ago"

Change-Id: I0ae0ca85993cafb4bc75ba80504da18544894ec3

12 years agoAdd tests for output result of merging -- org.eclipse.jgit.pgm.Merge 62/7762/2
Tomasz Zarna [Fri, 14 Sep 2012 15:31:33 +0000 (17:31 +0200)]
Add tests for output result of merging -- org.eclipse.jgit.pgm.Merge

Change-Id: I888c7e80503b869d65a9617e6a07e01d1ff5f197

12 years agoMerge "Suppress two resource warnings"
Shawn Pearce [Mon, 17 Sep 2012 01:13:15 +0000 (21:13 -0400)]
Merge "Suppress two resource warnings"

12 years agoAdditional unit tests for the GC 83/7783/3
Sasa Zivkov [Sun, 16 Sep 2012 21:57:18 +0000 (23:57 +0200)]
Additional unit tests for the GC

Change-Id: Id5b578f7040c6c896ab9386a6b5ed62b0f495ed5
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoCheck for write errors in standard out and exit with error 31/7631/9
Robin Rosenberg [Fri, 14 Sep 2012 16:48:56 +0000 (18:48 +0200)]
Check for write errors in standard out and exit with error

The underlying problem is that System.out is a PrintWriter and
as such it does not throw exceptions on error, but rather just
sets a flag and continues.

This changes replaces the use of System.out with a PrintWriter-like
writer that does not catch error, but instead throw them to the
caller.

Bug: 366243
Change-Id: I44405edc4416e943b87f09a0f6ed041c6c51b046

12 years agoMerge changes I8449695e,Idecd8018
Shawn Pearce [Sun, 16 Sep 2012 18:11:30 +0000 (14:11 -0400)]
Merge changes I8449695e,Idecd8018

* changes:
  Use assertEquals instead of == for literal primitives
  Use assertTrue/False instead of equals with boolean literals

12 years agoUse assertEquals instead of == for literal primitives 70/7770/3
Robin Rosenberg [Fri, 14 Sep 2012 22:47:06 +0000 (00:47 +0200)]
Use assertEquals instead of == for literal primitives

Change-Id: I8449695ecc94a423369a7644a6ec93cf0cacef5d

12 years agoUse assertTrue/False instead of equals with boolean literals 69/7769/2
Robin Rosenberg [Fri, 14 Sep 2012 17:43:20 +0000 (19:43 +0200)]
Use assertTrue/False instead of equals with boolean literals

This include replacing assertTrue(!..) with assertFalse()

Change-Id: Idecd8018641454e10127d82ea3ddda3f671489ef

12 years agoMerge "Ignore non-commit refs when in RevWalkUtils.findBranchesReachableFrom"
Robin Rosenberg [Fri, 14 Sep 2012 22:59:38 +0000 (18:59 -0400)]
Merge "Ignore non-commit refs when in RevWalkUtils.findBranchesReachableFrom"

12 years ago[findBugs] Silence warning about Transport initialization 85/6785/2
Robin Stocker [Thu, 13 Sep 2012 22:01:47 +0000 (00:01 +0200)]
[findBugs] Silence warning about Transport initialization

Change-Id: I98fc9720106bcd873b330090bafde276508f8a40
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoFix ResolveMerger issue with submodule conflict 23/7723/2
Tommi Siivola [Wed, 12 Sep 2012 05:19:30 +0000 (08:19 +0300)]
Fix ResolveMerger issue with submodule conflict

ResolveMerger throws a MissingObjectException when it encounters
a submodule conflict while merging. The reason is that it treats
the submodule link as a blob and tries to read its contents.

We solve the issue by detecting before content merge whether the
path to be merged is a submodule link, and skip the content
merge if it is.

Bug: 389238
Change-Id: I9a58dfc7716b28a21f5c04cf3a865091ae8dfe7e
Signed-off-by: Tommi Siivola <tommi.siivola@eficode.com>
12 years agoMerge "Added new Status CLI command 'jgit status'"
Matthias Sohn [Tue, 11 Sep 2012 20:48:00 +0000 (16:48 -0400)]
Merge "Added new Status CLI command 'jgit status'"

12 years agoRemove protobuf from top-level pom.xml 09/7709/1
Shawn O. Pearce [Tue, 11 Sep 2012 14:06:35 +0000 (07:06 -0700)]
Remove protobuf from top-level pom.xml

This dependency is unused, and does not need to be
version-managed in the top-level pom.xml anymore.

Change-Id: I240d21b6478e15b05e679b8d976af171d81a524e

12 years agoMerge "README: Convert to Markdown and rename to README.md"
Matthias Sohn [Mon, 10 Sep 2012 22:12:50 +0000 (18:12 -0400)]
Merge "README: Convert to Markdown and rename to README.md"

12 years agoIgnore attempts to set the timeout to -1 80/7680/4
Jason Pyeron [Mon, 10 Sep 2012 21:50:10 +0000 (23:50 +0200)]
Ignore attempts to set the timeout to -1

The value of -1 is the default value used by the underlying http
transports provided by the jre. On some versions an attempt to
set the timeout explicitly to -1 triggers a check condition,
disallowing negative numbers.

Bug: 389003
Change-Id: I74a22f8edc6c8e15843ad07c96a137739d9dcad1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdded new Status CLI command 'jgit status' 82/3682/8
Robin Rosenberg [Sun, 9 Sep 2012 19:02:40 +0000 (21:02 +0200)]
Added new Status CLI command 'jgit status'

This is a first basic implementation that displays current branch and
list of files of various status, but isn't as refined as its native
counterpart (e.g. does not say if we're ahead or behind the remote).
It's been helpful in the diagnostic of bug #347885.

Bug: 348318
CQ: 6769
Change-Id: Ifc35da608fbba652524c1b5b522e3c0d5369ad5e
Signed-off-by: François Rey <eclipse.org@francois.rey.name>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
12 years agoREADME: Convert to Markdown and rename to README.md 92/7692/1
Robin Stocker [Sat, 8 Sep 2012 17:58:37 +0000 (19:58 +0200)]
README: Convert to Markdown and rename to README.md

This makes it display nicely on the GitHub mirror repository. And it is
still very pleasant to read in plain text.

Change-Id: I0c5e1caa58a22684cdbd9a02e9ec38e97d5adb1a
Signed-off-by: Robin Stocker <robin@nibor.org>
12 years agoIgnore non-commit refs when in RevWalkUtils.findBranchesReachableFrom 87/7687/3
Robin Rosenberg [Sat, 8 Sep 2012 10:07:24 +0000 (12:07 +0200)]
Ignore non-commit refs when in RevWalkUtils.findBranchesReachableFrom

This methods is for finding branches only.

Change-Id: Ic68b5295ff814401890f0592ae95851554706ca6

12 years agoMark fields of BaseReceivePack private 85/7285/2
Shawn O. Pearce [Sat, 18 Aug 2012 22:51:03 +0000 (15:51 -0700)]
Mark fields of BaseReceivePack private

None of these should have been exposed to base classes. The majority
of them are private implementation details that are not required by a
subclass in order to interact with the base protocol definition. The
few that are needed should be visible as accessor methods, so the
internals can be modified without breaking the public JGit API.

Change-Id: I874179105c9c37703307facbbf99387c52bf772c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoDelete checkObjectCollisions from PackParser 84/7284/2
Shawn O. Pearce [Sat, 18 Aug 2012 22:42:12 +0000 (15:42 -0700)]
Delete checkObjectCollisions from PackParser

This flag was added to provide an unsafe operation on the local
repository because the storage.dht code was too damn slow to provide
proper safe Git behavior all of the time. Now that stoarge.dht has
been removed from the repository, also delete this unsafe flag to
prevent applications from misusing the JGit library and permitting
users to potentially damage their local repository with bad data
received from an untrusted peer.

Change-Id: Ib1861c48bb74836731e7b7d57b635dd654b0dc66
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoDelete storage.dht package 83/7283/2
Shawn O. Pearce [Sat, 18 Aug 2012 22:27:12 +0000 (15:27 -0700)]
Delete storage.dht package

This experiment proved to be not very useful. I had originally
planned to use this on top of Google Bigtable, Apache HBase or
Apache Cassandra. Unfortunately the schema is very complex and
does not perform well. The storage.dfs package has much better
performance and has been in production at Google for many months
now, proving it is a viable storage backend for Git.

As there are no users of the storage.dht schema, either at Google or
any other company, nor any valid open source implementations of the
storage system, drop the entire package and API from the JGit project.
There is no point in trying to maintain code that is simply not used.

Change-Id: Ia8d32f27426d2bcc12e7dc9cc4524c59f4fe4df9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoOutput result of switching branch -- o.e.jgit.pgm.Checkout 64/5764/8
Tomasz Zarna [Wed, 5 Sep 2012 05:59:37 +0000 (07:59 +0200)]
Output result of switching branch -- o.e.jgit.pgm.Checkout

Change-Id: I9829950b686ce3b8c70b8f7a1774d5e2b55cd00a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoFix NPE when notes are present 47/7347/3
Robin Rosenberg [Wed, 5 Sep 2012 05:42:12 +0000 (07:42 +0200)]
Fix NPE when notes are present

Change-Id: If9200ae4a7f582a5562aecf323ff0430ba154583
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agocleanup: use assertArrayEquals for assertion on arrays 67/7567/5
Robin Rosenberg [Sat, 1 Sep 2012 22:15:53 +0000 (00:15 +0200)]
cleanup: use assertArrayEquals for assertion on arrays

Change-Id: I1df945011f8e5f03959b693d3564fe357e707f91

12 years agocleanup: Prefer assertEquals over assertTrue(....equals(...)) 66/7566/4
Robin Rosenberg [Mon, 3 Sep 2012 20:29:44 +0000 (22:29 +0200)]
cleanup: Prefer assertEquals over assertTrue(....equals(...))

That is the common style and yields better diagnostics on failure.

Change-Id: I831a55615a812734af0912a5d6bbfd1edc75308e

12 years agoMerge "Support branches with name 'config'"
Christian Halstrick [Mon, 3 Sep 2012 12:15:31 +0000 (08:15 -0400)]
Merge "Support branches with name 'config'"

12 years agoMerge "Add tests for more coverage of CheckoutCommand"
Matthias Sohn [Mon, 3 Sep 2012 06:52:41 +0000 (02:52 -0400)]
Merge "Add tests for more coverage of CheckoutCommand"

12 years agoAdd tests for more coverage of CheckoutCommand 00/7200/2
Robin Stocker [Mon, 3 Sep 2012 06:44:28 +0000 (08:44 +0200)]
Add tests for more coverage of CheckoutCommand

Change-Id: Id3ab5f56f88d7e9636c71b30258c268a75fc422e
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoDirCacheCheckout: Fix handling of files not in index 59/7259/2
Robin Stocker [Thu, 16 Aug 2012 14:06:58 +0000 (16:06 +0200)]
DirCacheCheckout: Fix handling of files not in index

When a file is not in the index and neither contents nor mode differ
between "head" and "merge", the index state should be kept. If they
differ, a checkout conflict should occur. This is described in Git's
git-read-tree.txt.

JGit used to replace the index state with "merge" in both of the above
cases.

A confusing effect of this was that when one removed a file and then did
a rebase, the file silently reappeared again.

The changes to dir/file conflict handling are a consequence of this
change, as the index handling change made tests in DirCacheCheckoutTest
break. I compared these cases to C Git and the new behavior there also
matches what C Git does.

Bug: 387390
Change-Id: I5beb781f12172a68f98c67d4c8029eb51ceae62d
Signed-off-by: Robin Stocker <robin@nibor.org>
12 years agoCreate an input stream that transforms LF to CRLF 75/7275/4
Robin Rosenberg [Sat, 1 Sep 2012 07:56:51 +0000 (09:56 +0200)]
Create an input stream that transforms LF to CRLF

The transformation is the same as AutoCRLFOutputStream does, but
the direction is reversed. The tests are reused, but the implementation
derives somewhat from the EolCanonicalizingInputStream.

This stream will be used to compare blobs with LF line endings with
worktree data that has CRLF line endings.

Bug: 387501
Change-Id: I80d96e453e7f780dd464a89778de124cf35384e1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoEnhance statistics for repo by sizes and ref-counts 20/7520/2
Christian Halstrick [Fri, 31 Aug 2012 14:14:12 +0000 (16:14 +0200)]
Enhance statistics for repo by sizes and ref-counts

The statistics for a repo now expose how many bytes are used in the
filesystem to store all loose/packed objects. The number of packed/loose
refs are also exposed.

Change-Id: I335a4c7630a2629a86f13a2a5cd99f79a2c2afa4

12 years agoImplement a parser for dates 90/7390/3
Christian Halstrick [Tue, 28 Aug 2012 05:52:28 +0000 (07:52 +0200)]
Implement a parser for dates

In order to parse user specified strings containing date and time info
a thread-safe parser is implemented. This is needed for example to
interpret configuration parameters (e.g. gc.pruneexpire where need to
parse strings like "2 weeks ago"). The parser is thread-safe by caching
SimpleDateFormat instances in a ThreadLocal cache.

Native git has a parser called approxidate which is able to interpret a
huge number of formats ("1 year ago", "tea time", ...). Ideally JGit
should be able to parse the same strings as native git but for now this
parser understands the following subset:

"now"
"yesterday"
"(x) years|months|weeks|days|hours|minutes|seconds ago"
"yyyy-MM-dd HH:mm:ss Z" (ISO)
"EEE, dd MMM yyyy HH:mm:ss Z" (RFC)
"yyyy-MM-dd"
"yyyy.MM.dd"
"MM/dd/yyyy"
"dd.MM.yyyy"
"EEE MMM dd HH:mm:ss yyyy Z" (DEFAULT)
"EEE MMM dd HH:mm:ss yyyy" (LOCAL)

Change-Id: Iccb66dadb60da13104e73140e53d5e2de068369c

12 years agoMerge "Fix gc's usage of progress monitor"
Stefan Lay [Tue, 28 Aug 2012 07:02:19 +0000 (03:02 -0400)]
Merge "Fix gc's usage of progress monitor"

12 years agoFix Jetty's p2 repository URL 29/7429/1
Matthias Sohn [Mon, 27 Aug 2012 11:59:42 +0000 (13:59 +0200)]
Fix Jetty's p2 repository URL

The Jetty 7.x p2 repository was moved to the archive server

Change-Id: If864c64e8a64ced9b9b982332b412b367a6c1011
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoUpdate last jgit release version used in clirr API checks 95/7195/2
Matthias Sohn [Sat, 11 Aug 2012 23:14:45 +0000 (01:14 +0200)]
Update last jgit release version used in clirr API checks

Change-Id: I20b1dd7d45eb7bb2644865f019ab726354c840c7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoUpdate maven plugin versions 94/7194/2
Matthias Sohn [Sat, 11 Aug 2012 23:13:08 +0000 (01:13 +0200)]
Update maven plugin versions

Change-Id: I547e89b11eaa291f1e512a209ac49eaa15273b42
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoEnable rebase to continue for all rebase stages 24/5524/3
Robin Rosenberg [Sun, 26 Aug 2012 22:54:59 +0000 (00:54 +0200)]
Enable rebase to continue for all rebase stages

EGit should be able to continue a rebase started by C Git.

Change-Id: I63058026295fec34157b5687ae87ae9cb0c27c86
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Refactor detection of Windows platform to SystemReader"
Matthias Sohn [Sun, 26 Aug 2012 22:39:54 +0000 (18:39 -0400)]
Merge "Refactor detection of Windows platform to SystemReader"

12 years agoMerge "Set core.precomposeunicode to true when creating repository on Mac"
Matthias Sohn [Sun, 26 Aug 2012 22:34:22 +0000 (18:34 -0400)]
Merge "Set core.precomposeunicode to true when creating repository on Mac"

12 years agoMerge "Refactor detection of OS X to SystemReader"
Matthias Sohn [Sun, 26 Aug 2012 22:33:34 +0000 (18:33 -0400)]
Merge "Refactor detection of OS X to SystemReader"

12 years agoFix gc's usage of progress monitor 23/7423/1
Matthias Sohn [Sat, 25 Aug 2012 23:46:40 +0000 (01:46 +0200)]
Fix gc's usage of progress monitor

Change-Id: I8dcdf0b83e91e6132dc490e8ec53818220773c94
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoRefactor detection of Windows platform to SystemReader 17/7117/3
Robin Rosenberg [Thu, 2 Aug 2012 23:33:34 +0000 (01:33 +0200)]
Refactor detection of Windows platform to SystemReader

Change-Id: Id0b8aef92f10572d4f1ec198e0281162fcd7ed4e

12 years agoSet core.precomposeunicode to true when creating repository on Mac 16/7116/3
Robin Rosenberg [Thu, 2 Aug 2012 22:56:46 +0000 (00:56 +0200)]
Set core.precomposeunicode to true when creating repository on Mac

Java has no option but to use precomposed Unicode, so we should
state that when creating a new repository. Not that Java will use
precomposed unicode regardless of this setting, but this reduces
the risk of incompatibility with C Git.

Change-Id: I3779b75f76d2e2061c836cbc9b4b7c2ae0cf18f4

12 years agoRefactor detection of OS X to SystemReader 15/7115/4
Robin Rosenberg [Thu, 2 Aug 2012 22:46:39 +0000 (00:46 +0200)]
Refactor detection of OS X to SystemReader

Change-Id: I34e9ba4a26f7af5b88140c070f02a7990f1941af

12 years agoMerge changes I98df46ce,Ifb815a12,I051a1724
Robin Rosenberg [Tue, 21 Aug 2012 21:34:45 +0000 (17:34 -0400)]
Merge changes I98df46ce,Ifb815a12,I051a1724

* changes:
  Support [<ref>]@{upstream} revision syntax
  Support parsing previous checkout as a revision expresion.
  Allow a @ without branch in revision syntax

12 years agoMerge "Refactored method to find branches from which a commit is reachable"
Robin Rosenberg [Tue, 21 Aug 2012 21:19:17 +0000 (17:19 -0400)]
Merge "Refactored method to find branches from which a commit is reachable"

12 years agoMerge changes I4f73487b,I1d1ed122
Matthias Sohn [Tue, 21 Aug 2012 20:59:42 +0000 (16:59 -0400)]
Merge changes I4f73487b,I1d1ed122

* changes:
  The Git API's only likes /, not \ in paths
  Skip a test that cannot be verified on Windows

12 years agoThe Git API's only likes /, not \ in paths 28/7328/1
Robin Rosenberg [Tue, 21 Aug 2012 16:21:17 +0000 (18:21 +0200)]
The Git API's only likes /, not \ in paths

Therefore this test fails on Windows

Change-Id: I4f73487b720ea1479e95108344f1dc3711106408

12 years agoSkip a test that cannot be verified on Windows 27/7327/1
Robin Rosenberg [Tue, 21 Aug 2012 16:17:31 +0000 (18:17 +0200)]
Skip a test that cannot be verified on Windows

Change-Id: I1d1ed122c714f39ca7fb557224756205274804eb

12 years agoSupport branches with name 'config' 68/7268/3
Christian Halstrick [Tue, 21 Aug 2012 13:10:02 +0000 (15:10 +0200)]
Support branches with name 'config'

JGit was not able to lookup refs which had the name of files which exist
in the .git folder. When JGit was looking up a ref named X it has a
fixed set of directories where it searched for files named X
(ignore packed refs for now). First directory to search for is .git. In
case of the ref named 'config' it searched there for this file, found it
(it's the .git/config file with the repo configuration in it), parsed
it, found it is an invalid ref and stopped searching. It never looked
for a file .git/refs/heads/config.

I changed JGit in a way that when it finds a file in GIT_DIR which
corresponds to a ref name and if this file doesn't contain a valid ref
then it will ignore the InvalidObjectIdException and continue searching.

Change-Id: Ic26a329fb1624a5b2b2494c78bac4bd76817c100
Bug: 381574
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
12 years agoRefactored method to find branches from which a commit is reachable 39/5839/3
Robin Rosenberg [Sat, 5 May 2012 16:41:27 +0000 (18:41 +0200)]
Refactored method to find branches from which a commit is reachable

The method uses some heuristics to obtain much better performance
than isMergeBase.

Since I wrote the relevant code in the method I approve the license
change from EPL to EDL implied by the move.

Change-Id: Ic4a7584811a2b0bf24e4f6b3eab2a7c022eabee8
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
12 years agoTeach BranchTrackingStatus to handle tracking of local branches 91/7191/4
Matthias Sohn [Fri, 17 Aug 2012 22:29:45 +0000 (00:29 +0200)]
Teach BranchTrackingStatus to handle tracking of local branches

EGit wasn't able to decorate local branches tracking another local
branch with number of commits the checked out local branch differs from
the other local branch it's tracking.

Bug: 376970
Change-Id: I74e932d5eacd74dbf6b0dffcfc65ba3222a8250e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoImprove ours/theirs conflict markers for rebase, cherry-pick 22/7222/3
Robin Stocker [Fri, 17 Aug 2012 22:11:45 +0000 (00:11 +0200)]
Improve ours/theirs conflict markers for rebase, cherry-pick

On conflicts in rebase or cherry-pick, the conflict markers were like
this:

    <<<<<<< OURS
    a
    =======
    b
    >>>>>>> THEIRS

This is technically correct, but it could be better.

It's especially confusing during a rebase, where the meaning of
OURS/THEIRS is not obvious. The intuition is that "ours" is the commits
that "I" did before the rebase, but it's the other way around because of
the way rebase works. See various bug reports and stackoverflow
discussions.

With this change, in the case of a cherry-pick while on master, the
markers will be like this:

    <<<<<<< master
    a
    =======
    b
    >>>>>>> bad1dea Message of the commit I'm cherry-picking

In the case of a "git rebase master":

    <<<<<<< Upstream, based on master
    a
    =======
    b
    >>>>>>> b161dea Message of a commit I'm rebasing

It's not "master" because that would only be correct for the first
cherry-pick during a rebase, after that, it's master + already
cherry-picked commits.

And in the case of a "git pull --rebase":

    <<<<<<< Upstream, based on branch 'master' of git@example.org:repo
    a
    =======
    b
    >>>>>>> b161dea Message of a commit I'm rebasing

Bug: 336819
Change-Id: I1333a8dd170bb0077f491962013485efb6f2a926
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoSuppress two resource warnings 30/7230/2
Robin Rosenberg [Sun, 5 Aug 2012 10:53:09 +0000 (12:53 +0200)]
Suppress two resource warnings

Change-Id: I829bb135b2347f79aa6d8979a0934042e40d212f

12 years agoMerge changes Ie949f321,I403de522
Shawn Pearce [Wed, 15 Aug 2012 19:31:33 +0000 (15:31 -0400)]
Merge changes Ie949f321,I403de522

* changes:
  Implement wasDeltaAttempted() in DfsObjectRepresentation.
  Do not delta compress objects that have already tried to compress.

12 years agoFix idOffset when the working tree iterator matches a dircache entry 31/7231/4
Robin Rosenberg [Wed, 15 Aug 2012 12:33:16 +0000 (14:33 +0200)]
Fix idOffset when the working tree iterator matches a dircache entry

idOffset is not zero when idBuffer comes from blob in the dircache

Change-Id: Iff768422cba140a5d6a776e2c627b852f079c1da

12 years agoImplement wasDeltaAttempted() in DfsObjectRepresentation. 13/7213/1
Colby Ranger [Mon, 13 Aug 2012 22:54:06 +0000 (15:54 -0700)]
Implement wasDeltaAttempted() in DfsObjectRepresentation.

In DFS, everything is stored in a pack but only objects in a pack with
source GC or UNREACHABLE_GARBAGE have had delta compression attempted.
Expose the PackSource setter and getter on DfsPackDescription in order
to implement wasDeltaAttempted.

Change-Id: Ie949f321147ad870f1c3f23b552343bbbda32152

12 years agoDo not delta compress objects that have already tried to compress. 11/7211/2
Colby Ranger [Mon, 13 Aug 2012 20:52:33 +0000 (13:52 -0700)]
Do not delta compress objects that have already tried to compress.

If an object is in a pack file already, delta compression will not
attempt to re-compress it. This assumes that the previous
packing already performed the optimal compression attempt, however,
the subclasses of StoredObjectRepresentation may use other heuristics
to determine if the stored format is optimal.

Change-Id: I403de522f4b0dd2667d54f6faed621f392c07786

12 years agoMerge "Allow JGit to read C Git rebase state"
Christian Halstrick [Mon, 13 Aug 2012 13:43:42 +0000 (09:43 -0400)]
Merge "Allow JGit to read C Git rebase state"

12 years agoMake CheckoutCommand pass modified files through result 37/5337/9
Markus Duft [Mon, 4 Jun 2012 13:37:53 +0000 (15:37 +0200)]
Make CheckoutCommand pass modified files through result

This change makes CheckoutCommand pass the list of modified files
through the OK result, enabling outside world to react in a smaller
scope (for example refresh only resources containing the modified
files).

Change-Id: I53c50ee09bc0d3ff501bdc25196e52e739c3f1f9
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAllow JGit to read C Git rebase state 18/7118/2
Robin Rosenberg [Tue, 7 Aug 2012 14:49:45 +0000 (16:49 +0200)]
Allow JGit to read C Git rebase state

C Git prefixes the time stamp in the author script with a "@"

Change-Id: I140b29519acc101da78296eef562368fc6b61135

12 years agoAllow detection of case insensitive file systems 28/6028/3
Matthias Sohn [Fri, 18 May 2012 14:52:50 +0000 (16:52 +0200)]
Allow detection of case insensitive file systems

Change-Id: I03f59d07bcc3338ef8d392cbd940799186ca03bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
12 years agoEnsure a directory exists before trying to create/merge a file into it. 96/7096/5
Jevgeni Zelenkov [Mon, 6 Aug 2012 06:59:28 +0000 (08:59 +0200)]
Ensure a directory exists before trying to create/merge a file into it.

Since git doesn't keep track of empty directories, they should be
created first. Test case included demonstrates that using
StashApplyCommand(). Bugfix is applied to the DirCacheCheckout class,
because StashApplyCommand() uses it internally to apply a stash.

Change-Id: Iac259229ef919f9e92e7e51a671d877172bb88a8
Signed-off-by: Jevgeni Zelenkov <jevgeni.zelenkov@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Fix PlotCommit for commits with duplicate parents"
Robin Rosenberg [Sun, 5 Aug 2012 10:51:27 +0000 (06:51 -0400)]
Merge "Fix PlotCommit for commits with duplicate parents"