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

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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

11 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

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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"

11 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"

11 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

11 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

11 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

11 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

11 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."

11 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

11 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>
11 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>
11 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>
11 years agoMerge "Add isIndexLoaded() to DfsPackFile."
Shawn Pearce [Thu, 1 Nov 2012 17:07:23 +0000 (13:07 -0400)]
Merge "Add isIndexLoaded() to DfsPackFile."

11 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"

11 years agoAdd isIndexLoaded() to DfsPackFile. 67/8467/2
Colby Ranger [Thu, 1 Nov 2012 15:58:00 +0000 (08:58 -0700)]
Add isIndexLoaded() to DfsPackFile.

The method reports whether the index file for the pack has been loaded
and cached in memory.

Change-Id: Ifa8d63f737458e102cb3d28579c9711d46693d17

11 years agoAdd Javadoc description for packages 16/8416/2
Robin Stocker [Tue, 30 Oct 2012 14:24:56 +0000 (15:24 +0100)]
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>
11 years agoMerge "Refactor ResolveMergerTest to allow testing multiple strategies"
Chris Aniszczyk [Wed, 31 Oct 2012 00:00:14 +0000 (20:00 -0400)]
Merge "Refactor ResolveMergerTest to allow testing multiple strategies"

11 years ago[blame] Don't pass null to PersonIdent constructor 02/8402/1
Robin Stocker [Mon, 29 Oct 2012 19:48:38 +0000 (20:48 +0100)]
[blame] Don't pass null to PersonIdent constructor

The API was changed to not allow null values anymore with
I0ac994ae8e47789d38f7c6e6db55d482f0f1bac3, leading to an IAE.

Bug: 393054
Change-Id: If33560ae976b46a02ff75b2e4ec05c13a8ad2d41

11 years agoPull up method for creating DirCacheEntry into RepositoryTestCase 86/8386/1
Robin Stocker [Sun, 28 Oct 2012 13:25:11 +0000 (14:25 +0100)]
Pull up method for creating DirCacheEntry into RepositoryTestCase

Change-Id: I6e6522289553137df1a46ceeb52f461e9d25a290

11 years agoSuppress resource warnings with Java 7 90/7790/3
Robin Rosenberg [Wed, 10 Oct 2012 06:02:30 +0000 (08:02 +0200)]
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

11 years agoMerge "Extend Javadoc of CheckoutCommand and add examples"
Shawn Pearce [Thu, 25 Oct 2012 22:13:56 +0000 (18:13 -0400)]
Merge "Extend Javadoc of CheckoutCommand and add examples"

11 years agoMerge "Add a check in fstick that the reference file exists"
Shawn Pearce [Thu, 25 Oct 2012 22:01:04 +0000 (18:01 -0400)]
Merge "Add a check in fstick that the reference file exists"

11 years agoMerge "Fix for Iff768422c, use offset 0 when going back to work tree iterator"
Shawn Pearce [Thu, 25 Oct 2012 21:55:22 +0000 (17:55 -0400)]
Merge "Fix for Iff768422c, use offset 0 when going back to work tree iterator"

11 years agoAdd a check in fstick that the reference file exists 71/8071/7
Robin Rosenberg [Sat, 6 Oct 2012 10:56:00 +0000 (12:56 +0200)]
Add a check in fstick that the reference file exists

This helps avoiding some stupid thinkos.

Change-Id: I5b386cd9c6bf0e11f270bb2b8cfaac66ce9b341b

11 years agoMerge "Don't allow null name or e-mail in PersonIdent"
Shawn Pearce [Thu, 25 Oct 2012 21:19:15 +0000 (17:19 -0400)]
Merge "Don't allow null name or e-mail in PersonIdent"

11 years agoMerge "Fix Javadoc formatting of org.eclipse.jgit.diff package"
Shawn Pearce [Thu, 25 Oct 2012 21:16:27 +0000 (17:16 -0400)]
Merge "Fix Javadoc formatting of org.eclipse.jgit.diff package"

11 years agoMerge "Simplify push error message when ref already exists"
Shawn O. Pearce [Thu, 25 Oct 2012 21:15:02 +0000 (17:15 -0400)]
Merge "Simplify push error message when ref already exists"

11 years agoRefactor ResolveMergerTest to allow testing multiple strategies 72/8372/1
Christian Halstrick [Thu, 25 Oct 2012 15:45:57 +0000 (17:45 +0200)]
Refactor ResolveMergerTest to allow testing multiple strategies

By making use of JUnit Theories and Datapoints ResolveMergerTests is now
capable to run the tests against multiple Merge strategies.

Change-Id: Ifa0075e0a2aca7576ef268291b73fa2f4d79b591

11 years agoMerge "AbstractTreeIterator: Add toString with entry path"
Christian Halstrick [Mon, 22 Oct 2012 11:11:01 +0000 (07:11 -0400)]
Merge "AbstractTreeIterator: Add toString with entry path"

11 years agoStashCreateCommand: Abort in case of unmerged paths 97/8297/2
Robin Stocker [Mon, 22 Oct 2012 09:14:40 +0000 (11:14 +0200)]
StashCreateCommand: Abort in case of unmerged paths

Bug: 391861
Change-Id: I5f8ffe072c08c8ca2ca6be6b6afa67c8e16a63b6

12 years agoAbstractTreeIterator: Add toString with entry path 22/8322/1
Robin Stocker [Sat, 20 Oct 2012 18:11:34 +0000 (20:11 +0200)]
AbstractTreeIterator: Add toString with entry path

