]> source.dussan.org Git - jgit.git/log
jgit.git
12 years agoUpdate README regarding CRLF conversion, /etc and $HOME 59/5759/1
Robin Rosenberg [Sat, 28 Apr 2012 22:37:54 +0000 (00:37 +0200)]
Update README regarding CRLF conversion, /etc and $HOME

Change-Id: I3c41a8ee7f500e2c39df94eaf5d87c234934b741

12 years agoEnable large file support 89/5589/4
Robin Rosenberg [Mon, 16 Apr 2012 22:18:10 +0000 (00:18 +0200)]
Enable large file support

Allow adding files with size over 2 GB. The drawback is that the tests
for huge file support adds roughly 10 minutes of execution time.
For that reason we @Ignore the test in the standard test execution.

Change-Id: I5788e8009899203b346f353297166825b3744575

12 years agoAllow to write tests with CLI syntax 08/5408/2
Tomasz Zarna [Fri, 23 Mar 2012 08:10:41 +0000 (09:10 +0100)]
Allow to write tests with CLI syntax

CQ: 6385
Bug: 365444
Change-Id: I2d5164cd92429673fe3c37e9f5f9bc565192cc12
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoEnable DirCacheEntry's copyMetaData to not copy stage info 93/5493/5
Robin Rosenberg [Fri, 13 Apr 2012 22:40:06 +0000 (00:40 +0200)]
Enable DirCacheEntry's copyMetaData to not copy stage info

When there is a conflict sometimes we did not set the stage of
the conflict entries properly for the STAGE_1 entry.

Change-Id: I1c28ff6251fdbc95f7c40fc3e401f1b41157a9f6

12 years agoMerge "Fix tests for Ant task "git-clone""
Christian Halstrick [Tue, 17 Apr 2012 07:38:12 +0000 (03:38 -0400)]
Merge "Fix tests for Ant task "git-clone""

12 years agoHide two warnings about boxing 94/5494/4
Robin Rosenberg [Mon, 16 Apr 2012 21:34:47 +0000 (23:34 +0200)]
Hide two warnings about boxing

Change-Id: I1cb7cdb81481019f4a55221d38d771fcc9451529
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoFix constructor for SafeBufferedOutputStream 83/5583/2
Robin Rosenberg [Fri, 13 Apr 2012 15:41:06 +0000 (17:41 +0200)]
Fix constructor for SafeBufferedOutputStream

The size shoould be passed to BufferedOutputStream's constructor.
All callers seem to use the default, but that could change.

Change-Id: I874afee6a9114698805e36813781547e6aa328a5

12 years agoMerge "UnsupportedCredentialItem with password authentication"
Robin Rosenberg [Mon, 9 Apr 2012 14:40:28 +0000 (10:40 -0400)]
Merge "UnsupportedCredentialItem with password authentication"

12 years agoUnsupportedCredentialItem with password authentication 29/5529/2
Robin Rosenberg [Thu, 5 Apr 2012 06:04:45 +0000 (08:04 +0200)]
UnsupportedCredentialItem with password authentication

If the server prompts for password, it comes as a StringType prompt.

Bug: 360862
Change-Id: Ic758456c21c8d68d1b3d7f56228beb7535b11735

12 years agoMerge "Fix broken TagCommand API"
Robin Rosenberg [Fri, 6 Apr 2012 09:34:00 +0000 (05:34 -0400)]
Merge "Fix broken TagCommand API"

12 years agoMerge "Cleanup possiblyFilteredInputStream() in WorkingTreeIterator"
Matthias Sohn [Fri, 6 Apr 2012 00:32:03 +0000 (20:32 -0400)]
Merge "Cleanup possiblyFilteredInputStream() in WorkingTreeIterator"

12 years agoMerge "Handle content length in WorkingTreeIterator"
Robin Rosenberg [Thu, 5 Apr 2012 23:29:08 +0000 (19:29 -0400)]
Merge "Handle content length in WorkingTreeIterator"

12 years agoFix broken TagCommand API 02/5302/2
Robin Rosenberg [Fri, 9 Mar 2012 11:03:20 +0000 (12:03 +0100)]
Fix broken TagCommand API

Tags can be un-annotated whereby there is no RevTag object, only
a ref pointing to the tagged object.

Bug: 360650
Change-Id: I06309c45c0a896fe2a0a874700febf78c9fb87e8

12 years agoCleanup possiblyFilteredInputStream() in WorkingTreeIterator 39/5539/1
Robin Rosenberg [Thu, 5 Apr 2012 22:26:06 +0000 (00:26 +0200)]
Cleanup possiblyFilteredInputStream() in WorkingTreeIterator

