Commit Graph

2227 Commits

Author SHA1 Message Date
Robin Stocker 9fbe88aab1 Update README
Extend introduction, update links and remove outdated information.

Change-Id: I29f4d72c980008b6bebe3b009d58c915cd091b9d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-28 23:21:22 +02:00
Markus Keller a27c1a6b15 Fix compile error (method not available in 1.5)
Change-Id: I07aca821010daca75a66506b9ca738bc8c262abb
Signed-off-by: Markus Keller <markus_keller@ch.ibm.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-27 00:17:53 +02:00
Robin Rosenberg 0b19db77cb Merge "Remove unused import introduced with 8f706db5" 2012-09-26 17:41:59 -04:00
Shawn O. Pearce 31261b5c2f Revert "The constructor CmdLineException(String) is deprecated"
This reverts commit 07f9936257.

07f9 seems to require a more recent args4j, but I cannot locate a CQ
that verifies we can use a version more recent then 2.0.12. 2.0.16
has been released, but the Hudson CI instance at Eclipse won't
build it.

Since the commit fixes an issue identified in March but wasn't
actually submitted to the tree until September, we can continue to
ignore whatever the problem is/was until someone can attempt a more
correctly working solution.

Change-Id: I94fa432c219bda21c1126976bb60e5292760092e
2012-09-26 10:20:42 -07:00
Matthias Sohn 5aac542f65 Remove unused import introduced with 8f706db5
Also cleanup wildcards in import statements.

Change-Id: I28c1435ae7482de1209aeefc755a230ef5b8c15d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-25 23:13:54 +02:00
Christian Halstrick 83e7554e17 Merge "Provide a convenient read() in RepositoryTestCase" 2012-09-25 16:56:58 -04:00
Christian Halstrick 01a33350ee Merge "Add the intended file to avoid breakage" 2012-09-25 16:41:56 -04:00
Robin Stocker 9ea38173cc Provide a convenient read() in RepositoryTestCase
For reading a file by its repository-relative path, analogous to
writeTrashFile.

Change-Id: I112de0d57c2ee1bd425de6cbf561a57fea7147f0
2012-09-25 21:00:57 +02:00
Robin Rosenberg 2531d939e4 Add the intended file to avoid breakage
This case breaks when the default is to disallow empty commits.

Change-Id: Ibc223092eefe9f4b21374717dee5a9399bf890f9
2012-09-25 18:46:41 +02:00
Robin Rosenberg bc66934a83 Merge "Allow @ in branch names and tighten syntax checking" 2012-09-24 14:36:57 -04:00
Robin Rosenberg 2e1d391f62 Merge "FileBasedConfig supports UTF-8 byte order marker" 2012-09-24 14:35:22 -04:00
Robin Rosenberg 13df55a464 Merge "Fix typo in AnyObjectId#abbreviate" 2012-09-24 14:22:24 -04:00
Robin Rosenberg aca8df0425 Merge "Add toString for TrackingRefUpdate" 2012-09-24 14:21:11 -04:00
Marc Strapetz 8f706db56a FileBasedConfig supports UTF-8 byte order marker
Change-Id: I1f5dc07182dbf6bba2a9f4807fdd25b475da4ead
2012-09-24 14:28:15 +02:00
Christian Halstrick 1d08015cad Merge "Refuse to checkout unmerged paths from index" 2012-09-24 05:08:36 -04:00
Robin Stocker 56a0286b28 Fix typo in AnyObjectId#abbreviate
Change-Id: I5796dc81727a8e1923189e9490a55c4af6ad053e
2012-09-24 00:34:33 +02:00
Robin Stocker 85b189fdbe 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
2012-09-24 00:01:04 +02:00
Robin Rosenberg 68a91801d7 Comment an empty block which is ok
Change-Id: I552d4481e17a12b0bd707d5386f29026ae0856fb
2012-09-23 23:01:28 +02:00
Robin Rosenberg 22427b748b Remove unnecessary @SuppressWarnings
Change-Id: Ic7b8494713d59574ee8f064a5c1042b48aedf012
2012-09-23 23:00:36 +02:00
Robin Rosenberg 7de1154d21 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
2012-09-23 23:00:35 +02:00
Robin Rosenberg 094df5a916 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
2012-09-23 15:18:19 +02:00
Robin Rosenberg 78c8659428 Merge "The constructor CmdLineException(String) is deprecated" 2012-09-23 04:59:33 -04:00
Tomasz Zarna 07f9936257 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>
2012-09-23 10:49:50 +02:00
Robin Stocker ac805874f7 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
2012-09-23 02:41:51 +02:00
Shawn O. Pearce eb5b506acd Merge changes Ic2b78ba9,Ia13e63ed
* changes:
  Use '406 Not Acceptable' when info/refs is disabled
  Compress large /info/refs responses on HTTP
