]> source.dussan.org Git - jgit.git/log
jgit.git
12 years agoOnly unstash files changed when originally stashed 94/5194/8
Kevin Sawicki [Wed, 14 Mar 2012 00:01:42 +0000 (17:01 -0700)]
Only unstash files changed when originally stashed

Previously a DirCacheCheckout was done using a merge tree reflecting
the state of the repository when the stash was originally done.
This was wrong since unstashing after making subsequent commits
would undo changes already committed by checking out entries from
an outdated tree.

The new approach is to scan for conflicts initially using a 6-way
tree walk that contains the trees for the stashed HEAD, stashed
index, stashed working directory, current HEAD, current index, and
current working directory.  Then perform a subsequent scan of the
stashed HEAD, index, and working directory trees and apply all
the stashed differences to the current index and working directory.

Bug: 372882
Change-Id: Ica65f162132c00a16964e838de66fc8b5cd0b0aa
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoMerge "Enable smart HTTP transport to place EOF at end of pack"
Shawn O. Pearce [Tue, 13 Mar 2012 18:50:27 +0000 (14:50 -0400)]
Merge "Enable smart HTTP transport to place EOF at end of pack"

12 years agoEnable smart HTTP transport to place EOF at end of pack 48/5348/2
Shawn O. Pearce [Tue, 13 Mar 2012 18:10:33 +0000 (11:10 -0700)]
Enable smart HTTP transport to place EOF at end of pack

When fetching over smart HTTP the InputStream that gets fed into
a PackParser doesn't really support EOF at the end of the pack. It
instead tries to make a new HTTP request, which fails because there
is no request body currently buffered by the client.

Make EOF work correctly on the end of an HTTP derived InputStream
for the pack by denoting no more requests are expected as the higher
level code is now consuming the pack (or side-band embedded pack).
Smart HTTP support doesn't automatically enqueue execute support onto
the end of the UnionInputStream, which allows the UnionInputStream
to correctly reflect EOF when the HTTP response is consumed.

Change-Id: I975f1ab1c81ab1c1af925716970088bc7b8d6b1a

12 years agoDo not import/export empty org.eclipse.jgit package 39/5339/2
Tomasz Zarna [Tue, 13 Mar 2012 16:10:10 +0000 (09:10 -0700)]
Do not import/export empty org.eclipse.jgit package

The package was removed in I763590a45d75f00a09097ab6f89581a3bbd3c797

Change-Id: Ifa9e75714f85d17609f9bf61581aaed0631a6fa7
Signed-off-by: Kevin Sawicki <kevin@github.com>
12 years agoMove JGitText to an internal package 01/5301/3
Robin Rosenberg [Fri, 9 Mar 2012 09:44:05 +0000 (10:44 +0100)]
Move JGitText to an internal package

Change-Id: I763590a45d75f00a09097ab6f89581a3bbd3c797

12 years agoMerge changes Ic0ee9c08,Ia3e82682,I8d8ab547,I8f2cd0a0,I45823b0c,Ie22ac47e
Shawn Pearce [Mon, 12 Mar 2012 14:16:42 +0000 (10:16 -0400)]
Merge changes Ic0ee9c08,Ia3e82682,I8d8ab547,I8f2cd0a0,I45823b0c,Ie22ac47e

* changes:
  cleanup: Silence an unused-parameter warning
  cleanup: Get rid of some unused-warnings
  cleanup: Remove unused parameter in ConsoleCredentialsProvider
  cleanup: Drop unused parameter on DhtPackParser
  cleanup: Remove unneeded parameter to private method in RefUpdateTest
  cleanup: Remove unnecessary @SuppressWarnings

12 years agoMerge "Use object id provided by working tree iterator for submodules"
Shawn Pearce [Mon, 12 Mar 2012 14:14:02 +0000 (10:14 -0400)]
Merge "Use object id provided by working tree iterator for submodules"

12 years agoFix compilation error due to missing javadoc. 25/5325/1
Markus Duft [Mon, 12 Mar 2012 13:54:56 +0000 (14:54 +0100)]
Fix compilation error due to missing javadoc.

Another change introduced this problem. With default JGit project
settings there is a compilation problem as javadoc problems are set to
Error in the project preferences.

Change-Id: I81e3ceeb02f7a2119b2a6cfefb7fbd9e83771fc9

12 years agoUse object id provided by working tree iterator for submodules 14/5314/1
Kevin Sawicki [Sat, 10 Mar 2012 18:26:10 +0000 (10:26 -0800)]
Use object id provided by working tree iterator for submodules

The working tree iterator now supports providing an object id
for submodule entries and this value should be used instead
of recomputing it again in AddCommand.

Change-Id: I30082514c23fc65968bb78add5ad69a1ca95cf3a

12 years agoKeep submodules in index that are missing in working directory 13/5313/1
Kevin Sawicki [Sat, 10 Mar 2012 18:02:58 +0000 (10:02 -0800)]
Keep submodules in index that are missing in working directory

Submodules present in the index but missing from the working
directory should not be staged for deletion when AddCommand
is called with the update flag set to true.