Helps when debugging tree walking code.

Change-Id: I7ba3846a028a1538787a7d4fbf50f7c487cae6c7

12 years agoUpdate packaging build to use Tycho 0.16 14/8314/1
Matthias Sohn [Fri, 19 Oct 2012 19:35:13 +0000 (21:35 +0200)]
Update packaging build to use Tycho 0.16

Change-Id: Ie5c2f9d4a3b64fc43d310bec45685970cb227237
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoExtend Javadoc of CheckoutCommand and add examples 59/8259/2
Robin Stocker [Wed, 17 Oct 2012 19:52:05 +0000 (21:52 +0200)]
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

12 years agoSimplify push error message when ref already exists 55/8255/2
Shawn O. Pearce [Wed, 17 Oct 2012 14:55:15 +0000 (07:55 -0700)]
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

12 years agoFix Javadoc formatting of org.eclipse.jgit.diff package 61/8261/1
Robin Stocker [Wed, 17 Oct 2012 20:09:16 +0000 (22:09 +0200)]
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

12 years agoUpdate jgit's last release version for API change reports 28/8228/1
Matthias Sohn [Tue, 16 Oct 2012 09:37:44 +0000 (11:37 +0200)]
Update jgit's last release version for API change reports

Change-Id: I04b1e8a2d3aa49c45bd7846fa87b9acfa57f8fda
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Add a hint on the purpose of JGitInternalException to the constructor"
Christian Halstrick [Sun, 14 Oct 2012 21:06:20 +0000 (17:06 -0400)]
Merge "Add a hint on the purpose of JGitInternalException to the constructor"

12 years agoAdd a hint on the purpose of JGitInternalException to the constructor 79/8079/3
Robin Rosenberg [Mon, 8 Oct 2012 04:27:30 +0000 (06:27 +0200)]
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

12 years agoRevWalk: Add link to parseHeaders/parseBody in Javadoc of lookupCommit 93/8193/1
Robin Stocker [Sat, 13 Oct 2012 19:25:29 +0000 (21:25 +0200)]
RevWalk: Add link to parseHeaders/parseBody in Javadoc of lookupCommit

Change-Id: I7765d1a69d19968ebad603025a9c686f17633ebd

12 years agoDon't allow null name or e-mail in PersonIdent 91/8191/1
Robin Stocker [Sat, 13 Oct 2012 16:38:51 +0000 (18:38 +0200)]
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

12 years agoMerge "Make BlameGenerator comments more clear"
Matthias Sohn [Tue, 9 Oct 2012 20:51:34 +0000 (16:51 -0400)]
Merge "Make BlameGenerator comments more clear"

12 years agoCommitCommand: Use original author on amend if author is not set 77/8077/2
Robin Stocker [Sun, 7 Oct 2012 15:18:58 +0000 (17:18 +0200)]
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

12 years agoCommitCommand: Don't allow amending on initial commit 76/8076/2
Robin Stocker [Sun, 7 Oct 2012 15:13:18 +0000 (17:13 +0200)]
CommitCommand: Don't allow amending on initial commit

Change-Id: I27b13510eb6756da21d0d359d76031da4a875e28

12 years agoMerge "Add --squash option to org.eclipse.jgit.pgm.Merge"
Matthias Sohn [Sun, 7 Oct 2012 21:52:58 +0000 (17:52 -0400)]
Merge "Add --squash option to org.eclipse.jgit.pgm.Merge"

12 years agoAdd --squash option to org.eclipse.jgit.pgm.Merge 56/7956/2
Tomasz Zarna [Sun, 7 Oct 2012 21:38:34 +0000 (23:38 +0200)]
Add --squash option to org.eclipse.jgit.pgm.Merge

Change-Id: Ifd20b6f4731cfa71319145cac7b464aa53db18b8

12 years agoFix for Iff768422c, use offset 0 when going back to work tree iterator 72/8072/2
Robin Rosenberg [Sat, 6 Oct 2012 11:08:16 +0000 (13:08 +0200)]
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

12 years agoFix unstable test 09/7909/6
Robin Rosenberg [Tue, 2 Oct 2012 10:45:29 +0000 (12:45 +0200)]
Fix unstable test

Add more time to a timestamp to safely go beyond the granularity of
the timestamp resolution of the file system. The lowest resolution we
know of is FAT with two second resolution. Then add some to make sure we
are above the limit.

Change-Id: I85c5b07dcdf2d80de41fe9b2354ccc888bad7f1e

12 years agoUpdate README 50/7950/2
Robin Stocker [Fri, 28 Sep 2012 21:21:22 +0000 (23:21 +0200)]
Update README

Extend introduction, update links and remove outdated information.

Change-Id: I29f4d72c980008b6bebe3b009d58c915cd091b9d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoFix compile error (method not available in 1.5) 25/7925/2
Markus Keller [Wed, 26 Sep 2012 22:17:53 +0000 (00:17 +0200)]
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>
12 years agoMerge "Remove unused import introduced with 8f706db5"
Robin Rosenberg [Wed, 26 Sep 2012 21:41:59 +0000 (17:41 -0400)]
Merge "Remove unused import introduced with 8f706db5"

12 years agoRevert "The constructor CmdLineException(String) is deprecated" 35/7935/2
Shawn O. Pearce [Wed, 26 Sep 2012 17:19:00 +0000 (10:19 -0700)]
Revert "The constructor CmdLineException(String) is deprecated"

This reverts commit 07f99362575f324e466d7f5ae49d5f8f69cf7a8a.

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

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