Commit Graph

1736 Commits

Author SHA1 Message Date
Robin Stocker b7f5ed5612 Add Javadoc description for packages
These appear as descriptions in the index, see here (currently empty):

http://download.eclipse.org/jgit/docs/latest/apidocs/

Change-Id: If7996deef30ae688bade8b3ad6b19547ca3d8b50
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-10-31 21:26:22 -07:00
Robin Rosenberg 81fa566295 Suppress resource warnings with Java 7
For streams that should not be closed, i.e. don't own an underlying
stream, and in-memory streams that do not need to be closed we just
suppress the warning. This mostly apply to test cases. GC is enough.

For streams with external resources (i.e. files) we add the necessary
call to close().

Change-Id: I4d883ba2e7d07f199fe57ccb3459ece00441a570
2012-10-25 15:17:23 -07:00
Shawn Pearce bc8794eb21 Merge "Extend Javadoc of CheckoutCommand and add examples" 2012-10-25 18:13:56 -04:00
Shawn Pearce 4e6e267b8a Merge "Fix for Iff768422c, use offset 0 when going back to work tree iterator" 2012-10-25 17:55:22 -04:00
Shawn Pearce cd61e85fa1 Merge "Don't allow null name or e-mail in PersonIdent" 2012-10-25 17:19:15 -04:00
Shawn Pearce 88eb017c6c Merge "Fix Javadoc formatting of org.eclipse.jgit.diff package" 2012-10-25 17:16:27 -04:00
Shawn O. Pearce 500becfc63 Merge "Simplify push error message when ref already exists" 2012-10-25 17:15:02 -04:00
Christian Halstrick b7d2c9a446 Merge "AbstractTreeIterator: Add toString with entry path" 2012-10-22 07:11:01 -04:00
Robin Stocker ad52ec5207 StashCreateCommand: Abort in case of unmerged paths
Bug: 391861
Change-Id: I5f8ffe072c08c8ca2ca6be6b6afa67c8e16a63b6
2012-10-22 11:14:40 +02:00
Robin Stocker f54b74225c AbstractTreeIterator: Add toString with entry path
Helps when debugging tree walking code.

Change-Id: I7ba3846a028a1538787a7d4fbf50f7c487cae6c7
2012-10-20 20:12:25 +02:00
Robin Stocker 8572526765 Extend Javadoc of CheckoutCommand and add examples
Otherwise one has to look at the source to find out how to use the
command.

Change-Id: I074325bf2147aeb6f738a9346a9bb8fc49968929
2012-10-18 14:08:36 +02:00
Shawn O. Pearce 99e9a3bdc6 Simplify push error message when ref already exists
If a client attempts to create a branch that already exists on the
remote side, tell them "already exists" rather than repeat lots of
information about the reference. Previously the error looked like:

  ! [remote rejected] tags/1.3.1 -> 1.3.1 (Ref Ref[refs/tags/1.3.1=e3857ee05...] already exists)

Now it will simply say:

  ! [remote rejected] tags/1.3.1 -> 1.3.1 (already exists)

Change-Id: I96fc67ca8b650052de6e662449a3c5bc8bbc010b
2012-10-17 18:04:25 -07:00
Robin Stocker ac81ab4878 Fix Javadoc formatting of org.eclipse.jgit.diff package
Without explicit <p> elements, Javadoc joins all paragraph, resulting in
unreadable Javadoc output, e.g. see here:

http://download.eclipse.org/jgit/docs/jgit-2.1.0.201209190230-r/apidocs/org/eclipse/jgit/diff/MyersDiff.html

Also, <pre> is needed to preserve pre-formatted content.

The reflowing of text was automatically done on save.

Change-Id: Ia02dd6d759ae066700098e22669ef925e3c813b5
2012-10-17 22:09:16 +02:00
Christian Halstrick 5fc7bd783b Merge "Add a hint on the purpose of JGitInternalException to the constructor" 2012-10-14 17:06:20 -04:00
Robin Rosenberg 47a9b996c7 Add a hint on the purpose of JGitInternalException to the constructor
In code review we often see uses of JGitInternalException where a high
level GitAPIException would be more appropriate. Hopefully the word
low-level in the constructor comment will lead to fewer such cases.

Change-Id: Id5ec7897535f6c5c5f0bd153fe0ff15c65083474
2012-10-14 20:55:14 +02:00
Robin Stocker c8ed4a5006 RevWalk: Add link to parseHeaders/parseBody in Javadoc of lookupCommit
Change-Id: I7765d1a69d19968ebad603025a9c686f17633ebd
2012-10-13 21:25:29 +02:00
Robin Stocker 6dadc801bd Don't allow null name or e-mail in PersonIdent
toExternalString, equals and hashCode don't expect them to be null, so
explicitly disallow it in the constructor.

Also fix the documentation of setAuthor and setCommitter in
CommitCommand when specifying name and email as separate arguments.

Bug: 352984
Change-Id: I0ac994ae8e47789d38f7c6e6db55d482f0f1bac3
2012-10-13 18:40:46 +02:00
Matthias Sohn 14164e040c Merge "Make BlameGenerator comments more clear" 2012-10-09 16:51:34 -04:00
Robin Stocker 79f33419ec CommitCommand: Use original author on amend if author is not set
This way, callers don't have to parse author ident of HEAD themselves.

Bug: 362391
Change-Id: I383a817e6ed4707d637c52c007bc7b57728e6c85
2012-10-08 00:31:27 +02:00
Robin Stocker c96b40d592 CommitCommand: Don't allow amending on initial commit
Change-Id: I27b13510eb6756da21d0d359d76031da4a875e28
2012-10-08 00:31:26 +02:00
Robin Rosenberg 45edb41a9e Fix for Iff768422c, use offset 0 when going back to work tree iterator
In Iff768422c the offset used for the content id was fixed to use  the
offset that applied to the dircache iterator. Unfortunately the index
for the dircache content id offset stuck for entries that were not in
the index. Few caller probably cared about that, unless it actually
caused an ArrayIndexOutOfBoundsException.

Change-Id: Ic9f0e77c8ea3a0770d88565e94392e76853e3006
2012-10-06 13:08:16 +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 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
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 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 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
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
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
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
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
Tommi Siivola 0e56f34752 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>
2012-09-12 13:11:57 +03:00
Jason Pyeron 79d3dd8391 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>
2012-09-10 23:50:10 +02:00
Robin Rosenberg 833fd09442 Ignore non-commit refs when in RevWalkUtils.findBranchesReachableFrom
This methods is for finding branches only.

Change-Id: Ic68b5295ff814401890f0592ae95851554706ca6
2012-09-08 12:08:07 +02:00