Use early return instead of nested if/else

Change-Id: I3b5048f9f5cfdfd01f916af550722532db3f9bb3

12 years agoMerge "Recurse into cloned submodules"
Matthias Sohn [Tue, 3 Apr 2012 22:42:03 +0000 (18:42 -0400)]
Merge "Recurse into cloned submodules"

12 years agoUnlock DirCache in case of occurring exception 69/4869/2
Jens Baumgart [Tue, 3 Apr 2012 15:25:32 +0000 (17:25 +0200)]
Unlock DirCache in case of occurring exception

A DirCache was not unlocked if an exception occurred in the
DirCacheCheckout constructor.

Bug: 365449
Change-Id: I231d902d52e3e5e9a7748eedaa63a2bb889ebb13
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
12 years agoMerge "Index config section and subsection names in one pass"
Robin Rosenberg [Mon, 2 Apr 2012 21:59:34 +0000 (17:59 -0400)]
Merge "Index config section and subsection names in one pass"

12 years agoMerge "Add @Override annotations to enums"
Robin Rosenberg [Mon, 2 Apr 2012 21:53:07 +0000 (17:53 -0400)]
Merge "Add @Override annotations to enums"

12 years agoMerge "Externalize parsing exception message for RebaseCommand#Action"
Matthias Sohn [Mon, 2 Apr 2012 20:02:39 +0000 (16:02 -0400)]
Merge "Externalize parsing exception message for RebaseCommand#Action"

12 years agoIndex config section and subsection names in one pass 87/5487/2
Shawn O. Pearce [Tue, 27 Mar 2012 19:32:16 +0000 (15:32 -0400)]
Index config section and subsection names in one pass

Instead of indexing the subsection names on each request for a given
section name, index both the section and subsection names in a single
scan through the entry list. This should improve lookup time for
reading the section names out of the configuration, especially for the
url.*.insteadof type of processing performed in RemoteConfig.

Change-Id: I7b3269565b1308f69d20dc3f3fe917aea00f8a73

12 years agoExternalize parsing exception message for RebaseCommand#Action 15/5515/1
Tomasz Zarna [Mon, 2 Apr 2012 09:36:29 +0000 (11:36 +0200)]
Externalize parsing exception message for RebaseCommand#Action

Change-Id: Id0d7801e4de98bf118dbecadf623c9ffd7ab7554

12 years agoAdd @Override annotations to enums 14/5514/1
Tomasz Zarna [Mon, 2 Apr 2012 09:24:05 +0000 (11:24 +0200)]
Add @Override annotations to enums

Change-Id: I8fa3b89a6349c1231251b346cae12c1c4f095929

12 years agoDon't use java.nio channel for file size determination 76/5276/11
Markus Duft [Mon, 2 Apr 2012 05:27:19 +0000 (07:27 +0200)]
Don't use java.nio channel for file size determination

Java NIO has some problems (like files closing unexpectedly because the
thread was interrupted). To avoid those problems, don't use a NIO
channel to determine the size of a file, but rather ask the File itself.

We have to be prepared to handle wrong/outdated information in this case
too, as the inode of the File may change between opening and determining
file size.

Change-Id: Ic7aa6c3337480879efcce4a3058b548cd0e2cef0

12 years agoRecurse into cloned submodules 98/5498/1
Kevin Sawicki [Mon, 2 Apr 2012 01:36:42 +0000 (18:36 -0700)]
Recurse into cloned submodules

Iterate over all successfully cloned submodules recursively
and continue initializing and updating until no more are found.

Bug: 375426
Change-Id: Ifb99e41e2deb0c369442bca3c0f5f072dd006816

12 years agoFix tests for Ant task "git-clone" 97/5497/1
Matthias Sohn [Sun, 1 Apr 2012 23:20:31 +0000 (01:20 +0200)]
Fix tests for Ant task "git-clone"

If project.init() isn't called GitCloneTaskTest fails when started from
Eclipse, according to [1] calling init() is necessary to properly
initialize the Ant project programmatically.

Always set the destination folder in order to ensure that all test
resources are created under the project's target folder and do not
pollute the project's source tree with test data.

[1]
http://ant.1045680.n5.nabble.com/project-createTask-not-working-with-ant-1-8-2-td3385716.html

Change-Id: Icbeb62680b018a92673faa58828b5e850564c7a8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge changes Ic8907231,I693148a5
Robin Rosenberg [Fri, 30 Mar 2012 16:25:47 +0000 (12:25 -0400)]
Merge changes Ic8907231,I693148a5

* changes:
  Sort Config entries and use O(log N) lookup
  Extract inner classes from Config

