]> source.dussan.org Git - jgit.git/log
jgit.git
13 years agoPrepare post v1.1.0.201109151100-r build 54/4254/1 stable-1.1
Matthias Sohn [Thu, 15 Sep 2011 19:51:23 +0000 (21:51 +0200)]
Prepare post v1.1.0.201109151100-r build

Change-Id: Ib099ec93d8243b238641d79328216874532ab5eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoJGit v1.1.0.201109151100-r 50/4250/1 v1.1.0.201109151100-r
Matthias Sohn [Thu, 15 Sep 2011 15:28:38 +0000 (17:28 +0200)]
JGit v1.1.0.201109151100-r

Change-Id: Iadcec7e5973600e005cbdeb837fa197d3ae2ea86
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoAllow commit when submodule changes are present 94/4194/4
Robin Rosenberg [Sun, 4 Sep 2011 14:34:15 +0000 (16:34 +0200)]
Allow commit when submodule changes are present

We do not yet check or validate submodules, but can accept that
someone staged a change in a submodule with other tools.

Change-Id: I642ede382314bfbd1892dd509a2222885cc5350a
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
13 years agoIgnore submodule on checkout instead of deleting it 92/4192/5
Robin Rosenberg [Sat, 3 Sep 2011 20:54:37 +0000 (22:54 +0200)]
Ignore submodule on checkout instead of deleting it

The purpose of this commit is to prevent destruction of
submodules on checkout from a tree with a submodule to
another. For consistency we handle the reverse case too,
when we checkout a branch that has a submodule and the
submodule directory exists. And finally we ignore the
case where the submodule changes.

We do not update the submodules, we just try to ignore
them harder.

Bug: 356664
Change-Id: I202c695a57af99b13d0d7220803fd08def3d9b5e
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
13 years agocleanup: Reuse local variable for current DirCacheEntry 01/4201/2
Robin Rosenberg [Sat, 3 Sep 2011 21:55:11 +0000 (23:55 +0200)]
cleanup: Reuse local variable for current DirCacheEntry

Since we already have assigned i.getDirCacheEntry() to dce,
use dce instead.

Change-Id: I107713ad0b356516d75c29203f945b056bad3ac7
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
13 years agoPrepare post v1.1.0.201109071825-rc3 builds 89/4189/1
Matthias Sohn [Wed, 7 Sep 2011 23:50:41 +0000 (01:50 +0200)]
Prepare post v1.1.0.201109071825-rc3 builds

Change-Id: I1244f6639263d156a6f9e4530167e5eb1826a535
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoJGit v1.1.0.201109071825-rc3 87/4187/1 v1.1.0.201109071825-rc3
Matthias Sohn [Wed, 7 Sep 2011 22:36:30 +0000 (00:36 +0200)]
JGit v1.1.0.201109071825-rc3

Change-Id: I1b989d3101272632eacabe25a0b111ad0ff5bb3b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoUse commit message best practices for Mylyn Commit template 59/4159/1
Matthias Sohn [Mon, 5 Sep 2011 21:57:21 +0000 (23:57 +0200)]
Use commit message best practices for Mylyn Commit template

We should use a template for Mylyn commit messages that matches with our
guidelines for commit messages.

http://wiki.eclipse.org/EGit/Contributor_Guide#Commit_message_guidelines

Bug: 337401
Change-Id: I05812abf0eb0651d22c439142640f173fc2f2ba0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoFix the names in the reflog for checkouts 39/4139/2
Robin Rosenberg [Sun, 4 Sep 2011 09:12:49 +0000 (11:12 +0200)]
Fix the names in the reflog for checkouts

We were diverging from the reference implementation. Always use the
ref we checkout to as the to-branch the reflog and avoid the
refs/heads both in the from-name and to-name.

Change-Id: Id973d9102593872e4df41d0788f0eb7c7fd130c4
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoAdd a helper for parsing branch switch info out of a reflog entry 38/4138/2
Robin Rosenberg [Sun, 4 Sep 2011 09:10:47 +0000 (11:10 +0200)]
Add a helper for parsing branch switch info out of a reflog entry

Change-Id: I91c7e08c4afd2562df2226887a933d93c78a0371
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoRemove workarounds for fixed Tycho bugs 48/4148/1
Matthias Sohn [Wed, 31 Aug 2011 07:36:48 +0000 (09:36 +0200)]
Remove workarounds for fixed Tycho bugs

This removes the workaround for Tycho bug
- http://issues.sonatype.org/browse/TYCHO-313
which has been fixed.

Change-Id: I54a8de885ae3e6c45a778171dad6f6e5e9322114
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoDefine os/ws/arch environments for tycho build 88/4088/3
Matthias Sohn [Tue, 30 Aug 2011 23:45:22 +0000 (01:45 +0200)]
Define os/ws/arch environments for tycho build

Explicitly define os/ws/arch environments for
target-platform-configuration to make build platform
independent.

Change-Id: If43f5ee573c9abaa0359ea2386477b379012e834
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years ago[blame] Reset rename detector before computing renames. 18/4118/1
Kevin Sawicki [Thu, 1 Sep 2011 20:29:43 +0000 (13:29 -0700)]
[blame] Reset rename detector before computing renames.

Bug: 354507
Change-Id: I5e9c65a082d9dee1e87536c5cf2a8de75efa6a33
Signed-off-by: Kevin Sawicki <kevin@github.com>
13 years agoPrepare post-v1.1.0.201109011030-rc2 builds 08/4108/1
Matthias Sohn [Thu, 1 Sep 2011 15:36:10 +0000 (17:36 +0200)]
Prepare post-v1.1.0.201109011030-rc2 builds

Change-Id: I8dda83cdbe88beba4a480df9846848bf3aceb9e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoJGit v1.1.0.201109011030-rc2 07/4107/1 v1.1.0.201109011030-rc2
Matthias Sohn [Thu, 1 Sep 2011 14:38:13 +0000 (16:38 +0200)]
JGit v1.1.0.201109011030-rc2

