]> source.dussan.org Git - jgit.git/log
jgit.git
12 years agoMake sure all bytes are written to files on close, or get an error. 41/4841/3
Robin Rosenberg [Sun, 15 Jan 2012 10:22:52 +0000 (11:22 +0100)]
Make sure all bytes are written to files on close, or get an error.

Java's BufferedOutputStream swallows any errors that occur when flushing
the buffer in close().

This class overrides close to make sure an error during the final
flush is reported back to the caller.

Change-Id: I74a82b31505fadf8378069c5f6554f1033c28f9b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Resolve ~ with no trailing number as the first parent commit"
Robin Rosenberg [Sun, 15 Jan 2012 01:28:52 +0000 (20:28 -0500)]
Merge "Resolve ~ with no trailing number as the first parent commit"

12 years agoThrow API exception when LsRemoteCommand fails with TransportException 49/4949/3
Matthias Sohn [Sun, 15 Jan 2012 00:38:25 +0000 (01:38 +0100)]
Throw API exception when LsRemoteCommand fails with TransportException

In many cases applications want to handle TransportException hence
expose it as an API exception.

Change-Id: I64b885ecfb1a35bd93c89026c6298d1820ba69d0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoResolve ~ with no trailing number as the first parent commit 55/4955/6
Kevin Sawicki [Sat, 14 Jan 2012 23:34:18 +0000 (15:34 -0800)]
Resolve ~ with no trailing number as the first parent commit

This would previously throw a RevisionSyntaxException

Change-Id: I42b4988c7f6c6454e2ebda13914260e25ac1a889

12 years agoCannot commit -o file with only file permission change 51/4851/4
Robin Rosenberg [Sat, 7 Jan 2012 13:00:14 +0000 (14:00 +0100)]
Cannot commit -o file with only file permission change

Bug 345076
Change-Id: Ie64039793ab6ba4748731320399f03301b6282ec
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Provide helper for unlocking a file"
Matthias Sohn [Tue, 10 Jan 2012 17:24:49 +0000 (12:24 -0500)]
Merge "Provide helper for unlocking a file"

12 years agoProvide helper for unlocking a file 08/4908/4
Kevin Sawicki [Mon, 9 Jan 2012 16:46:13 +0000 (08:46 -0800)]
Provide helper for unlocking a file

This will allow recovery from a LockFailedException where
the file associated with an exception is passed to FileUtils.unlock
to attempt an unlock on the file so the operation can be retried

Change-Id: I580166d386126bfb54a318a65253070a6e325936

12 years agoAdd setter for ProgressMonitor to DiffCommand 34/4934/2
Tomasz Zarna [Mon, 9 Jan 2012 14:48:16 +0000 (15:48 +0100)]
Add setter for ProgressMonitor to DiffCommand

Change-Id: I34f8b77a461e165d7d624dbd9a6944feadc57b8e

12 years agoMerge "Add options for setting context lines and prefixes to DiffCommand"
Stefan Lay [Mon, 9 Jan 2012 12:06:59 +0000 (07:06 -0500)]
Merge "Add options for setting context lines and prefixes to DiffCommand"

12 years agoAdd options for setting context lines and prefixes to DiffCommand 90/4890/2
Tomasz Zarna [Mon, 9 Jan 2012 11:13:12 +0000 (12:13 +0100)]
Add options for setting context lines and prefixes to DiffCommand

Change-Id: I539f3531e94c11c0f0a3e7096c0eb1b1c309898a

12 years agoMerge "Add helper for determining if status is clean"
Christian Halstrick [Mon, 9 Jan 2012 11:13:12 +0000 (06:13 -0500)]
Merge "Add helper for determining if status is clean"

12 years agoNarrow exceptions declared by LsRemoteCommand 32/4932/7
Matthias Sohn [Sun, 8 Jan 2012 21:08:08 +0000 (13:08 -0800)]
Narrow exceptions declared by LsRemoteCommand

API commands either throw GitAPIException or JGitInternalException.

Also add missing javadoc and reduce nesting of catch blocks.

Change-Id: I9a3b302e1b3f373ee11a977a0e3d6213bfbd3cdf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Kevin Sawicki <kevin@github.com>
12 years agoMerge "Retain executable mode of existing files on Windows"
Robin Rosenberg [Sun, 8 Jan 2012 21:34:28 +0000 (16:34 -0500)]
Merge "Retain executable mode of existing files on Windows"

12 years agoMerge "Use constants from ConfigConstants in CoreConfig"
Matthias Sohn [Thu, 5 Jan 2012 15:15:55 +0000 (10:15 -0500)]
Merge "Use constants from ConfigConstants in CoreConfig"