12 years agoFix loading packed objects >2G 90/5490/2
Shawn O. Pearce [Wed, 28 Mar 2012 14:12:20 +0000 (10:12 -0400)]
Fix loading packed objects >2G

Parsing the size from a packed object header was incorrectly computing
the total inflated length when the length exceeded the range of a Java
int. The next 7 bits of size information was shifted left as an int
using a shift of 25 bits, placing the higher bits of the size into the
sign position. When this size was extended to a long to be added to
the current size accumulator the size went negative, resulting in
NegativeArraySizeException being thrown.

Fix all places where this particular pattern of code is used to read a
pack size field, or a binary delta header, as they both use the same
variable length encoding scheme.

Change-Id: I04008728ed828f18202652c3d5401cf95a441d0a

12 years agoSort Config entries and use O(log N) lookup 86/5486/1
Shawn O. Pearce [Tue, 27 Mar 2012 15:49:13 +0000 (11:49 -0400)]
Sort Config entries and use O(log N) lookup

Decrease running time for getStringList (and all other get methods) by
looking for configuration entries using binary search rather than
linear search through the configuration file.

Configuration lines are sorted by section, subsection, name in a
sorted list whenever the snapshot is rebuilt. Binary search is used to
locate an index in the middle of the values, then walk backwards to
find the first value in the range.

Given a configuration of file of 5000 distinct section/subsection/name
triplets (e.g. a Gerrit Code Review project.config configuration file
with 5000 unique access control rules), this new code is faster to
lookup each rule individually using getStringList():

  old setStringList() 194 usec avg
      getStringList() 196 usec avg

  new setStringList() 188 usec avg
      getStringList()  24 usec avg

Change-Id: Ic8907231868c18eb946b72f341a6b58666b70324

12 years agoExtract inner classes from Config 85/5485/1
Shawn O. Pearce [Tue, 27 Mar 2012 14:43:02 +0000 (10:43 -0400)]
Extract inner classes from Config

The Config class is getting very large. Extract two of its inner
classes into new top level types to reduce the size of Config.
Rename them slightly in the process.

Change-Id: I693148a5ae2977378789bf455c880a6fd856c0f0

12 years agoHandle content length in WorkingTreeIterator 12/5412/2
Robin Rosenberg [Sun, 25 Mar 2012 12:42:54 +0000 (14:42 +0200)]
Handle content length in WorkingTreeIterator

Content length is computed and cached (short term) in the working
tree iterator when core.autocrlf is set.

Hopefully this is a cleaner fix than my previous attempt to make
autocrlf work.

Change-Id: I1b6bbb643101a00db94e5514b5e2b069f338907a

12 years agoAllow RepositoryResolver to throw ServiceMayNotContinueException 77/5477/1
Dave Borowitz [Mon, 26 Mar 2012 17:19:40 +0000 (10:19 -0700)]
Allow RepositoryResolver to throw ServiceMayNotContinueException

Implementations may want to send an error message to the user, which
doesn't really fit with any of the existing exception types.
ServiceMayNotContinueException, on the other hand, is documented as
always containing a user-visible error string, so use that.

Modify the git and HTTP transport mechanisms to properly relay this
message to the end user.

Change-Id: I362e67ea46102a145bf2c6284d38788537c9735f

12 years agoClarify documentation of exceptions in RepositoryResolver 76/5476/1
Dave Borowitz [Mon, 26 Mar 2012 16:53:32 +0000 (09:53 -0700)]
Clarify documentation of exceptions in RepositoryResolver

Change-Id: Idf805f76f24bfa1f3552366197e0ed4e45cb2b74

12 years agoProperly parse first line in ReceivePack with no '\0' 11/5411/1
Dave Borowitz [Fri, 23 Mar 2012 21:38:06 +0000 (14:38 -0700)]
Properly parse first line in ReceivePack with no '\0'

Change-Id: Ic98e17aff4e4b3c3fa0359082bab689e4522e3d7

12 years agoRevert "Allow to write tests with CLI syntax" 07/5407/1
Matthias Sohn [Thu, 22 Mar 2012 23:30:46 +0000 (00:30 +0100)]
Revert "Allow to write tests with CLI syntax"

This reverts commit bf845c126d53f07de103e03b68ddb7f24014cee5 since this
change needs to go through a formal IP review and Chris missed to file a
CQ for that.

Change-Id: I303515d78116f0591a2911dbfb9f857738f086a9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge "Allow to write tests with CLI syntax"
Christian Halstrick [Thu, 22 Mar 2012 11:39:14 +0000 (07:39 -0400)]
Merge "Allow to write tests with CLI syntax"