Change-Id: Ie6d65fe45ad92c813ce3a227729aa43681922249
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoUse the appropriate constant for ".git" 77/4077/3
Robin Rosenberg [Sat, 27 Aug 2011 14:58:26 +0000 (16:58 +0200)]
Use the appropriate constant for ".git"

We have two constants with the same content. DOT_GIT is intended
for the git repository below the work tree, while DOT_GIT_EXT is
the ".git" directory extension usually associated with bare
repositories.

Change-Id: I0946b4beb2d1c3af289ddbbb5641d2f4e4c49d3f
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
13 years agoTolerate zlib deflation with window size < 32Kb 71/4071/1
Roberto Tyley [Thu, 25 Aug 2011 21:25:10 +0000 (22:25 +0100)]
Tolerate zlib deflation with window size < 32Kb

JGit currently identifies loose objects as 'corrupt' if they've been
deflated using a window size less than 32Kb, because the
isStandardFormat() function doesn't recognise the header
byte as a zlib header. This patch makes the method tolerant of
all valid window sizes (15-bit to 8-bit) - but doesn't sacrifice
it's accuracy in distingushing the standard loose-object format
from the experimental (now abandoned) format. It's based on a patch
which has been merged into C-Git master branch:

https://github.com/git/git/commit/7f684a2aff636f44a506

On memory constrained systems zlib may use a much smaller window
size - working on Agit, I found that Android uses a 4KB window;
giving a header byte of 0x48, not 0x78. Consequently all loose
objects generated by the Android platform appear 'corrupt' :(

It might appear that this patch changes isStandardFormat() to the
point where it could incorrectly identify the experimental format as
the standard one, but the two criteria (bitmask & checksum) can only
give a false result for an experimental object where both of the
following are true:

1) object size is exactly 8 bytes when uncompressed (bitmask)
2) [single-byte in-pack git type&size header] * 256
   + [1st byte of the following zlib header] % 31 = 0 (checksum)

As it happens, for all possible combinations of valid object type
(1-4) and window bits (0-7), the only time when the checksum will be
divisible by 31 is for 0x1838 - ie object type *1*, a Commit - which,
due the fields all Commit objects must contain, could never be as
small as 8 bytes in size.

Given this, the combination of the two criteria (bitmask & checksum)
always correctly determines the buffer format, and is more tolerant
than the previous version.

References:

Android uses a 4KB window for deflation:
http://android.git.kernel.org/?p=platform/libcore.git;a=blob;f=luni/src/main/native/java_util_zip_Deflater.cpp;h=c0b2feff196e63a7b85d97cf9ae5bb2583409c28;hb=refs/heads/gingerbread#l53

Code snippet searching for false positives with the zlib checksum:
https://gist.github.com/1118177

Change-Id: Ifd84cd2bd6b46f087c9984fb4cbd8309f483dec0

13 years agoMerge "Unwind loop that iterates over fetch connection refs."
Stefan Lay [Thu, 25 Aug 2011 15:09:52 +0000 (11:09 -0400)]
Merge "Unwind loop that iterates over fetch connection refs."

13 years agoReassign symbolic ref list after calling put. 66/4066/1
Kevin Sawicki [Wed, 24 Aug 2011 20:22:05 +0000 (13:22 -0700)]
Reassign symbolic ref list after calling put.

This is required since RefList.put returns a new RefList.

Change-Id: I717d75d6f6154a6e0dc7cde3b72b0a59c68d955c
Signed-off-by: Kevin Sawicki <kevin@github.com>
13 years agoMerge "Fix boxing warnings in PushProcessTest"
Christian Halstrick [Wed, 24 Aug 2011 14:15:36 +0000 (10:15 -0400)]
Merge "Fix boxing warnings in PushProcessTest"

13 years agoFix boxing warnings in PushProcessTest 64/4064/1
Tomasz Zarna [Wed, 24 Aug 2011 13:40:48 +0000 (15:40 +0200)]
Fix boxing warnings in PushProcessTest

Change-Id: I5114968536853fb530b8a96c10def675e39c884f

13 years agoUse JGitText.refAlreadyExists instead of "ref exists" 57/4057/2
Tomasz Zarna [Wed, 24 Aug 2011 08:17:32 +0000 (10:17 +0200)]
Use JGitText.refAlreadyExists instead of "ref exists"

Change-Id: I113bcf82c6292db5269271f799d09c80acc40bcd

13 years agoUnwind loop that iterates over fetch connection refs. 56/4056/1
Kevin Sawicki [Mon, 22 Aug 2011 20:10:31 +0000 (13:10 -0700)]
Unwind loop that iterates over fetch connection refs.

Create separate loops based on whether the ref specs
collection is empty or not.

Change-Id: I2861b45fe083675e12ff47f591e104f8cf6dd216
Signed-off-by: Kevin Sawicki <kevin@github.com>
13 years agoThrow JGit exception when ResetCommand got wrong ref 79/3879/4
Christian Halstrick [Tue, 16 Aug 2011 13:15:01 +0000 (15:15 +0200)]
Throw JGit exception when ResetCommand got wrong ref

If the ResetCommand should reset to a invalid ref (e.g. HEAD in a repo
whithout a single commit) it was throwing an NPE. This is fixed now by
throwing a JGitInternalExcpeption. It would be nicer if we could throw
a InvalidRefException, but this would modify our API.

Bug: 339610
Change-Id: Iffcb4f2cca9f702176471d93c3a71e5cb3e700b1
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoImplement server support for shallow clones 20/1320/12
Matt Fischer [Tue, 27 Jul 2010 03:39:37 +0000 (22:39 -0500)]
Implement server support for shallow clones

This implements the server side of shallow clones only (i.e.
git-upload-pack), not the client side.