12 years agoAdd helper for determining if status is clean 16/4916/1
Kevin Sawicki [Wed, 4 Jan 2012 00:48:01 +0000 (16:48 -0800)]
Add helper for determining if status is clean

This checks if all collections that Status exposes are
empty or not

Change-Id: I0c342ab70dc36c1fd70acb4f8a924bb207d62f47

12 years agoProvide file mode of paths in index from IndexDiff 04/4904/8
Kevin Sawicki [Tue, 3 Jan 2012 23:27:56 +0000 (00:27 +0100)]
Provide file mode of paths in index from IndexDiff

Change-Id: I1d543e2f721987114cc1e1cb0848c234470df794
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoUse constants from ConfigConstants in CoreConfig 13/4913/1
Kevin Sawicki [Tue, 3 Jan 2012 23:24:55 +0000 (15:24 -0800)]
Use constants from ConfigConstants in CoreConfig

Change-Id: Ic1253498ecdd7545c6b1f114f4c83a3b77273874

12 years agoRetain executable mode of existing files on Windows 28/4828/14
Kevin Sawicki [Tue, 3 Jan 2012 23:07:02 +0000 (15:07 -0800)]
Retain executable mode of existing files on Windows

Currently files in a repository marked as executable will have
that mode unset when modified and committed on systems that
do not support detection of this mode since the working tree
iterator will never report this mode for any entries.

This change updates WorkingTreeIterator to be able
to determine the target file mode to be used for the index
through consideration of the configured WorkingTreeOptions.

Bug: 364956
Change-Id: Iae496baa011b8a59d9329ec73615482b03d34a5a

12 years agoAdd support for cloning submodules to CloneCommand 00/4900/7
Kevin Sawicki [Mon, 2 Jan 2012 17:38:21 +0000 (09:38 -0800)]
Add support for cloning submodules to CloneCommand

Change-Id: Ib1f82206fa14be75e2080f95db9f2d178e876453

12 years agoExtend TransportCommand in submodule add/update commands 02/4902/2
Kevin Sawicki [Mon, 2 Jan 2012 17:40:53 +0000 (09:40 -0800)]
Extend TransportCommand in submodule add/update commands

This allows all the settings of a TransportCommand to be
configured on the clone commands that are run by submodule
add/update

Change-Id: I93bfe5a91d430200de8c7f1e32a60cb990aa58ea

12 years agoAdd submodule command helpers to Git class 01/4901/1
Kevin Sawicki [Mon, 2 Jan 2012 17:34:25 +0000 (09:34 -0800)]
Add submodule command helpers to Git class

Change-Id: I649d96617072db68ab15aa2569836fa783577424

12 years agoSkip a number commits before starting to show the commit output 84/4884/9
Tomasz Zarna [Mon, 2 Jan 2012 16:40:02 +0000 (08:40 -0800)]
Skip a number commits before starting to show the commit output

Change-Id: Id2666d897d29b6371f7a6cf241cfda02964b4971
Signed-off-by: Kevin Sawicki <kevin@github.com>
12 years agoAdd constant for default name for the Git repo configuration 97/4897/2
Tomasz Zarna [Mon, 2 Jan 2012 12:24:36 +0000 (13:24 +0100)]
Add constant for default name for the Git repo configuration

Change-Id: I5a6ef686c444fb1e46c9f784bad01165471ef372
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoSort translation bundle keys in alphabetical order. 95/4895/3
Tomasz Zarna [Mon, 2 Jan 2012 11:59:05 +0000 (12:59 +0100)]
Sort translation bundle keys in alphabetical order.

Change-Id: I83e26531ea924178ba43fa82b3c1fe02afd23eca
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoUpdate base version for clirr API check to latest release 92/4892/1
Matthias Sohn [Fri, 30 Dec 2011 01:09:17 +0000 (02:09 +0100)]
Update base version for clirr API check to latest release

Change-Id: Icb56610241c80d6ca8a980f6d419f4934579d441
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd comand support for git-submodule 61/4861/6
Kevin Sawicki [Mon, 19 Dec 2011 17:38:11 +0000 (09:38 -0800)]
Add comand support for git-submodule

Adds the following commands:
    - Add
    - Init
    - Status
    - Sync
    - Update

This also updates AddCommand so that file patterns added that
are submodules can be staged in the index.

Change-Id: Ie5112aa26430e5a2a3acd65a7b0e1d76067dc545
Signed-off-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd commit id and parent count to exception message 20/4820/2
Kevin Sawicki [Wed, 14 Dec 2011 21:33:27 +0000 (13:33 -0800)]
Add commit id and parent count to exception message

Bug: 357312
Change-Id: I2f85cf88650594eca7df6aa0e26bea329674f08e

12 years agoMerge "Only print stack trace to Sytem.err when debug flag is set"
Shawn Pearce [Tue, 27 Dec 2011 21:24:36 +0000 (16:24 -0500)]
Merge "Only print stack trace to Sytem.err when debug flag is set"

