aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/JGitText.java
Commit message (Collapse)AuthorAgeFilesLines
* Move JGitText to an internal packageRobin Rosenberg2012-03-121-579/+0
| | | | Change-Id: I763590a45d75f00a09097ab6f89581a3bbd3c797
* Add ApplyCommand to JGit APITomasz Zarna2012-03-041-0/+3
| | | | | | | Bug: 361548 CQ: 6243 Change-Id: I08e1369e142bb19f42a8d7bbb5a7d062cc8533fc Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add command support for applying a stashed commitKevin Sawicki2012-02-281-0/+4
| | | | | | | | | 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>
* Add support for creating a stashed commitKevin Sawicki2012-02-281-0/+2
| | | | | | | | | 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>
* Support gitdir references in working tree .git fileKevin Sawicki2012-02-081-0/+1
| | | | | | | | | | | | | 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>
* Support relative submodule URLs on init/add/syncKevin Sawicki2012-01-171-0/+1
| | | | | | | | | | 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
* Skip a number commits before starting to show the commit outputTomasz Zarna2012-01-021-0/+1
| | | | Change-Id: Id2666d897d29b6371f7a6cf241cfda02964b4971 Signed-off-by: Kevin Sawicki <kevin@github.com>
* Sort translation bundle keys in alphabetical order.Tomasz Zarna2012-01-021-39/+39
| | | | Change-Id: I83e26531ea924178ba43fa82b3c1fe02afd23eca Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add comand support for git-submoduleKevin Sawicki2011-12-281-0/+3
| | | | | | | | | | | | | | | | 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>
* Limit the number of commits in LogCommand outputTomasz Zarna2011-12-231-0/+1
| | | | | Bug: 316680 Change-Id: I88cf7aac6b5763cc94421433dd4bbd42f81e0e69
* Add exception class for when locking a file failsKevin Sawicki2011-12-181-1/+0
| | | | | | | | 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
* Support resolving integer-based reflog revisionsKevin Sawicki2011-12-161-1/+2
| | | | | | | | | | | 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
* Guard against null branch in PullCommandKevin Sawicki2011-11-221-0/+1
| | | | | | | | Throw a NoHeadException when Repository.getFullBranch returns null Bug: 351543 Change-Id: I666cd5b67781508a293ae553c6fe5c080c8f4d99 Signed-off-by: Kevin Sawicki <kevin@github.com>
* maxObjectSizeLimit for receive-pack.Sasa Zivkov2011-11-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ReceivePack (and PackParser) can be configured with the maxObjectSizeLimit in order to prevent users from pushing too large objects to Git. The limit check is applied to all object types although it is most likely that a BLOB will exceed the limit. In all cases the size of the object header is excluded from the object size which is checked against the limit as this is the size of which a BLOB object would take in the working tree when checked out as a file. When an object exceeds the maxObjectSizeLimit the receive-pack will abort immediately. Delta objects (both offset and ref delta) are also checked against the limit. However, for delta objects we will first check the size of the inflated delta block against the maxObjectSizeLimit and abort immediately if it exceeds the limit. In this case we even do not know the exact size of the resolved delta object but we assume it will be larger than the given maxObjectSizeLimit as delta is generally only chosen if the delta can copy more data from the base object than the delta needs to insert or needs to represent the copy ranges. Aborting early, in this case, avoids unnecessary inflating of the (huge) delta block. Unfortunately, it is too expensive (especially for a large delta) to compute SHA-1 of an object that causes the receive-pack to abort. This would decrease the value of this feature whose main purpose is to protect server resources from users pushing huge objects. Therefore we don't report the SHA-1 in the error message. Change-Id: I177ef24553faacda444ed5895e40ac8925ca0d1e Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add an object encapsulating the state of a PackWriterDave Borowitz2011-11-141-0/+1
| | | | | | | | Exposes essentially the same state machine to the programmer as is exposed to the client via a ProgressMonitor, using a wrapper around beginTask()/endTask(). Change-Id: Ic3622b4acea65d2b9b3551c668806981fa7293e3
* Cosmetic adjustment of relative date format, do not display "0 months"Robin Rosenberg2011-10-261-0/+1
| | | | | | | Though it may seem less precise, "0 months" looks bad and the reference Git implementation also does not display "0 months" Change-Id: I488e9c97656f9941788ae88d7c5c1562ab6c26f0
* Use JGitText.refAlreadyExists instead of "ref exists"Tomasz Zarna2011-08-241-1/+1
| | | | Change-Id: I113bcf82c6292db5269271f799d09c80acc40bcd
* Add DeleteTagCommand to JGit APITomasz Zarna2011-08-211-0/+1
| | | | | | Bug: 353226 Change-Id: I54ae237cab792742333a249eb5a774d5e1775af8 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Adds DiffEntry.scan(TreeWalk, boolean) methodDariusz Luksza2011-08-171-0/+2
| | | | | | | | | | | | | | | Adds method into DiffEntry class that allows to specify whether changed trees are included in scanning result list. By default changed trees aren't added, but in some cases having changed tree would be useful. Also adds check for tree count in TreeWalk and when it is different from two it will thrown an IllegalArgumentException. This change is required by egit I7ddb21e7ff54333dd6d7ace3209bbcf83da2b219 Change-Id: I5a680a73e1cffa18ade3402cc86008f46c1da1f1 Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Cloning should fail when destination directory exists and is not emptyAdrian Goerler2011-07-061-0/+1
| | | | | | | | | | | | | | When trying to clone into a folder that already contains a cloned repository native git will fail with a message "fatal: destination path 'folder' already exists and is not an empty directory.". Now JGit will also fail in this situation throwing a JGitInternalException. The test case was provided by Tomasz Zarna. Bug: 347852 Change-Id: If9e9919a5f92d13cf038dc470c21ee5967322dac Also-by: Tomasz Zarna <Tomasz.Zarna@pl.ibm.com> Signed-off-by: Adrian Goerler <adrian.goerler@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Push errors back over sideband when possibleShawn O. Pearce2011-06-091-0/+1
| | | | | | | | | | | | | | | | | If an internal exception occurs while packing and the request needs to abort, the HTTP response might already be committed due to progress message having already been delivered to the client. This prevents UploadPackServlet from resetting the response and sending back an HTTP 500 response. Try to catch all exceptions and report internal errors over the sideband stream or as an ERR command during the initial ACK/NAK negotiation phase. This allows JGit to transmit an error message that the user will receive on their console without needing to worry about resetting the (already gone) HTTP response. Change-Id: Ie393fb8bb55d2b79ab1276adf71c781c1807f9fe Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Report progress while updating referencesShawn O. Pearce2011-06-091-0/+1
| | | | | | | | | | | | | If a fetch or push needs to apply more than a few references to the local repository it may take more than 0.25 seconds to process all of the updates. This is especially true in the DHT storage system during an initial push of a project with many tags. The backend database may need to use a transaction to ensure each tag reference creation is unique, and there may be large delays caused by these transactions. Change-Id: Ib11a077adfbd525253e425d327f2e2c2380804c7 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* blame: Compute the origin of lines in a result fileShawn O. Pearce2011-05-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BlameGenerator digs through history and discovers the origin of each line of some result file. BlameResult consumes the stream of regions created by the generator and lays them out in a table for applications to display alongside of source lines. Applications may optionally push in the working tree copy of a file using the push(String, byte[]) method, allowing the application to receive accurate line annotations for the working tree version. Lines that are uncommitted (difference between HEAD and working tree) will show up with the description given by the application as the author, or "Not Committed Yet" as a default string. Applications may also run the BlameGenerator in reverse mode using the reverse(AnyObjectId, AnyObjectId) method instead of push(). When running in the reverse mode the generator annotates lines by the commit they are removed in, rather than the commit they were added in. This allows a user to discover where a line disappeared from when they are looking at an older revision in the repository. For example: blame --reverse 16e810b2..master -L 1080, org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefDirectoryTest.java ( 1080) } 2302a6d3 (Christian Halstrick 2011-05-20 11:18:20 +0200 1081) 2302a6d3 (Christian Halstrick 2011-05-20 11:18:20 +0200 1082) /** 2302a6d3 (Christian Halstrick 2011-05-20 11:18:20 +0200 1083) * Kick the timestamp of a local file. Above we learn that line 1080 (a closing curly brace of the prior method) still exists in branch master, but the Javadoc comment below it has been removed by Christian Halstrick on May 20th as part of commit 2302a6d3. This result differs considerably from that of C Git's blame --reverse feature. JGit tells the reader which commit performed the delete, while C Git tells the reader the last commit that still contained the line, leaving it an exercise to the reader to discover the descendant that performed the removal. This is still only a basic implementation. Quite notably it is missing support for the smart block copy/move detection that the C implementation of `git blame` is well known for. Despite being incremental, the BlameGenerator can only be run once. After the generator runs it cannot be reused. A better implementation would support applications browsing through history efficiently. In regards to CQ 5110, only a little of the original code survives. CQ: 5110 Bug: 306161 Change-Id: I84b8ea4838bb7d25f4fcdd540547884704661b8f Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add LsRemoteCommand to JGit APIChristoph Brill2011-05-191-0/+1
| | | | | | | Bug: 343801 Change-Id: Ic651e8e09143e15ed459461b50b2222e13da56c4 Also-by: Chris Aniszczyk <caniszczyk@gmail.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Formatter for relative datesMatthias Sohn2011-05-091-0/+13
| | | | | Change-Id: I78b307177c68c578e10101a0ee7b6306880a08f7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* PackWriter: Remove dummy list 0Shawn O. Pearce2011-04-011-1/+0
| | | | | | | | | | Instead of looping over the objectsLists array, always set slot 0 to null and explicitly work on the 4 indexes that matter. This kills some loops and increases the length of the code slightly, but I've always really disliked that dummy 0 slot. Change-Id: I5ad938501c1c61f637ffdaff0d0d88e3962d8942 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* UploadPack: Report invalid want lines with ERRShawn O. Pearce2011-03-171-1/+1
| | | | | | | | | | Instead of aborting hard with a server-side exception, report an error to the client with "ERR %s" in a context where the client is expecting ACK/NAK. Older clients will report this text to the user, but newer ones know how to format this message in a more user-friendly way. Change-Id: I1879b38988ba66f648c069c10dbfa14c3f34adb2 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Replace 'occured' by 'occurred'Philipp Thun2011-03-151-2/+2
| | | | | | This change fixes a common typo. Signed-off-by: Philipp Thun <philipp.thun@sap.com>
* Make the supported Transports extensible and discoverableShawn O. Pearce2011-03-131-0/+8
| | | | | | | | | | | | | | | The new TransportProtocol type describes what a particular Transport implementation wants in order to support a connection. 3rd parties can now plug into the Transport.open() logic by implementing their own TransportProtocol and Transport classes, and registering with Transport.register(). GUI applications can help the user configure a connection by looking at the supported fields of a particular TransportProtocol type, which makes the GUI more dynamic and may better support new Transports. Change-Id: Iafd8e3a6285261412aac6cba8e2c333f8b7b76a5 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Add -o option to commit commandPhilipp Thun2011-03-111-0/+2
| | | | | | | This change adds the --only/ -o option to the commit command. Change-Id: I44352d56877f8204d985cb7a35a2e0faffb7d341 Signed-off-by: Philipp Thun <philipp.thun@sap.com>
* Add git-reset to the Git APIChris Aniszczyk2011-02-171-0/+1
| | | | | | Bug: 334764 Change-Id: Ice404629687d7f2a595d8d4eccf471b12f7e32ec Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* daemon: Use HTTP's resolver and factory patternShawn O. Pearce2011-02-141-0/+2
| | | | | | | | | | | | | | | | | | | Using a resolver and factory pattern for the anonymous git:// Daemon class makes transport.Daemon more useful on non-file storage systems, or in embedded applications where the caller wants more precise control over the work tasks constructed within the daemon. Rather than defining new interfaces, move the existing HTTP ones into transport.resolver and make them generic on the connection handle type. For HTTP, continue to use HttpServletRequest, and for transport.Daemon use DaemonClient. To remain compatible with transport.Daemon, FileResolver needs to learn how to use multiple base directories, and how to export any Repository instance at a fixed name. Change-Id: I1efa6b2bd7c6567e983fbbf346947238ea2e847e Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* PackWriter: Support reuse of entire packsShawn O. Pearce2011-02-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most expensive part of packing a repository for transport to another system is enumerating all of the objects in the repository. Once this gets to the size of the linux-2.6 repository (1.8 million objects), enumeration can take several CPU minutes and costs a lot of temporary working set memory. Teach PackWriter to efficiently reuse an existing "cached pack" by answering a clone request with a thin pack followed by a larger cached pack appended to the end. This requires the repository owner to first construct the cached pack by hand, and record the tip commits inside of $GIT_DIR/objects/info/cached-packs: cd $GIT_DIR root=$(git rev-parse master) tmp=objects/.tmp-$$ names=$(echo $root | git pack-objects --keep-true-parents --revs $tmp) for n in $names; do chmod a-w $tmp-$n.pack $tmp-$n.idx touch objects/pack/pack-$n.keep mv $tmp-$n.pack objects/pack/pack-$n.pack mv $tmp-$n.idx objects/pack/pack-$n.idx done (echo "+ $root"; for n in $names; do echo "P $n"; done; echo) >>objects/info/cached-packs git repack -a -d When a clone request needs to include $root, the corresponding cached pack will be copied as-is, rather than enumerating all of the objects that are reachable from $root. For a linux-2.6 kernel repository that should be about 376 MiB, the above process creates two packs of 368 MiB and 38 MiB[1]. This is a local disk usage increase of ~26 MiB, due to reduced delta compression between the large cached pack and the smaller recent activity pack. The overhead is similar to 1 full copy of the compressed project sources. With this cached pack in hand, JGit daemon completes a clone request in 1m17s less time, but a slightly larger data transfer (+2.39 MiB): Before: remote: Counting objects: 1861830, done remote: Finding sources: 100% (1861830/1861830) remote: Getting sizes: 100% (88243/88243) remote: Compressing objects: 100% (88184/88184) Receiving objects: 100% (1861830/1861830), 376.01 MiB | 19.01 MiB/s, done. remote: Total 1861830 (delta 4706), reused 1851053 (delta 1553844) Resolving deltas: 100% (1564621/1564621), done. real 3m19.005s After: remote: Counting objects: 1601, done remote: Counting objects: 1828460, done remote: Finding sources: 100% (50475/50475) remote: Getting sizes: 100% (18843/18843) remote: Compressing objects: 100% (7585/7585) remote: Total 1861830 (delta 2407), reused 1856197 (delta 37510) Receiving objects: 100% (1861830/1861830), 378.40 MiB | 31.31 MiB/s, done. Resolving deltas: 100% (1559477/1559477), done. real 2m2.938s Repository owners can periodically refresh their cached packs by repacking their repository, folding all newer objects into a larger cached pack. Since repacking is already considered to be a normal Git maintenance activity, this isn't a very big burden. [1] In this test $root was set back about two weeks. Change-Id: Ib87131d5c4b5e8c5cacb0f4fe16ff4ece554734b Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* PackWriter: Display totals after sending objectsShawn O. Pearce2011-02-021-0/+1
| | | | | | | | | | | | | | | | | | | | CGit pack-objects displays a totals line after the pack data was fully written. This can be useful to understand some of the decisions made by the packer, and has been a great tool for helping to debug some of that code. Track some of the basic values, and send it to the client when packing is done: remote: Counting objects: 1826776, done remote: Finding sources: 100% (55121/55121) remote: Getting sizes: 100% (25654/25654) remote: Compressing objects: 100% (11434/11434) remote: Total 1861830 (delta 3926), reused 1854705 (delta 38306) Receiving objects: 100% (1861830/1861830), 386.03 MiB | 30.32 MiB/s, done. Change-Id: If3b039017a984ed5d5ae80940ce32bda93652df5 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* PackWriter: Correct 'Compressing objects' progress messageShawn O. Pearce2011-02-011-0/+1
| | | | | | | | | | | | | | | The first 'Compressing objects' progress message is wrong, its actually PackWriter looking up the sizes of each object in the ObjectDatabase, so objects can be sorted correctly in the later type-size sort that tries to take advantage of "Linus' Law" to improve delta compression. Rename the progress to say 'Getting sizes', which is an accurate description of what it is doing. Change-Id: Ida0a052ad2f6e994996189ca12959caab9e556a3 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Proper handling of rebase during pullMathias Kinzler2011-01-311-0/+1
| | | | | | | | After consulting with Christian Halstrick, it turned out that the handling of rebase during pull was implemented incorrectly. Change-Id: I40f03409e080cdfeceb21460150f5e02a016e7f4 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* Introduce metaData compare between working tree and index entriesChristian Halstrick2011-01-211-0/+1
| | | | | | | | | | | Instead of offering only a high-level isModified() method a new method compareMetadata() is introduced which compares a working tree entry and a index entry by looking at metadata only. Some use-cases (e.g. computing the content-id in idBuffer()) may use this new method instead of isModified(). Change-Id: I4de7501d159889fbac5ae6951f4fef8340461b47 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* File utility for creating a new empty fileMatthias Sohn2011-01-141-0/+1
| | | | | | | | | | The java.io.File.createNewFile() method for creating new empty files reports failure by returning false. To ease proper checking of return values provide a utility method wrapping createNewFile() throwing IOException on failure. Change-Id: I42a3dc9d8ff70af62e84de396e6a740050afa896 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merging Git notesSasa Zivkov2011-01-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merging Git notes branches has several differences from merging "normal" branches. Although Git notes are initially stored as one flat tree the tree may fanout when the number of notes becomes too large for efficient access. In this case the first two hex digits of the note name will be used as a subdirectory name and the rest 38 hex digits as the file name under that directory. Similarly, when number of notes decreases a fanout tree may collapse back into a flat tree. The Git notes merge algorithm must take into account possibly different tree structures in different note branches and must properly match them against each other. Any conflict on a Git note is, by default, resolved by concatenating the two conflicting versions of the note. A delete-edit conflict is, by default, resolved by keeping the edit version. The note merge logic is pluggable and the caller may provide custom note merger that will perform different merging strategy. Additionally, it is possible to have non-note entries inside a notes tree. The merge algorithm must also take this fact into account and will try to merge such non-note entries. However, in case of any merge conflicts the merge operation will fail. Git notes merge algorithm is currently not trying to do content merge of non-note entries. Thanks to Shawn Pearce for patiently answering my questions related to this topic, giving hints and providing code snippets. Change-Id: I3b2335c76c766fd7ea25752e54087f9b19d69c88 Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Implement a revert commandRobin Rosenberg2011-01-021-0/+2
| | | | | | | | | | This is almost reverted cherry-pick, and the implementation is almost identical. It orders the input to merge differently to get the effect and produces a different commit message with the default author, rather than the original author. Change-Id: I39970091d9f7406ae7168b8efaab23a5e2c16bad Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Add support for getting the system wide configurationRobin Rosenberg2010-12-311-0/+1
| | | | | | | | | | | | | These settings are stored in <prefix>/etc/gitconfig. The C Git binary is installed in <prefix>/bin, so we look for the C Git executable to find this location, first by looking at the PATH environment variable and then by attemting to launch bash as a login shell to find out. Bug: 333216 Change-Id: I1bbee9fb123a81714a34a9cc242b92beacfbb4a8 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* File utilities for creating directoriesMatthias Sohn2010-12-131-1/+3
| | | | | | | | | | | | | | The java.io.File methods for creating directories report failure by returning false. To ease proper checking of return values provide utility methods wrapping mkdir() and mkdirs() which throw IOException on failure. Also fix the tests to store test data under a trash folder and cleanup after test. Change-Id: I09c7f9909caf7e25feabda9d31e21ce154e7fcd5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Implement rebase --continue and --skipMathias Kinzler2010-12-091-0/+2
| | | | | | | | | | | | | | | | | | For --continue, the Rebase command asserts that there are no unmerged paths in the current repository. Then it checks if a commit is needed. If yes, the commit message and author are taken from the author_script and message files, respectively, and a commit is performed before the next step is applied. For --skip, the workspace is reset to the current HEAD before applying the next step. Includes some tests and a refactoring that extracts Strings in the code into constants. Change-Id: I72d9968535727046e737ec20e23239fe79976179 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com> Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* Provide file utilities for file deletionMatthias Sohn2010-12-071-1/+2
| | | | | | | | | | | Provide file helper methods in a reusable utility class to replace many local implementations. java.io.File has some methods reporting failure by returning false. We prefer to throw IOException on failure so that callers can't forget checking the return value. Change-Id: I430c77b5d2cffcf8b47584326ad4817a7291845e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add more tests for rebase and externalized missing StringsChristian Halstrick2010-11-241-0/+1
| | | | | | | | Coverage tests showed that we are missing to test certain areas in the rebase command. Add the missing tests. Change-Id: Ia4a272d26cde7e1861dac30496e4b6799fc8187a Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* Add CheckoutCommandChris Aniszczyk2010-11-221-0/+1
| | | | | | | | Add the ability to checkout a branch to the working tree. Bug: 330860 Change-Id: Ie06b9e799a9e1be384da0b8996efa7209b32eac3 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add RmCommand to Git APIChris Aniszczyk2010-11-221-0/+1
| | | | | | Bug: 330827 Change-Id: I0b74bb92254d0ee988139d25022d06d16ed89d58 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Initial implementation of a Rebase commandMathias Kinzler2010-11-221-0/+7
| | | | | | | | | | | This is a first iteration to implement Rebase. At the moment, this does not implement --continue and --skip, so if the first conflict is found, the only option is to --abort the command. Bug: 328217 Change-Id: I24d60c0214e71e5572955f8261e10a42e9e95298 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Enable providing credentials for HTTP authenticationShawn O. Pearce2010-11-101-1/+2
| | | | | | | | | | | | | | | | | | | | | This change is based on http://egit.eclipse.org/r/#change,1652 by David Green. The change adds the concept of a CredentialsProvider which can be registered for git transports and which is responsible to return credential-related data like passwords and usernames. Whenenver the transports detects that an authentication with certain credentials has to be done it will ask the CredentialsProvider for this data. Foreseen implementations for such a Provider may be a EGitCredentialsProvider (caching credential data entered e.g. in the Clone-Wizzard) or a NetRcProvider (gathering data out of ~/.netrc file). Bug: 296201 Change-Id: Ibe13e546b45eed3e193c09ecb414bbec2971d362 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Stefan Lay <stefan.lay@sap.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> CC: David Green <dgreen99@gmail.com>
* PullCommand: support upstream configuration for local branchesMathias Kinzler2010-10-281-0/+1
| | | | | | | | | | When creating a local branch based on another local branch, the upstream configuration contains "." as origin and the source branch as "merge". The PullCommand should support this by skipping the fetch step altogether and use the base branch to merge with. Change-Id: I260a1771aeeffca5b0161d1494fd63c672ecc2a6 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>