CQ: 5517
Bug: 301627
Change-Id: Ied5f501f9c8d1fe90ab2ba44fac5fa67ed0035a4
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoPackWriter: support excluding objects already in other packs 97/3997/8
Shawn O. Pearce [Tue, 16 Aug 2011 19:32:10 +0000 (12:32 -0700)]
PackWriter: support excluding objects already in other packs

This can be useful when implementing garbage collection and there
are packs that should not be copied, such as huge packs that have
a sibling ".keep" file alongside of them.

Callers driving PackWriter need to initialize the list of packs not
to include objects from by passing each index to excludeObjects().

Change-Id: Id7f34df69df97be406bcae184308e92b0e8690fd
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoFix ClassCastException in MergeCommand 60/3860/5
Denys Digtiar [Mon, 18 Jul 2011 05:33:30 +0000 (08:33 +0300)]
Fix ClassCastException in MergeCommand

Test was added which reproduce the ClassCastException when ours or
theirs merge strategy is set to MergeCommand. Merger and MergeCommand
were updated in order to avoid exception.

Change-Id: I4c1284b4e80d82638d0677a05e5d38182526d196
Signed-off-by: Denys Digtiar <duemir@gmail.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoAdd ListTagCommand to JGit API 01/3901/3
Ketan Padegaonkar [Mon, 23 May 2011 06:36:52 +0000 (12:06 +0530)]
Add ListTagCommand to JGit API

Bug: 355246
Change-Id: I11e019f3c19b4340ac7160ac8fcbadd52499d322
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoMerge "Add DeleteTagCommand to JGit API"
Chris Aniszczyk [Sun, 21 Aug 2011 20:24:23 +0000 (16:24 -0400)]
Merge "Add DeleteTagCommand to JGit API"

13 years agoAdd DeleteTagCommand to JGit API 20/4020/2
Tomasz Zarna [Wed, 17 Aug 2011 13:12:07 +0000 (15:12 +0200)]
Add DeleteTagCommand to JGit API

Bug: 353226
Change-Id: I54ae237cab792742333a249eb5a774d5e1775af8
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoMerge "PackWriter: Make want/have actual sets"
Christian Halstrick [Thu, 18 Aug 2011 07:43:38 +0000 (03:43 -0400)]
Merge "PackWriter: Make want/have actual sets"

13 years agoUse HEAD as default ref for RefLogCommand. 23/4023/4
Kevin Sawicki [Wed, 17 Aug 2011 15:56:16 +0000 (08:56 -0700)]
Use HEAD as default ref for RefLogCommand.

This mirrors the default command-line behavior.

Change-Id: I4f819410fa6df3064c560beb3184b61fd7bb1f15
Signed-off-by: Kevin Sawicki <kevin@github.com>
13 years agoMerge "Adds DiffEntry.scan(TreeWalk, boolean) method"
Matthias Sohn [Wed, 17 Aug 2011 11:31:54 +0000 (07:31 -0400)]
Merge "Adds DiffEntry.scan(TreeWalk, boolean) method"

13 years agoAdds DiffEntry.scan(TreeWalk, boolean) method 19/3819/10
Dariusz Luksza [Wed, 17 Aug 2011 10:43:35 +0000 (12:43 +0200)]
Adds DiffEntry.scan(TreeWalk, boolean) method

Adds method into DiffEntry class that allows to specify whether changed
trees are included in scanning result list. By default changed trees
aren't added, but in some cases having changed tree would be useful.

Also adds check for tree count in TreeWalk and when it is different from
two it will thrown an IllegalArgumentException.

This change is required by egit
I7ddb21e7ff54333dd6d7ace3209bbcf83da2b219

Change-Id: I5a680a73e1cffa18ade3402cc86008f46c1da1f1
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoFix typo in IndexDiff.getModified() comment. 15/4015/1
Kevin Sawicki [Tue, 16 Aug 2011 20:22:42 +0000 (13:22 -0700)]
Fix typo in IndexDiff.getModified() comment.

Removes an extra instance of the word 'on'.

Change-Id: Ie5f137f0dda440f5879f6d5c62ebce0431530ad7
Signed-off-by: Kevin Sawicki <kevin@github.com>
13 years agoPackWriter: Make want/have actual sets 99/3999/4
Shawn O. Pearce [Tue, 16 Aug 2011 19:18:39 +0000 (12:18 -0700)]
PackWriter: Make want/have actual sets

During parsing these are used with contains(). If they are a List
type, the contains operation is not efficient. Some callers such
as UploadPack often pass a List here, so convert to Set when the
type isn't efficient for contains().

Change-Id: If948ae3bf1f46e756bd2d5db14795e12ba7a6207
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoMerge "Add DiffCommand to JGit API"
Christian Halstrick [Tue, 16 Aug 2011 12:25:46 +0000 (08:25 -0400)]
Merge "Add DiffCommand to JGit API"

13 years agoAdd DiffCommand to JGit API 19/3919/2
Tomasz Zarna [Tue, 16 Aug 2011 09:47:55 +0000 (11:47 +0200)]
Add DiffCommand to JGit API

Bug: 334766
Change-Id: Iea74c599a956a058608e424d0274f879bc2f064a

13 years agoMerge changes I1ca7acb4,Ia41b7a1c,I33b65286,Ie2823724,I6b65bfb4
Shawn O. Pearce [Sun, 14 Aug 2011 22:51:58 +0000 (18:51 -0400)]
Merge changes I1ca7acb4,Ia41b7a1c,I33b65286,Ie2823724,I6b65bfb4

* changes:
  DHT: Change DhtReadher caches to be dynamic by workload
  DHT: Use a proper HashMap for RecentChunk lookups
  DHT: Always have at least one recent chunk in DhtReader
  DHT: Fix NPE during prefetch
  DHT: Drop leading hash digits from row keys