12 years agoFix typo in RebaseResult#mySatus 85/4885/1
Tomasz Zarna [Tue, 27 Dec 2011 20:46:19 +0000 (21:46 +0100)]
Fix typo in RebaseResult#mySatus

Change-Id: I88d34eec8307231f89343ead06858d1df4ac0886

12 years agoOnly print stack trace to Sytem.err when debug flag is set 83/4883/1
Kevin Sawicki [Tue, 27 Dec 2011 17:20:03 +0000 (09:20 -0800)]
Only print stack trace to Sytem.err when debug flag is set

Bug: 362100
Change-Id: Id18de9660f0dc2fb6c30db9770f31f26c874022d

12 years agoMerge branch 'stable-1.2' 79/4879/1
Matthias Sohn [Mon, 26 Dec 2011 22:52:32 +0000 (23:52 +0100)]
Merge branch 'stable-1.2'

* stable-1.2:
  JGit v1.2.0.201112221803-r
  Expose unmerged paths when revert fails
  Enforce the use of Java5 API:s only (with a few exceptions)

Change-Id: Ib18d41a65e68cc47fb63114fcce27a16820d0692
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Limit the number of commits in LogCommand output"
Robin Rosenberg [Fri, 23 Dec 2011 18:28:21 +0000 (13:28 -0500)]
Merge "Limit the number of commits in LogCommand output"

12 years agoLimit the number of commits in LogCommand output 27/4827/4
Tomasz Zarna [Thu, 22 Dec 2011 11:34:01 +0000 (12:34 +0100)]
Limit the number of commits in LogCommand output

Bug: 316680
Change-Id: I88cf7aac6b5763cc94421433dd4bbd42f81e0e69

12 years agoDiffFormatter#format(List) fails unless #scan(ATI, ATI) is called first 36/4036/2
Tomasz Zarna [Thu, 18 Aug 2011 11:43:42 +0000 (13:43 +0200)]
DiffFormatter#format(List) fails unless #scan(ATI, ATI) is called first

Bug: 354919
Change-Id: I710394fe6675e0e5aa66d9118c5b10d433aa30ea

12 years agoMerge "Support getting specific entry number in reflog"
Robin Rosenberg [Thu, 22 Dec 2011 23:49:04 +0000 (18:49 -0500)]
Merge "Support getting specific entry number in reflog"

12 years agoJGit v1.2.0.201112221803-r 73/4873/1 stable-1.2 v1.2.0.201112221803-r
Matthias Sohn [Thu, 22 Dec 2011 23:12:32 +0000 (00:12 +0100)]
JGit v1.2.0.201112221803-r

Change-Id: Icc0b09324f205d93929af8cf522a99ad00cf7591
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoRefactor ResolveMerger 66/4366/3
Christian Halstrick [Wed, 19 Oct 2011 22:33:47 +0000 (00:33 +0200)]
Refactor ResolveMerger

The places where ResolveMerger was doing content merges have been
refactored. The goal was to have one single method where content merge
was done and to factor out other topics (updating the index, updating
the working tree) into own methods. This was done to allow adding
pluggable content mergers in change
I7817e2123d254f3eeb315b47a61d2c55bd202c12

Change-Id: I8529697b197372a284bcd5ab2c9ba1adb925a520
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
12 years agoExpose unmerged paths when revert fails 23/4823/3
Kevin Sawicki [Wed, 14 Dec 2011 22:30:00 +0000 (14:30 -0800)]
Expose unmerged paths when revert fails

Change-Id: I02678aeb31a62668ae2b0342a6dae721e043dc5e

12 years agoSupport getting specific entry number in reflog 22/4822/4
Kevin Sawicki [Mon, 19 Dec 2011 17:14:47 +0000 (09:14 -0800)]
Support getting specific entry number in reflog

The number specified is interpreted as relative to the
last entry in the reflog.

Change-Id: Ie4dd03370bb0d475a0e89d3015113ca98920100f

12 years agoAdd exception class for when locking a file fails 00/4800/2
Kevin Sawicki [Tue, 13 Dec 2011 01:49:09 +0000 (17:49 -0800)]
Add exception class for when locking a file fails

This will allows calling classes to handle lock failures
without checking against the message and will also provide
access to the file that could not be locked.

Change-Id: I95bc59e1330a7af71ae3b0485c4516299193f504

12 years agoAllow to amend commits with JGit CLI 54/4854/1
Tomasz Zarna [Sun, 18 Dec 2011 15:28:44 +0000 (16:28 +0100)]
Allow to amend commits with JGit CLI

Change-Id: I0e8d365b56e079ac4ccece7fcf80ea140c319c78