This mirrors the behavior of CGit.  Submodules can still be
staged for deletion by running by using the RmCommand.

Change-Id: Iee508a67f9621269d1c28d422f88c6b8dd9f8e6e

12 years agoMerge "Export all packages from org.eclipse.jgit.pgm"
Matthias Sohn [Sat, 10 Mar 2012 00:29:13 +0000 (19:29 -0500)]
Merge "Export all packages from org.eclipse.jgit.pgm"

12 years agoMerge "EolCanonicalizingInputStream: binary detection should be optional"
Robin Rosenberg [Fri, 9 Mar 2012 20:52:11 +0000 (15:52 -0500)]
Merge "EolCanonicalizingInputStream: binary detection should be optional"

12 years agocleanup: Silence an unused-parameter warning 09/5309/2
Robin Rosenberg [Fri, 9 Mar 2012 12:23:12 +0000 (13:23 +0100)]
cleanup: Silence an unused-parameter warning

Change-Id: Ic0ee9c08642d4efc6ef1f2333ebe6614e9c2df87

12 years agoMerge "Fix rebase > continue when nothing left to commit."
Stefan Lay [Fri, 9 Mar 2012 13:04:20 +0000 (08:04 -0500)]
Merge "Fix rebase > continue when nothing left to commit."

12 years agoFix rebase > continue when nothing left to commit. 59/4959/7
Markus Duft [Fri, 9 Mar 2012 12:36:53 +0000 (13:36 +0100)]
Fix rebase > continue when nothing left to commit.

If after resolving all conflicts nothing is left to commit, return
an according result, so that downstreams (EGit, ...) can behave like
cgit, and display a nice message informing the user.

Currently, EGit displays a "HEAD advanced fast forward" message, which
is absolutely not helpful at all.

This is the basic API revamping required to get that state communicated
to the outside world (EGit).

Bug: 336812
Change-Id: If2665005cf54a5b51c0fe80bad019fa42b0205af

12 years agocleanup: Get rid of some unused-warnings 07/5307/1
Robin Rosenberg [Fri, 9 Mar 2012 12:10:58 +0000 (13:10 +0100)]
cleanup: Get rid of some unused-warnings

Change-Id: Ia3e82682781c6b5bc3141b3e27db67b93c3162cd

12 years agocleanup: Remove unused parameter in ConsoleCredentialsProvider 06/5306/1
Robin Rosenberg [Fri, 9 Mar 2012 12:10:14 +0000 (13:10 +0100)]
cleanup: Remove unused parameter in ConsoleCredentialsProvider

Change-Id: I8d8ab54736c6d57e6211928def8632acb1f5b621

12 years agocleanup: Drop unused parameter on DhtPackParser 05/5305/1
Robin Rosenberg [Fri, 9 Mar 2012 12:01:40 +0000 (13:01 +0100)]
cleanup: Drop unused parameter on DhtPackParser

Change-Id: I8f2cd0a04cc95a02c49c16dade1b3509cba02e2d

12 years agocleanup: Remove unneeded parameter to private method in RefUpdateTest 04/5304/1
Robin Rosenberg [Fri, 9 Mar 2012 11:26:19 +0000 (12:26 +0100)]
cleanup: Remove unneeded parameter to private method in RefUpdateTest

Change-Id: I45823b0c1ad5d249d539d7c8e1180ad7432abb3e

12 years agocleanup: Remove unnecessary @SuppressWarnings 03/5303/1
Robin Rosenberg [Fri, 9 Mar 2012 11:14:22 +0000 (12:14 +0100)]
cleanup: Remove unnecessary @SuppressWarnings

Change-Id: Ie22ac47e315bff76f224214bc042fc483eb01550
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
12 years agoMerge "Revert non-sense logic in IO.readFully"
Robin Rosenberg [Fri, 9 Mar 2012 09:47:45 +0000 (04:47 -0500)]
Merge "Revert non-sense logic in IO.readFully"

12 years agoUse readString() to trim trailing LF from first line 97/5297/1
Shawn O. Pearce [Thu, 8 Mar 2012 03:51:12 +0000 (19:51 -0800)]
Use readString() to trim trailing LF from first line

The fetch-pack/upload-pack stream usually has an LF at the
end of the first "want" line. Trim this when checking to
see if side-band or side-band-64k was used.

Perform the same trim for send-pack/receive-pack, as it is
harmless in this context to ignore an LF just before doing
an error report.

Change-Id: I6ef946bb6124fa72c52bd5320187eaac3ed906e7

12 years agoMerge changes I8277fd45,I7ac4e0ae,Ib475dfc0,Ib26adf95
Shawn Pearce [Thu, 8 Mar 2012 03:22:22 +0000 (22:22 -0500)]
Merge changes I8277fd45,I7ac4e0ae,Ib475dfc0,Ib26adf95

* changes:
  Try to send HTTP error messages over sideband
  Extract the capability parsing logic in {Upload,Receive}Pack
  Make capability strings in BasePack{Fetch,Push}Connection public
  Fix a typo in "capabilities" in ReceivePack