13 years agoRevert "PackWriter: Do not delta compress already packed objects" 96/3996/1
Shawn O. Pearce [Sun, 14 Aug 2011 00:01:24 +0000 (17:01 -0700)]
Revert "PackWriter: Do not delta compress already packed objects"

This reverts commit 67b064fc9fa7418fab83957b4f4e4baf9c6e08be.

The "tiny optimization" introduced by 67b0 turns out to have a big
savings on wall-clock time when the object store is very slow (e.g.
the DHT support in JGit), but comes with a much bigger penalty in
space used by the output stream.  CGit packed with 67b0 enabled is
7 MiB larger than it should be (36 MiB rather than 28/29 MiB).  The
much bigger Linux kernel repository gained over 200 MiB, though some
of this may have been caused by a smaller window setting.

Revert this patch as PackWriter should be optimizing for space used
rather than time spent, since its primary use is network transfer, and
that isn't free.

Change-Id: I7413a9ef89762208159b4a1adc5a22a4c9245611
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoSpeed up ObjectWalk by 6235 objects/sec 78/3978/2
Shawn O. Pearce [Mon, 8 Aug 2011 22:11:54 +0000 (15:11 -0700)]
Speed up ObjectWalk by 6235 objects/sec

The "Counting objects" phase of packing is the most time consuming
part for any server providing access to Git repositories. Scanning
through the entire project history, including every revision of
every tree that has ever existed is expensive and takes an incredible
amount of CPU time.

Inline the tree parsing logic, unroll a number of loops, and setup
to better handle the common case of seeing another occurrence of
an object that was already marked SEEN.

This change boosts the "Counting objects" phase when JGit is acting
as a server and is packing the linux-2.6 repository for its client.
Compared to CGit on the same hardware, a JGit daemon server is now
21883 objects/sec faster:

CGit:
  Counted 2058062 objects in 38981 ms at 52796.54 objects/sec
  Counted 2058062 objects in 38920 ms at 52879.29 objects/sec
  Counted 2058062 objects in 39059 ms at 52691.11 objects/sec

JGit (before):
  Counted 2058062 objects in 31529 ms at 65275.21 objects/sec
  Counted 2058062 objects in 30359 ms at 67790.84 objects/sec
  Counted 2058062 objects in 30033 ms at 68526.69 objects/sec

JGit (this commit):
  Counted 2058062 objects in 28726 ms at 71644.57 objects/sec
  Counted 2058062 objects in 27652 ms at 74427.24 objects/sec
  Counted 2058062 objects in 27528 ms at 74762.50 objects/sec

Above the first run was a "cold server". For JGit the JVM had just
started up with `jgit daemon`, and for CGit we hadn't touched the
repository "recently" (but it was certainly in kernel buffer cache).
The second and third runs were against the running JGit JVM, allowing
timing tests to better reflect the benefits of JGit's pack and index
caching, as well as any optimizations the JIT may have performed.

The timings are fair.  CGit is opening, checking and mmap'ing both
the pack and index during the timer.  JGit is opening, checking
and malloc+read'ing the pack and index data into its Java heap
during the timer. Both processes are walking the same graph space,
and are computing the "path hash" necessary to sort objects in the
object table for delta compression.  Since this commit only impacts
the "Counting objects" phase, delta compression was obviously not
included in the timings and JGit may still be performing delta
compression slower than CGit, resulting in an overall slower server
experience for clients.

Change-Id: Ieb184bfaed8475d6960a494b1f3c870e0382164a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoMerge "PackWriter: Only search for base objects on thin packs"
Shawn O. Pearce [Sat, 13 Aug 2011 21:33:18 +0000 (17:33 -0400)]
Merge "PackWriter: Only search for base objects on thin packs"

13 years agoblame: Implement blame on the command line 69/3569/8
Shawn O. Pearce [Sun, 29 May 2011 21:12:37 +0000 (14:12 -0700)]
blame: Implement blame on the command line

Command line options match the C implementation of `git blame` as
closely as possible, making for a pretty complete tool.

Change-Id: Ie1bd172ad9de586c3b60f0ee4a77a8f047364882
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoMerge "Ignore missing MERGE_MSG when deleting MERGE_MSG"
Shawn Pearce [Sat, 13 Aug 2011 21:08:40 +0000 (17:08 -0400)]
Merge "Ignore missing MERGE_MSG when deleting MERGE_MSG"

13 years agoMerge "Correct comment on CloneCommand.setRemote method."
Shawn Pearce [Sat, 13 Aug 2011 21:00:29 +0000 (17:00 -0400)]
Merge "Correct comment on CloneCommand.setRemote method."

13 years agoMerge "Fix jgit rev-list --objects master"
Shawn O. Pearce [Sat, 13 Aug 2011 20:59:52 +0000 (16:59 -0400)]
Merge "Fix jgit rev-list --objects master"

13 years agoMerge "Fix reading of ref names containing characters that sort before /"
Robin Rosenberg [Wed, 10 Aug 2011 18:40:25 +0000 (14:40 -0400)]
Merge "Fix reading of ref names containing characters that sort before /"

13 years agoMerge "Fix offset64 creation for objects at 2 GiB"
Robin Rosenberg [Wed, 10 Aug 2011 18:39:30 +0000 (14:39 -0400)]
Merge "Fix offset64 creation for objects at 2 GiB"

13 years agoAdd isSuccessful to MergeStatus, RebaseResult.Status and PullResult 49/3949/3
Robin Stocker [Tue, 9 Aug 2011 21:31:50 +0000 (23:31 +0200)]
Add isSuccessful to MergeStatus, RebaseResult.Status and PullResult

This is useful when the result needs to be displayed and it's only of
interest if the operation was successful or not (in egit, it could be
used in MultiPullResultDialog).