12 years agoSupport resolving integer-based reflog revisions 19/4819/4
Kevin Sawicki [Sat, 17 Dec 2011 01:05:42 +0000 (17:05 -0800)]
Support resolving integer-based reflog revisions

Revision strings such as 'master@{0}' can now be resolved
by Repository.resolve by reading the reflog for the ref and
returning the commit for the entry number specified.

This still throws an exception for cases not supported
such as 'master@{yesterday}'.

Change-Id: I6162777d6510e083565a77cac4545cda5a9aefb3

12 years agoMerge "Report diff entries for files that only change mode"
Robin Rosenberg [Fri, 16 Dec 2011 15:30:24 +0000 (10:30 -0500)]
Merge "Report diff entries for files that only change mode"

12 years agoMerge branch 'stable-1.2' 38/4838/1
Matthias Sohn [Fri, 16 Dec 2011 07:49:59 +0000 (08:49 +0100)]
Merge branch 'stable-1.2'

* stable-1.2:
  Add API checking using clirr
  Fix MergeCommandTest to pass if File.executable is not supported
  Fix ResolveMerger not to add paths with FileMode 0

Change-Id: I86e7194a40acd6dfa3d433f1d17c01bdf5bb0d9c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoEnforce the use of Java5 API:s only (with a few exceptions) 85/4785/3
Robin Rosenberg [Fri, 16 Dec 2011 00:01:36 +0000 (01:01 +0100)]
Enforce the use of Java5 API:s only (with a few exceptions)

This only works with Eclipse 3.6 and newer and requires installation
of new package. Documentation is not very good, but there is a blog
about it here:
http://eclipseandjazz.blogspot.com/2011/10/of-invalid-references-to-system.html

API checking is especially useful on OS X where Java5 is not readily
available.

Change-Id: I3c0ad460874a21c073f5ac047146cbf5d31992b4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Fix MergeCommandTest to pass if File.executable is not supported" into stable-1.2
Matthias Sohn [Thu, 15 Dec 2011 23:58:48 +0000 (18:58 -0500)]
Merge "Fix MergeCommandTest to pass if File.executable is not supported" into stable-1.2

12 years agoAdd API checking using clirr 31/4831/3
Matthias Sohn [Thu, 15 Dec 2011 23:50:46 +0000 (15:50 -0800)]
Add API checking using clirr

In order to generate API reports run: mvn clirr:clirr

The reports are generated to the folder
target/site/clirr-report.html under the respective
project.

In order to check API compatibility and fail the build
on incompatible changes run: mvn clirr:check

For now we compare the API against the latest release
1.1.0.201109151100-r.

Bug: 336849
Change-Id: I21baaf3a6883c5b4db263f712705cc7b8ab6d888
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Kevin Sawicki <kevin@github.com>
12 years agoFix MergeCommandTest to pass if File.executable is not supported 30/4830/1
Robin Rosenberg [Thu, 15 Dec 2011 22:33:00 +0000 (23:33 +0100)]
Fix MergeCommandTest to pass if File.executable is not supported

Change-Id: If11080ed6e53d9df88a1ae42f48ee8914d54669b

12 years agoReport diff entries for files that only change mode 26/4826/4
Kevin Sawicki [Thu, 15 Dec 2011 01:51:42 +0000 (17:51 -0800)]
Report diff entries for files that only change mode

This also updates DiffFormatter to not write path lines
for entries that have the same object id

Bug: 361570
Change-Id: I830a78e2babf472503630a7aa020ebfd5c7e69c6

12 years agoFire DfsPacksChangedEvents when committing packs. 07/4807/2
Dave Borowitz [Tue, 13 Dec 2011 19:00:19 +0000 (11:00 -0800)]
Fire DfsPacksChangedEvents when committing packs.

Once a pack has been committed with commitPack(), we know that the pack
list has changed but we don't re-scan the underlying storage.

Change-Id: Ia7b35df4442a5f5dfe7e817edcc77b44b5410d08

12 years agoStatusCommand#setWorkingTreeIt should return 'this' 91/4791/2
Tomasz Zarna [Mon, 12 Dec 2011 17:21:15 +0000 (09:21 -0800)]
StatusCommand#setWorkingTreeIt should return 'this'

All setters for JGit API commands return the command instance, follow
the builder pattern.

Change-Id: Id2bbc3f1300bb179887c4d2d6dd72925bde55f24
Signed-off-by: Kevin Sawicki <kevin@github.com>
12 years agoFix ResolveMerger not to add paths with FileMode 0 57/4757/7
Christian Halstrick [Fri, 9 Dec 2011 10:17:59 +0000 (11:17 +0100)]
Fix ResolveMerger not to add paths with FileMode 0