12 years agoTry to send HTTP error messages over sideband 96/5296/2
Dave Borowitz [Wed, 7 Mar 2012 19:56:56 +0000 (11:56 -0800)]
Try to send HTTP error messages over sideband

When a client POSTs to /git-{upload,receive}-pack, the first line
includes their client capabilities. As soon as the C git client sends
side-band(-64k), it goes into a state where it chokes on data not sent
in a valid sideband channel.

GitSmartHttpTools.sendError() is called early in the request, likely
before a {Upload,Receive}Pack handler is assigned or, even so, before it
has read the request. In some cases we must read the first line manually
within sendError() to tell whether sideband is needed.

Change-Id: I8277fd45a4ec3b71fa8f87404b4f5d1a09e0f384

12 years agoExtract the capability parsing logic in {Upload,Receive}Pack 95/5295/1
Dave Borowitz [Wed, 7 Mar 2012 20:53:49 +0000 (12:53 -0800)]
Extract the capability parsing logic in {Upload,Receive}Pack

Change-Id: I7ac4e0ae98872a74b01162b5ca936fb15e2f8cff

12 years agoMake capability strings in BasePack{Fetch,Push}Connection public 94/5294/1
Dave Borowitz [Wed, 7 Mar 2012 20:52:19 +0000 (12:52 -0800)]
Make capability strings in BasePack{Fetch,Push}Connection public

Change-Id: Ib475dfc087705ea40e1db37ec9ef28a67fde6d72

12 years agoFix a typo in "capabilities" in ReceivePack 93/5293/1
Dave Borowitz [Wed, 7 Mar 2012 20:21:50 +0000 (12:21 -0800)]
Fix a typo in "capabilities" in ReceivePack

Change-Id: Ib26adf954dcb90403be9d6ed3b7a425a724c67d0

12 years agoExport all packages from org.eclipse.jgit.pgm 90/5290/1
Tomasz Zarna [Wed, 7 Mar 2012 17:41:45 +0000 (18:41 +0100)]
Export all packages from org.eclipse.jgit.pgm

Change-Id: I90565c8626aa5ab58ed3ff1dafa8bd21c9a79c62

12 years agoRemove ambiguous CheckoutConflictException 78/4178/8
Tomasz Zarna [Tue, 6 Mar 2012 21:43:25 +0000 (22:43 +0100)]
Remove ambiguous CheckoutConflictException

Checkout command should throw o.e.j.api.errors.CheckoutConflictException
which is a GitAPIException not o.e.j.errors.CheckoutConflictException.
PullCommand should rethrow the API exception as a JGitInternalException.

Bug: 356922
Change-Id: I865c4905997d9834c85a97fbe7287604daf99075
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Check connection's error stream before reading from it"
Christian Halstrick [Tue, 6 Mar 2012 14:26:38 +0000 (09:26 -0500)]
Merge "Check connection's error stream before reading from it"

12 years agoIgnore /target 53/5253/2
Shawn O. Pearce [Mon, 5 Mar 2012 23:42:18 +0000 (15:42 -0800)]
Ignore /target

Maven seems to be creating target/antrun/build-main.xml.
This isn't a tracked file. Elsewhere we blanket ignore
/target inside of each plugin/component directory so do
the same at the top level.

Change-Id: Id799ac6da65e6789e48e28efbdb455153b34ff2e
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoReuse Git object created in setUp 93/5193/2
Kevin Sawicki [Wed, 29 Feb 2012 18:29:05 +0000 (10:29 -0800)]
Reuse Git object created in setUp

Removes unneeded calls to Git.wrap in test cases where a valid
Git object already exists as an instance variable.

Change-Id: Id0e032d7886dfa6a3288321503a02743413f707d
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoSet person and message on stash ref update 92/5192/2
Kevin Sawicki [Wed, 29 Feb 2012 18:16:56 +0000 (10:16 -0800)]
Set person and message on stash ref update

This will be the message and person used for the commit
of stashed working directory changes.

Bug: 372884
Change-Id: I2501b080f6b94e826cf7dba3fd526ae5c1d969d1
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoReturn command from StashCreateCommand setters 91/5191/2
Kevin Sawicki [Wed, 29 Feb 2012 18:13:36 +0000 (10:13 -0800)]
Return command from StashCreateCommand setters

Previously were void which made them inconsistent with
the fluid setter pattern used in other commands.

Change-Id: Idb81dfc7bb097306f0c5d6e34f91a2bbab501668
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoSupport insteadOf and pushInsteadOf URL replacement 18/5218/3
Kevin Sawicki [Fri, 2 Mar 2012 01:37:41 +0000 (17:37 -0800)]
Support insteadOf and pushInsteadOf URL replacement

Bug: 346873
Change-Id: I4116328f93f411da56a633bc32fd064b2ac083f2
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoMerge "Quickfix for AutoCRLF handling"
Chris Aniszczyk [Tue, 6 Mar 2012 04:44:44 +0000 (23:44 -0500)]
Merge "Quickfix for AutoCRLF handling"