Change-Id: Icfc9a9c76763f8a777087a1262c8d6ad251a9068
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoFix offset64 creation for objects at 2 GiB 69/3969/3
Shawn O. Pearce [Sat, 6 Aug 2011 01:18:16 +0000 (18:18 -0700)]
Fix offset64 creation for objects at 2 GiB

The offset32 format is used for objects <= 2^31-1, while the offset64
format is used for all other objects.  This condition was missing
the = needed to ensure an object placed exactly at 2^31 would have
its 64 bit offset in the index.

Change-Id: I293fac0e829c9baa12cb59411dffde666051d6c5
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoPackWriter: Only search for base objects on thin packs 77/3977/1
Shawn O. Pearce [Mon, 8 Aug 2011 15:50:13 +0000 (08:50 -0700)]
PackWriter: Only search for base objects on thin packs

A non-thin pack does not need to worry about preferred bases, the pack
will be self-contained and all required delta base objects will appear
within the pack itself. Obtaining the path buffer and length from the
ObjectWalk to build the preferred base table is "expensive", so avoid
the cost unless a thin pack is being constructed.

Change-Id: I16e30cd864f4189d4304e7957a7cd5bdb9e84528
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoFix jgit rev-list --objects master 76/3976/1
Shawn O. Pearce [Mon, 8 Aug 2011 15:31:30 +0000 (08:31 -0700)]
Fix jgit rev-list --objects master

This flag was not being honored due to a bug in createWalk().
argWalk is always non-null when there are commits passed in
on the command line. If --objects was specified, always make
a new ObjectWalk for the actual execution.

Change-Id: I6e1a1636f2634605d86671a83766cc1c42939821
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoMerge changes I58110f17,I440baa64,Ic77dcac5
Shawn O. Pearce [Sat, 6 Aug 2011 01:21:10 +0000 (21:21 -0400)]
Merge changes I58110f17,I440baa64,Ic77dcac5

* changes:
  PackWriter: Skip progress messages on fast operations
  IndexPack: Defer the "Resolving deltas" progress meter
  IndexPack: Fix "Resolving deltas" progress meter

13 years agoCorrect comment on CloneCommand.setRemote method. 64/3964/2
Kevin Sawicki [Fri, 5 Aug 2011 18:02:10 +0000 (11:02 -0700)]
Correct comment on CloneCommand.setRemote method.

The previous comment stated that the value set was used
to keep track of the branch in the remote repository
which was incorrect.

Updated the method comment to match the format used
for the PushCommand.setRemote and FetchCommand.setRemote
methods.

Change-Id: I11b81eb3125958af29247b485da56fd88c3bfdf5
Signed-off-by: Kevin Sawicki <kevin@github.com>
13 years agoReuse ObjectReader for all objects touched during checkout 09/3809/5
Matthias Sohn [Tue, 2 Aug 2011 15:54:20 +0000 (17:54 +0200)]
Reuse ObjectReader for all objects touched during checkout

Bug: 349361
Change-Id: I61ffcb7694eb8b99ebaf4d0d0acd63e0ee91bcb3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
13 years agoDon't hard-code section names, use ConfigConstants instead 47/3947/2
Tomasz Zarna [Tue, 2 Aug 2011 14:19:09 +0000 (16:19 +0200)]
Don't hard-code section names, use ConfigConstants instead

Change-Id: Ie2dde43da491fa27b25a2ad8014866d77d484b24
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoPackWriter: Skip progress messages on fast operations 33/3933/2
Shawn O. Pearce [Wed, 27 Jul 2011 19:10:19 +0000 (12:10 -0700)]
PackWriter: Skip progress messages on fast operations

If the "Finding sources" phase will complete in <1 second with no
delta compression enabled, don't bother showing the progress meter for
this phase.  Small repositories on the local filesystem tend to rip
through this phase always subsecond and the ProgressMonitor display
can actually slow the operation down.

If delta compression is enabled, there are two phases that may run
very quickly. Set the timer to 500 milliseconds instead, reducing the
risk that the user has to wait longer than 1 second before any sort of
output from the packer occurs.

Change-Id: I58110f17e2a5ffa0134f9768b94804d16bbb8399
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoIndexPack: Defer the "Resolving deltas" progress meter 32/3932/2
Shawn O. Pearce [Wed, 27 Jul 2011 18:59:31 +0000 (11:59 -0700)]
IndexPack: Defer the "Resolving deltas" progress meter

If delta resolution completes in < 1000 milliseconds, don't bother
showing the progress meter. This is actually very common for a Gerrit
Code Review server, where the client is probably sending 1 commit and
only a few trees/blobs modified... and the base objects are hot in the
process buffer cache.

The 1000 millisecond delay is just a guess at a reasonable time to wait.

Change-Id: I440baa64ab0dfa21be61deae8dcd3ca061bed8ce
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoIndexPack: Fix "Resolving deltas" progress meter 31/3931/2
Shawn O. Pearce [Wed, 27 Jul 2011 18:54:11 +0000 (11:54 -0700)]
IndexPack: Fix "Resolving deltas" progress meter

This progress meter never reached 100% as it did not update while
resolving the external bases in thin packs.

Instead of updating in batches at the top level, update once per delta
that is resolved. The batching progress meter type should smooth out
the frequent updates to an update rate that is more reasonable to send
to the UI, while also ensuring a successful pack parse always reaches
100% deltas resolved.

Change-Id: Ic77dcac542cfa97213a6b0194708f9d3c256d223
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoMake PackReverseIndex a public structure 27/3927/2
Shawn O. Pearce [Wed, 29 Jun 2011 16:45:22 +0000 (09:45 -0700)]
Make PackReverseIndex a public structure

Repository inspection tools may find building a reverse index on a
pack useful, as they can then locate an object by offset. As both
C Git and JGit sometimes produce error messages with the offset
rather than the SHA-1, it may be useful to expose this type.

Change-Id: I487bf32e85a8985cf8ab382d4c82fcbe1fc7da6c