When ResolveMerger finds a path where it has to do a content merge it
will try the content merge and if that succeeds it'll add the newly
produced content to the index. For the FileMode of this new index entry
it blindly copies the FileMode it finds for that path in the common base
tree. If by chance the common base tree does not contain this path it'll
try to add FileMode 0 (MISSING) to the index.

One could argue that this can't happen: how can the ResolveMerger
successfully (with no conflicts) merge two contents if there is no
common base? This was due to another bug in ResolveMerger. It failed to
find out that for two files which differ only in the FileMode (e.g. 644
vs. 755) it should not try a content merge.

Change-Id: I7a00fe1a6c610679be475cab8a3f8aa4c08811a1
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
12 years agoPrepare 1.3.0 builds 78/4778/1
Matthias Sohn [Fri, 9 Dec 2011 23:50:21 +0000 (00:50 +0100)]
Prepare 1.3.0 builds

Change-Id: I7a1ae73783c95041b59f047a7330e62e7f642149
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge branch 'stable-1.2' 77/4777/1
Matthias Sohn [Sat, 10 Dec 2011 00:06:47 +0000 (01:06 +0100)]
Merge branch 'stable-1.2'

* stable-1.2:
  Fix version.sh
  Throw API exception when MergeCommand hits checkout conflicts
  Add methods for configuring platform emulation
  Fix history rendering not to occupy too many lanes
  Fix History rendering

Change-Id: If71cc760423ae2b76c7435ca4830edc1745556de
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoFix version.sh 76/4776/1
Matthias Sohn [Fri, 9 Dec 2011 23:49:39 +0000 (00:49 +0100)]
Fix version.sh

Change-Id: Icdf5d9ea3ca62839cbf7de13dfee9682056b7cef
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Add simple chain implementations of transport hooks and loggers"
Shawn Pearce [Fri, 9 Dec 2011 17:23:23 +0000 (12:23 -0500)]
Merge "Add simple chain implementations of transport hooks and loggers"

12 years agoAdd simple chain implementations of transport hooks and loggers 69/4769/3
Dave Borowitz [Thu, 8 Dec 2011 16:21:01 +0000 (08:21 -0800)]
Add simple chain implementations of transport hooks and loggers

Allows callers to effectively run multiple hooks and loggers without
modifying the UploadPack/ReceivePack interface.

Change-Id: I5b388816b63036ffff08ef3a9b857ccb764cb8c4

12 years agoMerge "Force jgit.sh to use UTF-8 encoding on Mac"
Shawn Pearce [Fri, 9 Dec 2011 15:11:30 +0000 (10:11 -0500)]
Merge "Force jgit.sh to use UTF-8 encoding on Mac"

12 years agoMerge changes I9f1842c2,Ie139133b
Shawn Pearce [Fri, 9 Dec 2011 15:04:03 +0000 (10:04 -0500)]
Merge changes I9f1842c2,Ie139133b

* changes:
  Throw invalid ref exception instead of invalid remote exception
  Use constant for logs directory

12 years agoMerge "Add a no-op UploadPackLogger and use it by default"
Shawn Pearce [Fri, 9 Dec 2011 02:44:18 +0000 (21:44 -0500)]
Merge "Add a no-op UploadPackLogger and use it by default"

12 years agoThrow API exception when MergeCommand hits checkout conflicts 52/4752/2
Matthias Sohn [Thu, 8 Dec 2011 22:33:53 +0000 (23:33 +0100)]
Throw API exception when MergeCommand hits checkout conflicts

When MergeCommand hit checkout conflicts it did throw an internal JGit
exception org.eclipse.jgit.errors.CheckoutConflictException instead of
org.eclipse.jgit.api.errors.CheckoutConflictException which it
declares to throw. Hence translate the internal exception to the
exception declared in the API.

Bug: 327573
Change-Id: I1efcd93a43ecbf4a40583e0fc9d8d53cffc98cae
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoThrow invalid ref exception instead of invalid remote exception 49/4749/6
Kevin Sawicki [Tue, 6 Dec 2011 18:00:28 +0000 (10:00 -0800)]
Throw invalid ref exception instead of invalid remote exception

ReflogCommand command was throwing an incorrect exception type
when an IOException was wrapped and rethrown from the underlying
ReflogReader.  The IOException cause is now provided to the thrown
exception as well.

Change-Id: I9f1842c2d414d3e9c658843f9b448bc18891748e

12 years agoUse constant for logs directory 47/4747/4
Kevin Sawicki [Tue, 6 Dec 2011 17:37:11 +0000 (09:37 -0800)]
Use constant for logs directory

Change-Id: Ie139133bcbe1ca61c85e86b3484f858bc065821f