12 years agoCheck connection's error stream before reading from it 55/5255/3
Kevin Sawicki [Tue, 6 Mar 2012 01:22:22 +0000 (17:22 -0800)]
Check connection's error stream before reading from it

HttpURLConnection.getErrorStream can return null which is
currently not guarded against and will throw an NPE preventing
the actual error response code from bubbling up.

Change-Id: I04fb8dbda16b7df3b82fc579088a303b2fd21e87

12 years agoRawText#getEOL() does the same thing as RawText#getLineDelimiter() 40/5240/1
Tomasz Zarna [Mon, 5 Mar 2012 11:59:10 +0000 (12:59 +0100)]
RawText#getEOL() does the same thing as RawText#getLineDelimiter()

The duplication has been introduced when merging
I08e1369e142bb19f42a8d7bbb5a7d062cc8533fc and
I18adc63596f4657516ccc6d704a561924c79d445. The former should have been
manually rebased. It also missed a copyright update in ApplyCommandTest.

Change-Id: I18fe6108220f964524fb16b719604222aa7abee6

12 years agoMerge "Update example code for obtaining a locked DirCache"
Christian Halstrick [Mon, 5 Mar 2012 08:46:53 +0000 (03:46 -0500)]
Merge "Update example code for obtaining a locked DirCache"

12 years agoAdd ApplyCommand to JGit API 17/4717/8
Tomasz Zarna [Mon, 5 Mar 2012 05:14:23 +0000 (21:14 -0800)]
Add ApplyCommand to JGit API

Bug: 361548
CQ: 6243
Change-Id: I08e1369e142bb19f42a8d7bbb5a7d062cc8533fc
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoMerge "Remove null access warning in DirCacheCheckout"
Robin Rosenberg [Sun, 4 Mar 2012 18:06:59 +0000 (13:06 -0500)]
Merge "Remove null access warning in DirCacheCheckout"

12 years agoQuickfix for AutoCRLF handling 98/4998/4
Robin Rosenberg [Sat, 3 Mar 2012 07:22:48 +0000 (08:22 +0100)]
Quickfix for AutoCRLF handling

CRLF only works for small files, where small is the size of the
buffer, i.e. about 8K. This QD fix reallocates the buffer to be
large enough.

Bug: 369780
Change-Id: Ifc34ad204fbf5986b257a5c616e4a8c601e8261a

12 years agoInclude eclipse.inf 33/5233/1
Matthias Sohn [Fri, 2 Mar 2012 23:53:00 +0000 (00:53 +0100)]
Include eclipse.inf

Commit 9169e7f9ec281740b6d55586d91a82e4ea6d7399 failed to add
org.eclipse.jgit/META-INF/eclipse.inf in order to fix bug 372845 since
JGit is not yet built by Tycho. Hence explicitly including it.

Bug: 372845
Change-Id: I6cb12327a237d69fbfe3d5e77d8a6ad7de442ad5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoRemove null access warning in DirCacheCheckout 29/5229/2
Kevin Sawicki [Fri, 2 Mar 2012 23:01:13 +0000 (15:01 -0800)]
Remove null access warning in DirCacheCheckout

Initially fill in the current DirCacheEntry field guarding
against a null index tree and use that variable instead of
calling getDirCacheEntry() on a possibly null DirCacheBuildIterator.

Change-Id: I16f388a16636aefdb07d66dae5d05655009e2a0e

12 years agoUpdate example code for obtaining a locked DirCache 30/5230/1
Kevin Sawicki [Fri, 2 Mar 2012 20:49:38 +0000 (12:49 -0800)]
Update example code for obtaining a locked DirCache

Previous example was calling a method that no longer exists
on DirCache.

Change-Id: I864842c58df4f116b318dc4a150b789745769a0d

12 years agoAllow to get end-of-line characters for a RawText 45/5045/7
Tomasz Zarna [Fri, 2 Mar 2012 20:06:09 +0000 (12:06 -0800)]
Allow to get end-of-line characters for a RawText

Bug: 370320
Change-Id: I18adc63596f4657516ccc6d704a561924c79d445
Signed-off-by: Kevin Sawicki <kevin@github.com>
12 years agoLoad .gitmodules config before adding values to it 25/5225/2
Sascha Scholz [Fri, 2 Mar 2012 17:31:09 +0000 (09:31 -0800)]
Load .gitmodules config before adding values to it

This prevents existing entries from being cleared when the
.gitmodules config is saved after the new submodule configuration
is added.

Change-Id: I66841f5e758a7527e2e6e25cf1318e5fea91a909
Signed-off-by: Kevin Sawicki <kevin@github.com>
12 years agoMerge "Exclude org.eclipse.jgit from pack200 packing"
Christian Halstrick [Fri, 2 Mar 2012 16:03:14 +0000 (11:03 -0500)]
Merge "Exclude org.eclipse.jgit from pack200 packing"

12 years agoMerge "Reuse existing modes and ids"
Christian Halstrick [Fri, 2 Mar 2012 08:46:03 +0000 (03:46 -0500)]
Merge "Reuse existing modes and ids"