13 years agoMake lookup methods on PackIndex public 29/3929/2
Shawn O. Pearce [Wed, 29 Jun 2011 16:54:07 +0000 (09:54 -0700)]
Make lookup methods on PackIndex public

There isn't a good reason to hide all of these as package-private.
Make them public so applications can inspect pack files.

Change-Id: Ia418daf65d63e9e015b8dafdf3d06a1ed91d190b

13 years agoPackIndex: Support reading from any InputStream 26/3926/2
Shawn O. Pearce [Wed, 29 Jun 2011 16:21:00 +0000 (09:21 -0700)]
PackIndex: Support reading from any InputStream

Change-Id: If065a9e33a8f3a03e9758eb7612af2fc460c87e5
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoAdd String form of PackInvalidException constructor 28/3928/2
Shawn O. Pearce [Wed, 29 Jun 2011 16:51:54 +0000 (09:51 -0700)]
Add String form of PackInvalidException constructor

This way the path can be supplied as a string, without first
converting to a java.io.File.

Change-Id: I54d9bb9867556cd98b378c0762054b31497459cb

13 years agoAdd copy constructor to PackConfig 24/3924/1
Shawn O. Pearce [Wed, 27 Jul 2011 13:34:52 +0000 (06:34 -0700)]
Add copy constructor to PackConfig

Some embeddings of UploadPack (e.g. Gerrit Code Review) set their own
PackConfig from a server-wide configuration, overriding any JGit
defaults or settings that may exist at the local repository level.

Make a copy constructor form of PackConfig so this server-wide
configuration object can be copied and then merged with repository
specific configuration data.

Change-Id: I4463c95aeaf7d6536c3ab132dec9c50ee528d9e0
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoDon't close ObjectDatabase after parsing pack 23/3923/1
Shawn O. Pearce [Fri, 15 Jul 2011 23:28:26 +0000 (16:28 -0700)]
Don't close ObjectDatabase after parsing pack

The cached object databases should not require a close to release
their cached resources. Most object databases just return their
own reference for newCachedDatabase(), so a close() here kills
the real database's internal caches, and possibly underlying files,
resulting in poor performance for the callers of PackParser like
ReceivePack or FetchProcess trying to then go look up objects that
were just parsed, or that current references point to.

Change-Id: Ia4a239093866e5b9faf82744f729fb73f4373f1a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoFix reading of ref names containing characters that sort before / 18/3718/3
Robin Rosenberg [Sun, 12 Jun 2011 22:20:51 +0000 (00:20 +0200)]
Fix reading of ref names containing characters that sort before /

A set of ref names like ('a/b' and 'a+b') would cause the RefDirectory
to think that the set of refs have changed because it traversed the
'a' directory in the subtree before looking at 'a+b', but it then
compared with the know refs which are sorted with 'a+b' first.

Fix this by traversing the refs tree in another order. Treat a directory
as if they ends with a '/' before deciding on the order to traverse
the refs tree.

Bug: 348834
Change-Id: I23377f8df00c7252bf27dbcfba5da193c5403917
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
13 years agoIgnore missing MERGE_MSG when deleting MERGE_MSG 00/3900/1
Jens Baumgart [Tue, 19 Jul 2011 15:31:50 +0000 (17:31 +0200)]
Ignore missing MERGE_MSG when deleting MERGE_MSG

Repository.writeMergeCommitMsg(null) no longer fails if the MERGE_MSG
file is missing. This was done to avoid CommitCommand to fail in case of
a missing MERGE_MSG file.

Bug: 352243
Change-Id: Iddf43533d133f8f22199ed6e2393a552670e7d1f
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
13 years agoMerge doesn't remove empty folders 56/3756/2
Tomasz Zarna [Mon, 20 Jun 2011 16:17:56 +0000 (18:17 +0200)]
Merge doesn't remove empty folders

Bug: 349848
Change-Id: I2aa5a1a7259889428e4845046b900538262f3c84

13 years agoAdd support for reseting on directories 13/3713/4
Dariusz Luksza [Wed, 6 Jul 2011 22:27:14 +0000 (00:27 +0200)]
Add support for reseting on directories

Reset command should works recursively and allows reset all changed
files in given directory.

Bug: 348524
Change-Id: I441db34f226be36548c61cef77958995971498de
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoFixed creation of branch from a tag 16/3816/3
Sasa Zivkov [Tue, 5 Jul 2011 12:06:49 +0000 (14:06 +0200)]
Fixed creation of branch from a tag

Creation of a branch X from an annotated tag, as the starting point,
resulted into .git/refs/heads/X containing the ID of the annotated tag
instead of the ID of the tagged commit.

This fix peels the tag ref before using it as the starting point for
the newly created branch.

Bug: 340836
Change-Id: I01c7325770ecb37f5bf8ddb2a22f802466524f24
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoMerge "Merge in JGit CLI is missing break statement"
Chris Aniszczyk [Tue, 12 Jul 2011 13:53:51 +0000 (09:53 -0400)]
Merge "Merge in JGit CLI is missing break statement"

13 years agoMerge in JGit CLI is missing break statement 65/3865/2
Tomasz Zarna [Tue, 12 Jul 2011 09:51:03 +0000 (11:51 +0200)]
Merge in JGit CLI is missing break statement

Change-Id: I2095601b848e66e54d5dac828ef6ed1a4c5ae66c
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoCleanup directories leftover by test. 15/3815/5
Adrian Goerler [Thu, 7 Jul 2011 21:16:40 +0000 (23:16 +0200)]
Cleanup directories leftover by test.

Use the temporary file management from superclass.

Change-Id: I3042951dc21860b4b85dd72a6bf41ee7cfe2aba4
Signed-off-by: Adrian Goerler <adrian.goerler@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoCloning should fail when destination directory exists and is not empty 18/3518/8
Adrian Goerler [Wed, 6 Jul 2011 21:10:44 +0000 (23:10 +0200)]
Cloning should fail when destination directory exists and is not empty