12 years agoMerge "Set expected old object id to all zeros when head id is null"
Shawn Pearce [Thu, 8 Dec 2011 18:09:02 +0000 (13:09 -0500)]
Merge "Set expected old object id to all zeros when head id is null"

12 years agoMerge "Use System.arraycopy to copy parent object id array"
Shawn Pearce [Thu, 8 Dec 2011 18:07:21 +0000 (13:07 -0500)]
Merge "Use System.arraycopy to copy parent object id array"

12 years agoMerge "[findBugs] Implement Serializable interface in PlotLane"
Shawn Pearce [Thu, 8 Dec 2011 18:06:03 +0000 (13:06 -0500)]
Merge "[findBugs] Implement Serializable interface in PlotLane"

12 years agoAdd toString() to HunkHeader 66/4766/2
Tomasz Zarna [Thu, 8 Dec 2011 17:11:01 +0000 (18:11 +0100)]
Add toString() to HunkHeader

Since FileHeader provides toString() method (via DiffEntry) we could add
a similar method to HunkHeader.

Change-Id: I7886e5b8f775fa8e8478ac5af37d90b6ef677d8b

12 years ago[findBugs] Implement Serializable interface in PlotLane 70/4770/1
Kevin Sawicki [Thu, 8 Dec 2011 16:41:10 +0000 (08:41 -0800)]
[findBugs] Implement Serializable interface in PlotLane

This class is referenced by PlotCommit which is Serializable

Change-Id: If79b6a593dc53fbb7c4f0a69a9d0dca02a8cb63c

12 years agoAdd a no-op UploadPackLogger and use it by default 68/4768/2
Dave Borowitz [Thu, 8 Dec 2011 16:00:39 +0000 (08:00 -0800)]
Add a no-op UploadPackLogger and use it by default

This matches the behavior of the hooks in UploadPack.

Change-Id: I21277e52ee9452237d87084f06bb140dfa6bf608

12 years agoAdd methods for configuring platform emulation 61/4761/1
Robin Rosenberg [Tue, 25 Oct 2011 23:54:54 +0000 (01:54 +0200)]
Add methods for configuring platform emulation

Specifically we support setting system properties for Windows, generic
Unix and current test platform.

Change-Id: Ib02be417c4915350dfec64fda3face1138552871

12 years agoUse System.arraycopy to copy parent object id array 59/4759/1
Kevin Sawicki [Wed, 7 Dec 2011 18:21:41 +0000 (10:21 -0800)]
Use System.arraycopy to copy parent object id array

Change-Id: Iee475584f0a65b8b77610cd277f15295b68dfe80

12 years agoSet expected old object id to all zeros when head id is null 55/4755/2
Kevin Sawicki [Wed, 7 Dec 2011 02:02:30 +0000 (18:02 -0800)]
Set expected old object id to all zeros when head id is null

This will be the case on the initial commit to a repository
and the ref update should expect a non-existent ref

Change-Id: Iaa06e47e6e8cc4a0281c7683b367d4806dd980ea

12 years agoForce jgit.sh to use UTF-8 encoding on Mac 54/4754/1
Robin Rosenberg [Tue, 6 Dec 2011 23:42:35 +0000 (00:42 +0100)]
Force jgit.sh to use UTF-8 encoding on Mac

For some obscure reason the platform encodng in Java on Macs
is MacRoman. OS X used UTF-8 as the default encoding so set
the encoding property in jgit.sh.

Change-Id: I08182c2f8512f799178cee70bcc28d6ee2b9c2b0

12 years agoFix history rendering not to occupy too many lanes 44/4744/2
Christian Halstrick [Tue, 6 Dec 2011 22:10:03 +0000 (23:10 +0100)]
Fix history rendering not to occupy too many lanes

There was a bug in history rendering which caused jgit to use too
many lanes in case lanes get repositioned. Looking at commit
90c11cbaeb83ee9b02238cbd2c0e5bcf68068772 in JGit was one example. Vadim
Dmitriev found the problem and the solution.

Bug: 365460
Change-Id: I6024265b7a593dcfd4fc612d0baf6652a0092ff4
Also-by: Vadim Dmitriev <dmgloss@mail.ru>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
12 years agoStream left open in WorkingTreeIterator#filterClean 45/4745/1
Tomasz Zarna [Tue, 6 Dec 2011 09:44:52 +0000 (10:44 +0100)]
Stream left open in WorkingTreeIterator#filterClean

Change-Id: I17c2709f2613536c02c9ea2977d936b87029ac0d

12 years agoMerge changes I5381e110,I5534b560
Shawn O. Pearce [Mon, 5 Dec 2011 20:38:41 +0000 (15:38 -0500)]
Merge changes I5381e110,I5534b560

* changes:
  Discard request HTTP bodies for status code <400
  Ensure all smart HTTP errors are sent to clients