12 years agoExclude org.eclipse.jgit from pack200 packing 19/5219/1
Matthias Sohn [Fri, 2 Mar 2012 08:09:39 +0000 (09:09 +0100)]
Exclude org.eclipse.jgit from pack200 packing

It seems pack200 became unable to correctly pack the bundle
org.eclipse.jgit (see bug 372845). Hence mark it to be excluded from
this packing step following the workaround which worked for
org.eclipse.jst.jsf.core (bug 335806).

Bug: 372845
Change-Id: I2e3d20645ac49125472ddc235afbe9f3c7480caf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoExtract filterCommands as a static method on ReceiveCommand 72/5172/5
Dave Borowitz [Mon, 27 Feb 2012 20:15:49 +0000 (12:15 -0800)]
Extract filterCommands as a static method on ReceiveCommand

Change-Id: I24501f95185878d09b54562e48cb4e7e45dd3968

12 years agoRemove PreUploadHook.onPreAdvertiseRefs 85/5085/5
Dave Borowitz [Tue, 14 Feb 2012 18:33:05 +0000 (10:33 -0800)]
Remove PreUploadHook.onPreAdvertiseRefs

AdvertiseRefsHook.advertiseRefs subsumes this behavior.

Change-Id: Id2d1ebb2503c9ba79eda58aaea2fd76ec233427f

12 years agoAdd an AdvertiseRefsHookChain, similar to the other hook chains 86/5086/6
Dave Borowitz [Tue, 14 Feb 2012 22:54:45 +0000 (14:54 -0800)]
Add an AdvertiseRefsHookChain, similar to the other hook chains

Change-Id: I3bb0dc86047fe0446d18e0055f714092a658d228

12 years agoModify refs in UploadPack/ReceivePack using a hook interface 84/5084/9
Dave Borowitz [Wed, 8 Feb 2012 22:30:04 +0000 (14:30 -0800)]
Modify refs in UploadPack/ReceivePack using a hook interface

This is intended to replace the RefFilter interface (but does not yet,
for backwards compatibility). That interface required lots of extra
scanning and copying in filter cases such as only advertising a subtree
of the refs directory. Instead, provide a hook that can be executed
right before ref advertisement, using the public methods on
UploadPack/ReceivePack to explicitly set the map of advertised refs.

Change-Id: I0067019a191c8148af2cfb71a675f2258c5af0ca

12 years agoFix a typo referring to RevFilter as RefFilter 83/5083/6
Dave Borowitz [Wed, 8 Feb 2012 22:30:08 +0000 (14:30 -0800)]
Fix a typo referring to RevFilter as RefFilter

Change-Id: I173efca7540b522d386216d1bd229e9a061263b2

12 years agoMinor javadoc wording fixes in ReceivePack 71/5171/5
Dave Borowitz [Mon, 27 Feb 2012 19:56:55 +0000 (11:56 -0800)]
Minor javadoc wording fixes in ReceivePack

Change-Id: I5b409ef39aee890bcd7d4277e36b85ac4dc48281

12 years agoExpose an OutputStream from ReceivePack for sending client messages 70/5170/5
Dave Borowitz [Mon, 27 Feb 2012 19:54:19 +0000 (11:54 -0800)]
Expose an OutputStream from ReceivePack for sending client messages

Callers may want to format and flush their own output, for example in a
PreReceiveHook that creates its own TextProgressMonitor. The actual
underlying msgOut can change over the lifetime of ReceivePack, so we
implement a small wrapper.

Change-Id: I57b6d6cad2542aaa93dcadc06cb3e933e81bcd3d

12 years agoAllow creating ReceiveCommands with a specified type 90/5090/3
Dave Borowitz [Wed, 15 Feb 2012 19:10:52 +0000 (11:10 -0800)]
Allow creating ReceiveCommands with a specified type

This allows callers who know in advance whether a command is UPDATE or
UPDATE_NONFASTFORWARD to specify this in the constructor rather than
with a separate method call.

Change-Id: Iae483594a4ff370ff75d17a7b0648c5590b3d1bd

12 years agoExecute ReceiveCommands via a method rather than in ReceivePack 81/5081/7
Dave Borowitz [Tue, 7 Feb 2012 23:16:40 +0000 (15:16 -0800)]
Execute ReceiveCommands via a method rather than in ReceivePack

This allows a PreReceiveHook to easily "take over" all of the
ReceiveCommands passed to it, preventing any of them from being handled
within the ReceivePack core.

Change-Id: I2a8c1fc44e8dcadf22cd97a8ec4ee79d4d9d08f1

12 years agoReuse existing modes and ids 95/5195/2
Kevin Sawicki [Wed, 29 Feb 2012 23:07:37 +0000 (15:07 -0800)]
Reuse existing modes and ids

This change replaces calls to getEntryObjectId and getEntryFileMode
with the existing method local variables for the index, merge, and
head tree iterators.

Change-Id: I75d1edfdd192a009fc916102ec052434c6302d00