When trying to clone into a folder that already contains a cloned
repository native git will fail with a message "fatal: destination path
'folder' already exists and is not an empty directory.". Now JGit will
also fail in this situation throwing a JGitInternalException.

The test case was provided by Tomasz Zarna.

Bug: 347852
Change-Id: If9e9919a5f92d13cf038dc470c21ee5967322dac
Also-by: Tomasz Zarna <Tomasz.Zarna@pl.ibm.com>
Signed-off-by: Adrian Goerler <adrian.goerler@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoDo not catch Exception in test cases 30/3830/2
Stefan Lay [Wed, 6 Jul 2011 11:36:57 +0000 (13:36 +0200)]
Do not catch Exception in test cases

Exception handling is already done by JUnit.

Change-Id: Ia25d768c311d384d728f281aced92f598e5e2041
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
13 years agoMerge "Cleanup curly braces"
Christian Halstrick [Wed, 6 Jul 2011 08:44:54 +0000 (04:44 -0400)]
Merge "Cleanup curly braces"

13 years agoCleanup curly braces 24/3824/1
Adrian Goerler [Wed, 6 Jul 2011 08:29:56 +0000 (10:29 +0200)]
Cleanup curly braces

Change-Id: I2de6439a3ad951a99d89e4aee02006c745d16510
Signed-off-by: Adrian Goerler <adrian.goerler@sap.com>
13 years agoMerge "Add lookup to remote config if the refSpec is not explicitly set"
Christian Halstrick [Wed, 6 Jul 2011 08:14:49 +0000 (04:14 -0400)]
Merge "Add lookup to remote config if the refSpec is not explicitly set"

13 years agoAdd lookup to remote config if the refSpec is not explicitly set 08/3808/3
Stefan Lay [Mon, 4 Jul 2011 11:20:51 +0000 (13:20 +0200)]
Add lookup to remote config if the refSpec is not explicitly set

If no refSpec is explicitly set, the PushCommand should first check the
remote config and then as a fallback use the current behavior.

Change-Id: I2bc648abc517b1d01b2de15d383423ace2081e72
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
13 years agoMerge "Enable PlotWalk to show additional refs"
Shawn Pearce [Fri, 1 Jul 2011 15:58:24 +0000 (11:58 -0400)]
Merge "Enable PlotWalk to show additional refs"

13 years agoEnable PlotWalk to show additional refs 01/3801/3
Stefan Lay [Fri, 1 Jul 2011 15:38:01 +0000 (17:38 +0200)]
Enable PlotWalk to show additional refs

Change-Id: Ic85f8859571dc2aef7f146ce56a6c9b8ec142e60
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
13 years agoMerge "Improve performance when writing trees and small blobs"
Shawn O. Pearce [Fri, 1 Jul 2011 15:04:41 +0000 (11:04 -0400)]
Merge "Improve performance when writing trees and small blobs"

13 years agoMerge "TemporaryBuffer: Fix reading from in-memory InputStream"
Shawn O. Pearce [Fri, 1 Jul 2011 14:55:16 +0000 (10:55 -0400)]
Merge "TemporaryBuffer: Fix reading from in-memory InputStream"

13 years agoMerge "Implement Serializable interface in PersonIdent class."
Shawn Pearce [Fri, 1 Jul 2011 14:55:02 +0000 (10:55 -0400)]
Merge "Implement Serializable interface in PersonIdent class."

13 years agoMerge "Fix compilation with Java 1.5"
Matthias Sohn [Fri, 1 Jul 2011 11:20:48 +0000 (07:20 -0400)]
Merge "Fix compilation with Java 1.5"

13 years agoImplement Serializable interface in PersonIdent class. 03/3803/1
Kevin Sawicki [Thu, 30 Jun 2011 16:38:43 +0000 (09:38 -0700)]
Implement Serializable interface in PersonIdent class.

Change-Id: I3229f4ec85e7604cb45642813757975b30f1227e
Signed-off-by: Kevin Sawicki <kevin@github.com>
13 years agoDirCacheCheckout: unlock DirCache in case of failure 99/3799/1
Jens Baumgart [Wed, 29 Jun 2011 12:18:00 +0000 (14:18 +0200)]
DirCacheCheckout: unlock DirCache in case of failure

DirCacheCheckout did not unlock the index if e.g. an IOException occured
during checkout.

Bug: 350677
Change-Id: Ie9fa09f7a404080da7cdccafb9be3a8c845e4869
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
13 years agoFix compilation with Java 1.5 95/3795/3
Carsten Pfeiffer [Wed, 29 Jun 2011 07:45:31 +0000 (09:45 +0200)]
Fix compilation with Java 1.5

Change-Id: I785f59fcf2018cd923d4d1617b923049dbde9809

13 years agoMerge "RFC: Ugly fix for i18n of metaVar CLI arguments"
Shawn Pearce [Fri, 24 Jun 2011 22:47:32 +0000 (18:47 -0400)]
Merge "RFC: Ugly fix for i18n of metaVar CLI arguments"

13 years agoImprove performance when writing trees and small blobs 78/3778/1
Shawn O. Pearce [Fri, 24 Jun 2011 19:55:19 +0000 (12:55 -0700)]
Improve performance when writing trees and small blobs

ObjectDirectoryInserter was always creating a temporary file,
writing the complete compressed contents of a tree, fsync()'ing
that to stable storage, and only then checking to see if there
was already an object with the same SHA-1 in the repository.

For commits this strategy makes some sense, the commit is very
unlikely to exist in the repository, as there are embedded times
and these change with each commit.

However for trees coming out of DirCache, it is more common for the
tree to already exist in the repository. Most subdirectories are
not modified in any given commit.  Doing all of this local file IO
for things that already exist is very slow.