2012-09-22 19:53:52 -04:00
Robin Rosenberg c3f1fac03f 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
2012-09-22 01:21:00 +02:00
Matthias Sohn 46d42404d3 Merge "Fixed instability in some GC tests." 2012-09-20 16:29:03 -04:00
Sasa Zivkov 87346556d3 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>
2012-09-20 16:50:25 +02:00
Sasa Zivkov 7ad88afeb8 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>
2012-09-20 16:20:19 +02:00
Shawn O. Pearce b3e8f29fe9 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
2012-09-19 19:19:20 -07:00
Shawn O. Pearce f93a6a7229 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
2012-09-19 17:33:07 -07:00
Robin Rosenberg c9cce254c7 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
2012-09-19 23:53:53 +02:00
Matthias Sohn 4b3c0f8aba Prepare 2.2.0 builds
Change-Id: I386ba70541d644e58661d26713b309371e0f9257
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-19 09:10:12 +02:00
Matthias Sohn 555ad1f93c 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>
2012-09-19 09:02:31 +02:00
Matthias Sohn 54c4eb69ac Prepare for 2.1 maintenance changes
Change-Id: I436f36a7c6dc86916eb4cde038b27f9fb183465a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-19 09:00:33 +02:00
Matthias Sohn c466bc2ddf JGit v2.1.0.201209190230-r
Change-Id: I9f94bce9a25644575a068c8fa459f74e06b02030
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-19 08:56:17 +02:00
Robin Rosenberg 1f19d0a834 Merge "Fix resolving expression with ~ and ^ than extends beyond history" 2012-09-18 18:00:38 -04:00
Dave Borowitz 70ae16d708 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
2012-09-18 19:51:57 +02:00
Robin Rosenberg e0a3091af7 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>
2012-09-18 19:23:17 +02:00
Christian Halstrick 84e171fbab 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
2012-09-17 22:41:06 +02:00
Christian Halstrick 27b791c591 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
2012-09-17 22:41:06 +02:00
Tomasz Zarna f7b644df66 Add tests for output result of merging -- org.eclipse.jgit.pgm.Merge
Change-Id: I888c7e80503b869d65a9617e6a07e01d1ff5f197
2012-09-17 07:07:00 -07:00
Shawn Pearce 18e020218b Merge "Suppress two resource warnings" 2012-09-16 21:13:15 -04:00
Sasa Zivkov a551493240 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>
2012-09-16 23:57:18 +02:00
Robin Rosenberg caa362f20d 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
2012-09-16 11:12:47 -07:00
Shawn Pearce 1a07ddca85 Merge changes I8449695e,Idecd8018
* changes:
  Use assertEquals instead of == for literal primitives
  Use assertTrue/False instead of equals with boolean literals
2012-09-16 14:11:30 -04:00
Robin Rosenberg d92287bcc2 Use assertEquals instead of == for literal primitives
Change-Id: I8449695ecc94a423369a7644a6ec93cf0cacef5d
2012-09-16 00:23:51 +02:00
Robin Rosenberg a7b0641b96 Use assertTrue/False instead of equals with boolean literals
This include replacing assertTrue(!..) with assertFalse()

Change-Id: Idecd8018641454e10127d82ea3ddda3f671489ef
2012-09-16 00:23:23 +02:00
Robin Rosenberg 28adbb3500 Merge "Ignore non-commit refs when in RevWalkUtils.findBranchesReachableFrom" 2012-09-14 18:59:38 -04:00
Robin Stocker 187101808c [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>
2012-09-14 00:01:47 +02:00