12 years agoAdd command support for applying a stashed commit 73/5173/2
Kevin Sawicki [Mon, 27 Feb 2012 23:11:00 +0000 (15:11 -0800)]
Add command support for applying a stashed commit

Applies the changes in a stashed commit to the local working
directory and index

Bug: 309355
Change-Id: I9fd5ede8affc7f0060ffa7c5cec34573b6fa2b1b
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd support for creating a stashed commit 60/4760/17
Kevin Sawicki [Mon, 27 Feb 2012 20:44:34 +0000 (12:44 -0800)]
Add support for creating a stashed commit

Adds a new command to stash the index and working directory
changes in a commit stored in refs/stash

Bug: 309355
Change-Id: I2ce85b1601b74b07e286a3f99feb358dfbdfe29c
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd all paths option to CheckoutCommand 52/5152/7
Kevin Sawicki [Sun, 26 Feb 2012 15:10:57 +0000 (16:10 +0100)]
Add all paths option to CheckoutCommand

This will perform the equivalent  of running a
'git checkout -- .' at the root of a repository

Change-Id: I3e2dd563700999bc063effdd3640499c8ed08136
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoLet the date formatter pick the locale. 66/4966/4
Daniel Megert [Wed, 22 Feb 2012 20:32:43 +0000 (21:32 +0100)]
Let the date formatter pick the locale.

Instead of using the locale from the SystemReader we let the
SystemReader create the date formats without passing the locale.

Bug 368756
Change-Id: I6be9e07af804a08f3f3ac2d2d526ef594eed19e3
Signed-off-by: Daniel Megert <daniel_megert@ch.ibm.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd support for autosetuprebase to the CloneCommand 19/4919/3
Stefan Lay [Thu, 23 Feb 2012 17:32:02 +0000 (09:32 -0800)]
Add support for autosetuprebase to the CloneCommand

Bug: 345536
Change-Id: I93c609235dec4e5e3a2ddc275c28b202bf868d40
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Kevin Sawicki <kevin@github.com>
12 years agoMerge "Add IGNORE_ERRORS to FileUtils.delete()"
Matthias Sohn [Tue, 21 Feb 2012 19:34:42 +0000 (14:34 -0500)]
Merge "Add IGNORE_ERRORS to FileUtils.delete()"

12 years agoEolCanonicalizingInputStream: binary detection should be optional 30/5130/1
Marc Strapetz [Tue, 21 Feb 2012 14:18:08 +0000 (15:18 +0100)]
EolCanonicalizingInputStream: binary detection should be optional

EolCanonicalizingInputStream may also be used in combination with
.gitattributes. If .gitattributes states that a file is of type text, line
endings have to be canonicalized even if the actual file content seems
to be binary.

Change-Id: Ie4ccdfc5cb91fbd55e06f51146cf5c7c84b8e18b

12 years agoAdd IGNORE_ERRORS to FileUtils.delete() 88/5088/2
Christian Halstrick [Tue, 21 Feb 2012 13:23:43 +0000 (14:23 +0100)]
Add IGNORE_ERRORS to FileUtils.delete()

There are a few situations where you want to delete files or folders but
where you are not interested in getting exceptions if this doesn't
succeed. E.g. if you delete garbage in the GC class you want that if
certain files can't be deleted the command succeeds. Maybe the next
garbage collector run has more luck not to interfere with a virus
scanner run on Windows. Therefore an option is added to
FileUtils.delete() not to report errors in such cases.

Change-Id: I58994d8c481e591dcbb0f2be7dfa562e125f0f08
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
12 years agoPrepare 2.0.0-SNAPSHOT builds 02/5102/1
Matthias Sohn [Wed, 15 Feb 2012 23:49:49 +0000 (00:49 +0100)]
Prepare 2.0.0-SNAPSHOT builds

Change-Id: I946e315af04227727ac937ebe9d70ae1ea4e8936
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge branch 'stable-1.3' 01/5101/1
Matthias Sohn [Wed, 15 Feb 2012 23:44:36 +0000 (00:44 +0100)]
Merge branch 'stable-1.3'

* stable-1.3:
  Prepare post 1.3.0.201202151440-r build
  JGit 1.3.0.201202151440-r
  Generate conflicts and index updates on file mode changes

Change-Id: Ie99780ef5cdea7b3ea1ea076282fe0a25f14f469
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoPrepare post 1.3.0.201202151440-r build 00/5100/1 stable-1.3
Matthias Sohn [Wed, 15 Feb 2012 23:41:52 +0000 (00:41 +0100)]
Prepare post 1.3.0.201202151440-r build

Change-Id: I4d695273e3151c22f2df9a58725cc7ba21ab6043
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoJGit 1.3.0.201202151440-r 91/5091/1 v1.3.0.201202151440-r
Matthias Sohn [Wed, 15 Feb 2012 19:42:11 +0000 (20:42 +0100)]
JGit 1.3.0.201202151440-r