Try to detect cases where the object is "small enough" that it can
be processed entirely in memory, and avoid doing disk IO entirely
if the object already exists.

Also increase the size of the output buffer for the deflation.
This should boost the average write(2) syscall size from 512 bytes
to 8192 bytes, making streaming of large compressed contents to
disk slightly more efficient.

Change-Id: I1d40364e8725468522435814631916d73174c92b
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoTemporaryBuffer: Fix reading from in-memory InputStream 77/3777/1
Shawn O. Pearce [Fri, 24 Jun 2011 19:35:19 +0000 (12:35 -0700)]
TemporaryBuffer: Fix reading from in-memory InputStream

I had the conditions wrong here, causing the in-memory InputStream
to always appear to be at EOF.

Change-Id: I6811d6187a34eaf1fd6c5002550d631decdfc391
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoAdd ReflogCommand 36/3636/3
Chris Aniszczyk [Sun, 19 Jun 2011 14:17:21 +0000 (09:17 -0500)]
Add ReflogCommand

Adds a git-reflog command and associated tests.

Bug: 347859
Change-Id: Iba146ac842cc9ca0be43d3381b4082c9e92bf56f
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoRefactor out ReflogEntry 55/3755/1
Chris Aniszczyk [Sun, 19 Jun 2011 13:58:25 +0000 (08:58 -0500)]
Refactor out ReflogEntry

It's useful to have ReflogEntry refactored out so it can be
used by clients via the JGit API.

Change-Id: I03044df9af9f9547777545b7c9b93bdf5f8b7cb5
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoRFC: Ugly fix for i18n of metaVar CLI arguments 58/3758/1
Robin Rosenberg [Sun, 19 Jun 2011 22:55:13 +0000 (00:55 +0200)]
RFC: Ugly fix for i18n of metaVar CLI arguments

This patch possibly ties to a specific version of args4j.

Bug: 318286
Change-Id: I05d4ecf6bd25deec7fb2efbfa61913f4ec4e04e5
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
13 years agoMerge changes Ie393fb8b,Ib11a077a
Robin Rosenberg [Fri, 17 Jun 2011 15:26:38 +0000 (11:26 -0400)]
Merge changes Ie393fb8b,Ib11a077a

* changes:
  Push errors back over sideband when possible
  Report progress while updating references

13 years agoFix IndexOutOfBoundsException when parsing PersonIdent 31/3731/1
Marc Strapetz [Tue, 14 Jun 2011 14:56:48 +0000 (16:56 +0200)]
Fix IndexOutOfBoundsException when parsing PersonIdent

IndexOutOfBoundsException could occur when parsing
PersonIdent for which no name is present, as part of a
RevCommit (nameB > 0).

13 years agoDHT: Change DhtReadher caches to be dynamic by workload 08/3708/1
Shawn O. Pearce [Fri, 10 Jun 2011 02:10:11 +0000 (19:10 -0700)]
DHT: Change DhtReadher caches to be dynamic by workload

Instead of fixing the prefetch queue and recent chunk queue as
different sizes, allow these to share the same limit but be scaled
based on the work being performed.

During walks about 20% of the space will be given to the prefetcher,
and the other 80% will be used by the recent chunks cache. This
should improve cases where there is bad locality between chunks.

During writing of a pack stream, 90-100% of the space should be
made available to the prefetcher, as the prefetch plan is usually
very accurate about the order chunks will be needed in.

Change-Id: I1ca7acb4518e66eb9d4138fb753df38e7254704d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoDHT: Use a proper HashMap for RecentChunk lookups 07/3707/1
Shawn O. Pearce [Fri, 10 Jun 2011 00:59:22 +0000 (17:59 -0700)]
DHT: Use a proper HashMap for RecentChunk lookups

A linear search is somewhat acceptable for only 4 recent chunks, but
a HashMap based lookup would be better. The table will have 16 slots
by default and given the hashCode() of ChunkKey is derived from the
SHA-1 of the chunk, each chunk will fall into its own bucket within
the table and thus evaluate only 1 entry during lookup instead of 4.

Some users may also want to devote more memory to the recent chunks,
in which case expanding this list to a longer length will help to
reduce chunk faults, but would increase search time. Using a HashMap
will help this code to scale to larger sizes better.

Change-Id: Ia41b7a1cc69ad27b85749e3b74cbf8d0aa338044
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoDHT: Always have at least one recent chunk in DhtReader 06/3706/1
Shawn O. Pearce [Fri, 10 Jun 2011 00:55:52 +0000 (17:55 -0700)]
DHT: Always have at least one recent chunk in DhtReader

The RecentChunks cache assumes there is always at least one recent
chunk in the maxSize that it receives from the DhtReaderOptions.
Ensure that is true by requiring the size to be at least 1.

Running with 0 recent chunk cache is very a bad idea, often
during commit walking the parents of a commit will be found
on the same chunk as the commit that was just accessed. In
these cases its a good idea to keep that last chunk around
so the parents can be quickly accessed.

Change-Id: I33b65286e8a4cbf6ef4ced28c547837f173e065d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoPush errors back over sideband when possible 58/3558/2
Shawn O. Pearce [Fri, 27 May 2011 20:35:18 +0000 (13:35 -0700)]
Push errors back over sideband when possible

If an internal exception occurs while packing and the request
needs to abort, the HTTP response might already be committed due
to progress message having already been delivered to the client.
This prevents UploadPackServlet from resetting the response and
sending back an HTTP 500 response.

Try to catch all exceptions and report internal errors over the
sideband stream or as an ERR command during the initial ACK/NAK
negotiation phase. This allows JGit to transmit an error message
that the user will receive on their console without needing to
worry about resetting the (already gone) HTTP response.

Change-Id: Ie393fb8bb55d2b79ab1276adf71c781c1807f9fe
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>