12 years agoFix History rendering 35/4735/1
Christian Halstrick [Fri, 2 Dec 2011 13:27:51 +0000 (14:27 +0100)]
Fix History rendering

There was the possibility that during history rendering we draw a lane
"trough" a passed commit. Vadim Dmitriev found that out in bug 335818.
I added the needed check to that block of code where it was missing.

Bug: 335818
Change-Id: Ic944193b2aca55ff3eb0235d46afa60b7896aa0f
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
12 years agoMerge "Always close the GZIPOutputStream to release Deflater"
Robin Rosenberg [Fri, 2 Dec 2011 22:38:05 +0000 (17:38 -0500)]
Merge "Always close the GZIPOutputStream to release Deflater"

12 years agoMerge "Fix History rendering"
Shawn Pearce [Fri, 2 Dec 2011 15:02:49 +0000 (10:02 -0500)]
Merge "Fix History rendering"

12 years agoMerge "Add percent-encoding of reserved characters in URIish"
Shawn Pearce [Fri, 2 Dec 2011 15:01:22 +0000 (10:01 -0500)]
Merge "Add percent-encoding of reserved characters in URIish"

12 years agoAdd percent-encoding of reserved characters in URIish 50/4550/8
Robin Rosenberg [Tue, 29 Nov 2011 23:16:40 +0000 (00:16 +0100)]
Add percent-encoding of reserved characters in URIish

We do this for the the names that have an explicit scheme and
do it both ways. The URIish is parsed before decoding. Only
a few special characters are encoded for the path part of the
URI, i.e. space, non-ASCII and control characters. The percent
encoding is assumed to be a stream encoding so we interpret it
as UTF-8.

Change-Id: I82d1910df9472e21d7212a2b984ff7d8fb2cbf0f

12 years agoFix History rendering 19/4719/1
Christian Halstrick [Fri, 2 Dec 2011 13:27:51 +0000 (14:27 +0100)]
Fix History rendering

There was the possibility that during history rendering we draw a lane
"trough" a passed commit. Vadim Dmitriev found that out in bug 335818.
I added the needed check to that block of code where it was missing.

Bug: 335818
Change-Id: Ic944193b2aca55ff3eb0235d46afa60b7896aa0f
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
12 years agoDiscard request HTTP bodies for status code <400 16/4716/1
Shawn O. Pearce [Thu, 1 Dec 2011 01:36:32 +0000 (17:36 -0800)]
Discard request HTTP bodies for status code <400

The HTTP RFCs require a server to fully consume the request body before
it can return a non-error status code, which is any code below 400.

JGit returns most Git level errors inside of an HTTP 200 OK response,
and sometimes this happens before the entire request was consumed from
the servlet container. In such cases the body must be skipped or read
until EOF is reached, ensuring the HTTP keep-alive semantics will work
for the next request on the same TCP connection.

HTTP status codes >= 400 may be returned without consuming the body,
and a servlet container must set "Connection: close" in the response
headers when this happens, since the state of the request body is not
well defined with an early abort.

With the introduction of sendError() in GitSmartHttpTools there are
only a handful of locations that need to worry about the request body
being consumed, so sprinkle the call in as necessary.

Change-Id: I5381e110585f780c01a764df8e27c80aacf5146e

12 years agoEnsure all smart HTTP errors are sent to clients 15/4715/1
Shawn O. Pearce [Thu, 1 Dec 2011 01:28:54 +0000 (17:28 -0800)]
Ensure all smart HTTP errors are sent to clients

Error messages are typically short, below the 32 KiB in-memory buffer
size of the SmartOutputStream. When an error is queued up for sending
to a client and an exception is thrown up into the servlet handler we
discarded the message and sent nothing to the client, as the messages
were stuck inside of the SmartOutputStream buffer.

Hoist the creation of the output stream above the invocation of try
block of the service, and use close() in the few catch blocks that
assume there are buffered messages ready for transmission. This will
ensure errors from unpacking a stream in ReceivePack are sent off to
a client correctly, as previously these were causing no status report
to arrive at the client side as the data was stuck in the buffer.

Change-Id: I5534b560697731121f48979ae077aa7c95b8e39c

12 years agoAlways close the GZIPOutputStream to release Deflater 14/4714/1
Shawn O. Pearce [Thu, 1 Dec 2011 01:17:59 +0000 (17:17 -0800)]
Always close the GZIPOutputStream to release Deflater

The stream must be closed to ensure the native resources associated
with its internal Deflater instance are cleaned up early, instead of
waiting for GC to identify the dead object and finialize it.

Change-Id: Ic31b5df563f19404ed4682556999f4332aa61562

12 years agoFix HTTP unit tests 04/4704/1
Shawn O. Pearce [Thu, 1 Dec 2011 01:40:10 +0000 (17:40 -0800)]
Fix HTTP unit tests