Change-Id: I663208919f297836a9c16bf458e4a43ffaca4c12
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoGenerate conflicts and index updates on file mode changes 78/5078/1
Christian Halstrick [Mon, 13 Feb 2012 08:39:05 +0000 (09:39 +0100)]
Generate conflicts and index updates on file mode changes

Handle more cases for file mode changes. Especially make sure that the
following cases are handled correctly.

Case 1)

  An entry in the working tree, HEAD tree, and merge tree have
  different modes and different content.

  Prior Outcome:
    Dirty working tree content is replaced and file mode
    changes are lost.

  New Outcome:
    Conflict is generated.

Case 2)

  An entry in the index and merge tree have the same content
  but different modes but both modes are file type modes.

  Prior Outcome:
    File mode in working tree is not updated and the working
    directory is dirty.

  New Outcome:
    Index is updated and the working directory is clean.

Bug: 363772
Change-Id: I224602d68228eb419813986807f1eeab77e9c302
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Also-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge branch 'stable-1.3' 73/5073/1
Matthias Sohn [Mon, 13 Feb 2012 06:33:43 +0000 (07:33 +0100)]
Merge branch 'stable-1.3'

* stable-1.3:
  Prepare post 1.3.0.201202121842-rc4 builds
  JGit 1.3.0.201202121842-rc4
  Support gitdir references in working tree .git file
  Support committing submodule updates
  Update iplog tool's README

Change-Id: Id70f4d4b059b03d4fa6fbd9137b81a337e9c48e8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoPrepare post 1.3.0.201202121842-rc4 builds 72/5072/1
Matthias Sohn [Mon, 13 Feb 2012 06:28:37 +0000 (07:28 +0100)]
Prepare post 1.3.0.201202121842-rc4 builds

Change-Id: I50e0e6c2bccab5f3da62cbfe976f065169426906
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoJGit 1.3.0.201202121842-rc4 69/5069/1 v1.3.0.201202121842-rc4
Matthias Sohn [Sun, 12 Feb 2012 23:47:12 +0000 (00:47 +0100)]
JGit 1.3.0.201202121842-rc4

Change-Id: I82c6c0c175ab6fb4e2113101f36c8d2ddf4a13c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoRevert non-sense logic in IO.readFully 66/5066/1
Robin Rosenberg [Sun, 12 Feb 2012 19:40:15 +0000 (20:40 +0100)]
Revert non-sense logic in IO.readFully

This was introduced in alleged support for autocrlf, but the
logic makes no sense here.

Change-Id: If37f3b90f21f875cee7165e17a17adfda446384d

12 years agoSupport gitdir references in working tree .git file 29/5029/4
Kevin Sawicki [Wed, 8 Feb 2012 22:10:28 +0000 (23:10 +0100)]
Support gitdir references in working tree .git file

A '.git' file in a repository's working tree root is now parsed
as a ref to a folder located elsewhere.  This supports submodules
having their repository location outside of the parent repository's
working directory such as in the parent repository's '.git/modules'
directory.

This adds support to BaseRepositoryBuilder for repositories created
with the '--separate-git-dir' option specified to 'git init'.

Change-Id: I73c538f6d845bdbc0c4e2bce5a77f900cf36e1a9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd getters for old and new prefixes in DiffFormatter 44/5044/2
Tomasz Zarna [Thu, 2 Feb 2012 10:59:28 +0000 (11:59 +0100)]
Add getters for old and new prefixes in DiffFormatter

Bug: 370318
Change-Id: Iaf9282ba55ee3bb4e2c27fb71c598b308771bf57

12 years agoSupport committing submodule updates 30/5030/1
Kevin Sawicki [Mon, 23 Jan 2012 19:37:10 +0000 (11:37 -0800)]
Support committing submodule updates

Use the submodule object id provided by the working
tree iterator

Change-Id: Ibf82f56c04cb9c91b2b309cf0cfa3f638539e23c

12 years agoUpdate iplog tool's README 05/5005/1
Matthias Sohn [Fri, 27 Jan 2012 08:30:43 +0000 (09:30 +0100)]
Update iplog tool's README

Change-Id: I0a6d770b0c4deb11fea23b875ef5449c619c05a1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Add developers section to root POM file"
Matthias Sohn [Thu, 26 Jan 2012 12:42:55 +0000 (07:42 -0500)]
Merge "Add developers section to root POM file"

12 years agoMerge "Allow to list tags with org.eclipse.jgit.pgm.Tag"
Robin Rosenberg [Wed, 25 Jan 2012 18:10:15 +0000 (13:10 -0500)]
Merge "Allow to list tags with org.eclipse.jgit.pgm.Tag"

12 years agoAdd developers section to root POM file 97/4997/2
Kevin Sawicki [Wed, 25 Jan 2012 17:01:55 +0000 (09:01 -0800)]
Add developers section to root POM file

This section contains the names of the current committers
and is required for acceptance to the Maven Central repository

Change-Id: Ib758cfe0a574aa3e80af9d289bec1a74d9b78d25