12 years agoAllow to write tests with CLI syntax 20/4720/8
Tomasz Zarna [Thu, 22 Mar 2012 10:29:18 +0000 (11:29 +0100)]
Allow to write tests with CLI syntax

Bug: 365444
Change-Id: I86f382913bc47665c5b9a2827b878e7dbedce7b1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd command support for dropping a stashed commit 93/5393/8
Kevin Sawicki [Wed, 21 Mar 2012 17:50:16 +0000 (10:50 -0700)]
Add command support for dropping a stashed commit

This extracts the logic for writing to the reflog from
RefDirectory into a new ReflogWriter class.  This class
creates a public API for writing reflog entries similar
to ReflogReader for reading reflog entries.

The new command supports rewriting the stash's log to remove
a configured entry followed by updating the stash ref to
the value at the bottom of the newly written log.

Change-Id: Icfcbc70e838666769a742a94196eb8dc9c7efcc7
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoIgnore trailing comments in transport SPI parsing 88/5388/5
Kevin Sawicki [Tue, 20 Mar 2012 05:00:49 +0000 (22:00 -0700)]
Ignore trailing comments in transport SPI parsing

Check for a '#' character in each line read and
parse the leading characters as the class name of
a TransportProtocol being registered via SPI.

Bug: 373439
Change-Id: If36cb62c07ecea78ba0f326a87edf1d80b7b42b6
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoCompare repository format version as parsed long 17/5217/5
Kevin Sawicki [Mon, 12 Mar 2012 17:00:52 +0000 (10:00 -0700)]
Compare repository format version as parsed long

This allows repositoryies with a missing repositoryformatversion
config value to be successfully opened but still throws exceptions
when the value is a non-long or greater than zero.

git-core attempts to parse this config value as a long as well
and defaults to 0 if the value is missing.

Bug: 368697
Change-Id: I4a93117afca37e591e8e0ab4d2f2eef4273f0cc9
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoCopy all branch configuration values when renaming 87/5387/3
Kevin Sawicki [Tue, 20 Mar 2012 01:03:20 +0000 (18:03 -0700)]
Copy all branch configuration values when renaming

Previously only certain values were copied over which caused
divergence in behavior between the JGit command and corresponding
CGit command.

Bug: 372051
Change-Id: I72a83215a679a713138da31f5ab838f14388d4bd
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoClarify the purpose of ObjectInserter.buffer() 67/5367/2
Shawn O. Pearce [Thu, 15 Mar 2012 14:57:56 +0000 (07:57 -0700)]
Clarify the purpose of ObjectInserter.buffer()

Recently Robin tried to increase the size of the buffer used by
ObjectInserter to fix a bug in the InputStream that handles AutoCRLF.
The purpose of this buffer is NOT to make a random InputStream work
correctly by passing it a larger buffer during read(byte[],int,int).

Clarify the Javadoc on the buffer() method to reduce the risk
someone tries to abuse it again.

While we are here, modify the method to load the field into a local
variable before returning. This should cut down 1 field load during
the common case of the buffer being already allocated.

Change-Id: Ic6898530d10fcd7e59f90397117a4a0d97e1f031
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoLogCommand#setMaxCount affects all commits 28/5028/4
Tomasz Zarna [Sun, 18 Mar 2012 00:13:01 +0000 (01:13 +0100)]
LogCommand#setMaxCount affects all commits

Bug: 370132
Change-Id: I9f5ff3640a4f69c0b48c97609728d7672e63e6ab
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoPass a DfsRepositoryDescription to InMemoryRepository 70/5370/1
Dave Borowitz [Thu, 15 Mar 2012 22:46:39 +0000 (15:46 -0700)]
Pass a DfsRepositoryDescription to InMemoryRepository

This was likely intended originally, but this class had never been
used, so the mistake went unnoticed.

Change-Id: I5e0e9f22ebf707c11d0581511c7a56b182188f77

12 years agoRevert "Quickfix for AutoCRLF handling" 66/5366/1
Shawn O. Pearce [Thu, 15 Mar 2012 14:21:14 +0000 (07:21 -0700)]
Revert "Quickfix for AutoCRLF handling"

This reverts commit 88fe2836edab8d8ce82d28acd9d07b061988ff3a.

Auto CRLF isn't special enough to be screwing around with the buffers
used for raw byte processing of the ObjectInserter API. If it needs a
buffer to process a file that is bigger than the buffer allocated by
an ObjectInserter, it needs to do its own buffer management.

Change-Id: Ida4aaa80d0f9f78035f3d2a9ebdde904c980f89a

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