I modified the way errors are returned, and this particular test is
now getting a different access denied response. The new text happens
to be what I intended to have here, so update the test.

Change-Id: I53f8410ca0a52755d80473cd5cbcdb4d8502febf

12 years agoMerge "RepositoryState: add method canAmend"
Christian Halstrick [Wed, 30 Nov 2011 09:55:58 +0000 (04:55 -0500)]
Merge "RepositoryState: add method canAmend"

12 years agoMerge "Always checkout master when it matches the advertised HEAD"
Shawn Pearce [Tue, 29 Nov 2011 02:59:52 +0000 (21:59 -0500)]
Merge "Always checkout master when it matches the advertised HEAD"

12 years agoMerge "Update maven plugin versions"
Shawn Pearce [Tue, 29 Nov 2011 02:51:31 +0000 (21:51 -0500)]
Merge "Update maven plugin versions"

12 years agoMerge "Implement Serializable interface in ReflogEntry"
Shawn Pearce [Tue, 29 Nov 2011 02:50:40 +0000 (21:50 -0500)]
Merge "Implement Serializable interface in ReflogEntry"

12 years agoRemove calls to printStackTrace in catch blocks 91/4691/1
Kevin Sawicki [Tue, 29 Nov 2011 02:07:52 +0000 (18:07 -0800)]
Remove calls to printStackTrace in catch blocks

Change-Id: I7a4179f10a4841e80b6546e1e7662cab71eac5e9

12 years agoUpdate maven plugin versions 89/4689/1
Matthias Sohn [Tue, 29 Nov 2011 00:16:47 +0000 (01:16 +0100)]
Update maven plugin versions

Change-Id: I7400e08a1059f57c85a53aebe2719f81c00f58e8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoImplement Serializable interface in ReflogEntry 88/4688/1
Kevin Sawicki [Tue, 29 Nov 2011 00:14:21 +0000 (16:14 -0800)]
Implement Serializable interface in ReflogEntry

Change-Id: Idf798dd3981bef3dc9e17c13c12809f89089e96f

12 years agoAlways checkout master when it matches the advertised HEAD 87/4687/2
Kevin Sawicki [Mon, 28 Nov 2011 19:00:15 +0000 (11:00 -0800)]
Always checkout master when it matches the advertised HEAD

This parallels the CGit behavior of always using refs/heads/master
when it matches the remote advertised HEAD commit.

Change-Id: I5a5cd1516b58d116e334056aba1ef7990697ec30

12 years agoRepositoryState: add method canAmend 74/4674/3
Jens Baumgart [Mon, 28 Nov 2011 09:46:16 +0000 (10:46 +0100)]
RepositoryState: add method canAmend

The method canAmend was added to RepositoryState. It returns true if
amending the HEAD commit is allowed in the current repository state.

Change-Id: Idd0c4eea83a23c41340789b7b877959b457d951e
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
12 years agoMerge "Reset SSH connection and credentials on "Auth fail""
Shawn Pearce [Sun, 27 Nov 2011 00:24:09 +0000 (19:24 -0500)]
Merge "Reset SSH connection and credentials on "Auth fail""

12 years agoReset SSH connection and credentials on "Auth fail" 76/4676/2
Matthias Sohn [Sun, 27 Nov 2011 00:16:49 +0000 (01:16 +0100)]
Reset SSH connection and credentials on "Auth fail"

When SSH user/password authentication failed this may have been caused
by changed credentials on the server side. When the SSH credentials of a
user change the SSH connection needs to be re-established and
credentials which may have been stored by the credentials provider
need to be reset in order to enable prompting for the new credentials.

Bug: 356233
Change-Id: I7d64c5f39b68a9687c858bb68a961616eabbc751
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoDon't iterate over advertised refs when HEAD is null 81/4681/1
Kevin Sawicki [Sat, 26 Nov 2011 22:47:21 +0000 (14:47 -0800)]
Don't iterate over advertised refs when HEAD is null

Moves the check from inside the loop to outside the loop
and returns immediately if the HEAD advertisded ref is null

Change-Id: I539da6cafb4f73610b8e00259e32bd4d57f4f4cc

12 years agoMerge "tools/release: Handle v1.0.0.201106090707-r-NN-gdeadbeef"
Matthias Sohn [Thu, 24 Nov 2011 13:34:50 +0000 (08:34 -0500)]
Merge "tools/release: Handle v1.0.0.201106090707-r-NN-gdeadbeef"

12 years agoMerge "Adapt merge message to C Git for remote-tracking branch"
Shawn Pearce [Wed, 23 Nov 2011 23:09:06 +0000 (18:09 -0500)]
Merge "Adapt merge message to C Git for remote-tracking branch"