12 years agoMove writeTrashFile and deleteFile into JGitTestUtil 82/4982/2
Dariusz Luksza [Wed, 25 Jan 2012 00:24:09 +0000 (01:24 +0100)]
Move writeTrashFile and deleteFile into JGitTestUtil

Moves RepositoryTestCase.writeThashFile, RepositoryTestCase.deleteFile
and dependencies into JGitTestUtil for further reuse.

Required-by-EGit: If8dfa0251797aca56ddc825619500dc21885ba26
Change-Id: I6fc62c8e6626f907e544b5bbe5d64e864a2c323f
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
12 years agoAdd scm section to root POM file 84/4984/1
Kevin Sawicki [Mon, 23 Jan 2012 17:19:18 +0000 (09:19 -0800)]
Add scm section to root POM file

Change-Id: I23db67685a7b6a481961eb6ed6b4b80b2d0cace8

12 years agoReally close output stream when core.autocrlf is true 83/4983/1
Robin Rosenberg [Sun, 22 Jan 2012 23:57:39 +0000 (00:57 +0100)]
Really close output stream when core.autocrlf is true

Change-Id: I8a0d91e908145168c32589600bd1598826511ae3

12 years agoWorkaround incompatible refactoring in Jetty 7.6.0 69/4969/2
Tomasz Zarna [Fri, 20 Jan 2012 23:15:03 +0000 (00:15 +0100)]
Workaround incompatible refactoring in Jetty 7.6.0

In Jetty 7.6 package org.eclipse.jetty.http.security was renamed to
org.eclipse.jetty.util.security [1] breaking compatibility.

Compare docs for the package in 7.5.4 [2] and missing part in 7.6.0 [3].
To fix until we switch to Jetty 8, restrict the maximum version to 7.6.0
exclusive.

[1] http://dev.eclipse.org/mhonarc/lists/jetty-dev/msg01175.html
[2] http://download.eclipse.org/jetty/7.5.4.v20111024/apidocs/
[3] http://download.eclipse.org/jetty/7.6.0.RC4/apidocs/

Change-Id: I82b107ec76e66367e55e2cc20233a7924bf7be9f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd command support for listing stashed commits 50/4750/10
Kevin Sawicki [Mon, 19 Dec 2011 17:46:37 +0000 (09:46 -0800)]
Add command support for listing stashed commits

Bug: 309355
Change-Id: I34a8c251b89abcdb67565ca49bee02e5e2113593
Signe-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoMerge "Support relative submodule URLs on init/add/sync"
Matthias Sohn [Wed, 18 Jan 2012 21:26:42 +0000 (16:26 -0500)]
Merge "Support relative submodule URLs on init/add/sync"

12 years agoSupport relative submodule URLs on init/add/sync 62/4962/3
Kevin Sawicki [Tue, 17 Jan 2012 17:35:29 +0000 (09:35 -0800)]
Support relative submodule URLs on init/add/sync

Interpret submodule URLs that start with './' or '../' as
relative to either the configured remote for the HEAD branch,
or 'origin', or the parent repository working directory if no
remote URL is configured

Bug: 368536
Change-Id: Id4985824023b75cd45cd64a4dd9d421166391e10

12 years agoAdd BranchTrackingStatus for getting remote tracking status 32/4732/4
Robin Stocker [Mon, 16 Jan 2012 21:33:03 +0000 (22:33 +0100)]
Add BranchTrackingStatus for getting remote tracking status

This is used by EGit change I1e1caca561d1b0a0c194bfc42e64b698f42c6e6a to
show branch status in decoration.

It can also be used for providing the same output as C Git in "git
status".

Change-Id: I8d2b108c89905c3f0496f3d517879596740787c0
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd BranchConfig helper for access to branch config section 30/4730/4
Robin Stocker [Mon, 16 Jan 2012 21:18:54 +0000 (22:18 +0100)]
Add BranchConfig helper for access to branch config section

Getting the name of the remote-tracking branch given a branch is not so
easy to get right. This class provides a way to do that and could be
used for more branch config related things (e.g. in PullCommand).

Change-Id: I896a2384217936c8b672df8b81c9599f5c350458
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd RevWalkUtils with count(start, end) method 31/4731/4
Robin Stocker [Mon, 16 Jan 2012 21:05:20 +0000 (22:05 +0100)]
Add RevWalkUtils with count(start, end) method

It returns the number of commits that are in start and not in end.
Useful for calculating how much a branch is ahead of another one.

Change-Id: I09f7d9b049beea417da7ff32c9f8bf0d4ed46a7f
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Support more of AutoCRLF"
Christian Halstrick [Mon, 16 Jan 2012 15:53:13 +0000 (10:53 -0500)]
Merge "Support more of AutoCRLF"

12 years agoFix resolution of tree when path is empty 56/4956/4
Robin Rosenberg [Sun, 15 Jan 2012 22:51:43 +0000 (23:51 +0100)]
Fix resolution of tree when path is empty

Revision strings that end with a ':' with no trailing path
should return the tree associated with the current ref parsed

Bug: 368370
Change-Id: I7c7617a77bd418bad4e570be2d1e9002ad280762
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
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