From f5936405a3a66b821f716e551de6ee4c1c33ca0b Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Mon, 26 Jan 2015 14:56:25 +0100 Subject: [PATCH 1/8] If a pack isn't found on disk remove it from pack list If accessing a pack throws FileNotFoundException the pack was deleted and we need to remove it from the pack list. This can be caused e.g. by git gc. Change-Id: I5d10f87f364dadbbdbfb61b6b2cbdee9c7457f3d Signed-off-by: Matthias Sohn --- .../resources/org/eclipse/jgit/internal/JGitText.properties | 1 + org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java | 1 + .../eclipse/jgit/internal/storage/file/ObjectDirectory.java | 3 +++ 3 files changed, 5 insertions(+) diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index 55cf3ea71..7e5f0b022 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -392,6 +392,7 @@ packObjectCountMismatch=Pack object count mismatch: pack {0} index {1}: {2} packRefs=Pack refs packSizeNotSetYet=Pack size not yet set since it has not yet been received packTooLargeForIndexVersion1=Pack too large for index version 1 +packWasDeleted=Pack file {0} was deleted, removing it from pack list packWriterStatistics=Total {0,number,#0} (delta {1,number,#0}), reused {2,number,#0} (delta {3,number,#0}) panicCantRenameIndexFile=Panic: index file {0} must be renamed to replace {1}; until then repository is corrupt patchApplyException=Cannot apply: {0} diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java index fd38dc149..caf3e9072 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -451,6 +451,7 @@ public class JGitText extends TranslationBundle { /***/ public String packRefs; /***/ public String packSizeNotSetYet; /***/ public String packTooLargeForIndexVersion1; + /***/ public String packWasDeleted; /***/ public String packWriterStatistics; /***/ public String panicCantRenameIndexFile; /***/ public String patchApplyException; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java index 76fadefe5..adbe1f865 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java @@ -557,6 +557,9 @@ public class ObjectDirectory extends FileObjectDatabase { tmpl = JGitText.get().corruptPack; // Assume the pack is corrupted, and remove it from the list. removePack(p); + } else if (e instanceof FileNotFoundException) { + tmpl = JGitText.get().packWasDeleted; + removePack(p); } else { tmpl = JGitText.get().exceptionWhileReadingPack; // Don't remove the pack from the list, as the error may be From 6aed51e3cea6f7114b42bcbc4f66abb48e6ae490 Mon Sep 17 00:00:00 2001 From: Laurent Goubet Date: Fri, 31 Oct 2014 14:58:07 +0100 Subject: [PATCH 2/8] Introduce hook support into the FS implementations This introduces the background plumbing necessary to run git hooks from JGit. This implementation will be OS-dependent as it aims to be compatible with existing hooks, mostly written in Shell. It is compatible with unix systems and windows as long as an Unix emulator such as Cygwin is in its PATH. Change-Id: I1f82a5205138fd8032614dd5b52aef14e02238ed Signed-off-by: Laurent Goubet Signed-off-by: Matthias Sohn --- .../org/eclipse/jgit/util/FS_POSIX_Java7.java | 16 + .../jgit/util/FS_Win32_Java7Cygwin.java | 18 + .../org/eclipse/jgit/util/FileUtilTest.java | 79 ++++ .../eclipse/jgit/internal/JGitText.properties | 2 + .../org/eclipse/jgit/internal/JGitText.java | 2 + .../src/org/eclipse/jgit/lib/Constants.java | 7 + .../src/org/eclipse/jgit/util/FS.java | 341 ++++++++++++++++++ .../src/org/eclipse/jgit/util/FS_POSIX.java | 14 + .../eclipse/jgit/util/FS_Win32_Cygwin.java | 23 ++ .../src/org/eclipse/jgit/util/FileUtils.java | 66 ++++ .../src/org/eclipse/jgit/util/Hook.java | 149 ++++++++ .../org/eclipse/jgit/util/ProcessResult.java | 112 ++++++ 12 files changed, 829 insertions(+) create mode 100644 org.eclipse.jgit/src/org/eclipse/jgit/util/Hook.java create mode 100644 org.eclipse.jgit/src/org/eclipse/jgit/util/ProcessResult.java diff --git a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java index 4a73a9bcf..300cf93bc 100644 --- a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java +++ b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java @@ -53,6 +53,9 @@ import java.nio.file.Path; import java.nio.file.attribute.PosixFilePermission; import java.util.Set; +import org.eclipse.jgit.lib.Constants; +import org.eclipse.jgit.lib.Repository; + /** * FS implementation for Java7 on unix like systems */ @@ -344,4 +347,17 @@ public class FS_POSIX_Java7 extends FS_POSIX { public String normalize(String name) { return FileUtil.normalize(name); } + + /** + * @since 3.7 + */ + @Override + public File findHook(Repository repository, Hook hook) { + final File gitdir = repository.getDirectory(); + final Path hookPath = gitdir.toPath().resolve(Constants.HOOKS) + .resolve(hook.getName()); + if (Files.isExecutable(hookPath)) + return hookPath.toFile(); + return null; + } } diff --git a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java index e40d7cf0b..b6e5d9388 100644 --- a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java +++ b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java @@ -45,6 +45,11 @@ package org.eclipse.jgit.util; import java.io.File; import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import org.eclipse.jgit.lib.Constants; +import org.eclipse.jgit.lib.Repository; /** * FS for Java7 on Windows with Cygwin @@ -135,4 +140,17 @@ public class FS_Win32_Java7Cygwin extends FS_Win32_Cygwin { public Attributes getAttributes(File path) { return FileUtil.getFileAttributesBasic(this, path); } + + /** + * @since 3.7 + */ + @Override + public File findHook(Repository repository, Hook hook) { + final File gitdir = repository.getDirectory(); + final Path hookPath = gitdir.toPath().resolve(Constants.HOOKS) + .resolve(hook.getName()); + if (Files.isExecutable(hookPath)) + return hookPath.toFile(); + return null; + } } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilTest.java index 7b1627854..d4be25c0c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilTest.java @@ -50,6 +50,7 @@ import static org.junit.Assert.fail; import java.io.File; import java.io.IOException; +import java.util.regex.Matcher; import org.eclipse.jgit.junit.JGitTestUtil; import org.junit.After; @@ -434,4 +435,82 @@ public class FileUtilTest { String target = fs.readSymLink(new File(trash, "x")); assertEquals("y", target); } + + @Test + public void testRelativize_doc() { + // This is the javadoc example + String base = toOSPathString("c:\\Users\\jdoe\\eclipse\\git\\project"); + String other = toOSPathString("c:\\Users\\jdoe\\eclipse\\git\\another_project\\pom.xml"); + String expected = toOSPathString("..\\another_project\\pom.xml"); + + String actual = FileUtils.relativize(base, other); + assertEquals(expected, actual); + } + + @Test + public void testRelativize_mixedCase() { + SystemReader systemReader = SystemReader.getInstance(); + String oldOSName = null; + String base = toOSPathString("C:\\git\\jgit"); + String other = toOSPathString("C:\\Git\\test\\d\\f.txt"); + String expectedWindows = toOSPathString("..\\test\\d\\f.txt"); + String expectedUnix = toOSPathString("..\\..\\Git\\test\\d\\f.txt"); + + if (!systemReader.isWindows()) { + String actual = FileUtils.relativize(base, other); + assertEquals(expectedUnix, actual); + + // FS_POSIX#isCaseSensitive will return "false" for mac OS X. + // Use this to test both behaviors. + oldOSName = System.getProperty("os.name"); + try { + System.setProperty("os.name", "Mac OS X"); + + actual = FileUtils.relativize(base, other); + assertEquals(expectedWindows, actual); + } finally { + if (oldOSName != null) + System.setProperty("os.name", oldOSName); + } + } else { + String actual = FileUtils.relativize(base, other); + assertEquals(expectedWindows, actual); + } + } + + @Test + public void testRelativize_scheme() { + String base = toOSPathString("file:/home/eclipse/runtime-New_configuration/project_1/file.java"); + String other = toOSPathString("file:/home/eclipse/runtime-New_configuration/project"); + // 'file.java' is treated as a folder + String expected = toOSPathString("../../project"); + + String actual = FileUtils.relativize(base, other); + assertEquals(expected, actual); + } + + @Test + public void testRelativize_equalPaths() { + String base = toOSPathString("file:/home/eclipse/runtime-New_configuration/project_1"); + String other = toOSPathString("file:/home/eclipse/runtime-New_configuration/project_1"); + String expected = ""; + + String actual = FileUtils.relativize(base, other); + assertEquals(expected, actual); + } + + @Test + public void testRelativize_whitespaces() { + String base = toOSPathString("/home/eclipse 3.4/runtime New_configuration/project_1"); + String other = toOSPathString("/home/eclipse 3.4/runtime New_configuration/project_1/file"); + String expected = "file"; + + String actual = FileUtils.relativize(base, other); + assertEquals(expected, actual); + } + + private String toOSPathString(String path) { + return path.replaceAll("/|\\\\", + Matcher.quoteReplacement(File.separator)); + } } diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index 7e5f0b022..71ec6b2bc 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -193,6 +193,7 @@ errorListing=Error listing {0} errorOccurredDuringUnpackingOnTheRemoteEnd=error occurred during unpacking on the remote end: {0} errorReadingInfoRefs=error reading info/refs errorSymlinksNotSupported=Symlinks are not supported with this OS/JRE +exceptionCaughtDuringExecutionOfHook=Exception caught during execution of "{0}" hook. exceptionCaughtDuringExecutionOfAddCommand=Exception caught during execution of add command exceptionCaughtDuringExecutionOfArchiveCommand=Exception caught during execution of archive command exceptionCaughtDuringExecutionOfCherryPickCommand=Exception caught during execution of cherry-pick command. {0} @@ -206,6 +207,7 @@ exceptionCaughtDuringExecutionOfResetCommand=Exception caught during execution o exceptionCaughtDuringExecutionOfRevertCommand=Exception caught during execution of revert command. {0} exceptionCaughtDuringExecutionOfRmCommand=Exception caught during execution of rm command exceptionCaughtDuringExecutionOfTagCommand=Exception caught during execution of tag command +exceptionHookExecutionInterrupted=Execution of "{0}" hook interrupted. exceptionOccurredDuringAddingOfOptionToALogCommand=Exception occurred during adding of {0} as option to a Log command exceptionOccurredDuringReadingOfGIT_DIR=Exception occurred during reading of $GIT_DIR/{0}. {1} exceptionWhileReadingPack=ERROR: Exception caught while accessing pack file {0}, the pack file might be corrupt diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java index caf3e9072..138f40f7c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -252,6 +252,7 @@ public class JGitText extends TranslationBundle { /***/ public String errorOccurredDuringUnpackingOnTheRemoteEnd; /***/ public String errorReadingInfoRefs; /***/ public String errorSymlinksNotSupported; + /***/ public String exceptionCaughtDuringExecutionOfHook; /***/ public String exceptionCaughtDuringExecutionOfAddCommand; /***/ public String exceptionCaughtDuringExecutionOfArchiveCommand; /***/ public String exceptionCaughtDuringExecutionOfCherryPickCommand; @@ -265,6 +266,7 @@ public class JGitText extends TranslationBundle { /***/ public String exceptionCaughtDuringExecutionOfRevertCommand; /***/ public String exceptionCaughtDuringExecutionOfRmCommand; /***/ public String exceptionCaughtDuringExecutionOfTagCommand; + /***/ public String exceptionHookExecutionInterrupted; /***/ public String exceptionOccurredDuringAddingOfOptionToALogCommand; /***/ public String exceptionOccurredDuringReadingOfGIT_DIR; /***/ public String exceptionWhileReadingPack; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java index 705d54cfa..ed0ed04d9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java @@ -386,6 +386,13 @@ public final class Constants { */ public static final String MODULES = "modules"; + /** + * Name of the folder (inside gitDir) where the hooks are stored. + * + * @since 3.7 + */ + public static final String HOOKS = "hooks"; + /** * Create a new digest function for objects. * diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java index 0c63b190f..081bf87c5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -44,18 +44,31 @@ package org.eclipse.jgit.util; import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintStream; +import java.io.PrintWriter; import java.security.AccessController; import java.security.PrivilegedAction; import java.text.MessageFormat; import java.util.Arrays; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import org.eclipse.jgit.api.errors.JGitInternalException; import org.eclipse.jgit.errors.SymlinksNotSupportedException; import org.eclipse.jgit.internal.JGitText; +import org.eclipse.jgit.lib.Constants; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.util.ProcessResult.Status; /** Abstraction to support various file system operations not in Java. */ public abstract class FS { @@ -613,6 +626,288 @@ public abstract class FS { JGitText.get().errorSymlinksNotSupported); } + /** + * See {@link FileUtils#relativize(String, String)}. + * + * @param base + * The path against which other should be + * relativized. + * @param other + * The path that will be made relative to base. + * @return A relative path that, when resolved against base, + * will yield the original other. + * @see FileUtils#relativize(String, String) + * @since 3.7 + */ + public String relativize(String base, String other) { + return FileUtils.relativize(base, other); + } + + /** + * Checks whether the given hook is defined for the given repository, then + * runs it with the given arguments. + *

+ * The hook's standard output and error streams will be redirected to + * System.out and System.err respectively. The + * hook will have no stdin. + *

+ * + * @param repository + * The repository for which a hook should be run. + * @param hook + * The hook to be executed. + * @param args + * Arguments to pass to this hook. Cannot be null, + * but can be an empty array. + * @return The ProcessResult describing this hook's execution. + * @throws JGitInternalException + * if we fail to run the hook somehow. Causes may include an + * interrupted process or I/O errors. + * @since 3.7 + */ + public ProcessResult runIfPresent(Repository repository, final Hook hook, + String[] args) throws JGitInternalException { + return runIfPresent(repository, hook, args, System.out, System.err, + null); + } + + /** + * Checks whether the given hook is defined for the given repository, then + * runs it with the given arguments. + * + * @param repository + * The repository for which a hook should be run. + * @param hook + * The hook to be executed. + * @param args + * Arguments to pass to this hook. Cannot be null, + * but can be an empty array. + * @param outRedirect + * A print stream on which to redirect the hook's stdout. Can be + * null, in which case the hook's standard output + * will be lost. + * @param errRedirect + * A print stream on which to redirect the hook's stderr. Can be + * null, in which case the hook's standard error + * will be lost. + * @param stdinArgs + * A string to pass on to the standard input of the hook. May be + * null. + * @return The ProcessResult describing this hook's execution. + * @throws JGitInternalException + * if we fail to run the hook somehow. Causes may include an + * interrupted process or I/O errors. + * @since 3.7 + */ + public ProcessResult runIfPresent(Repository repository, final Hook hook, + String[] args, PrintStream outRedirect, PrintStream errRedirect, + String stdinArgs) throws JGitInternalException { + return new ProcessResult(Status.NOT_SUPPORTED); + } + + /** + * See + * {@link #runIfPresent(Repository, Hook, String[], PrintStream, PrintStream, String)} + * . Should only be called by FS supporting shell scripts execution. + * + * @param repository + * The repository for which a hook should be run. + * @param hook + * The hook to be executed. + * @param args + * Arguments to pass to this hook. Cannot be null, + * but can be an empty array. + * @param outRedirect + * A print stream on which to redirect the hook's stdout. Can be + * null, in which case the hook's standard output + * will be lost. + * @param errRedirect + * A print stream on which to redirect the hook's stderr. Can be + * null, in which case the hook's standard error + * will be lost. + * @param stdinArgs + * A string to pass on to the standard input of the hook. May be + * null. + * @return The ProcessResult describing this hook's execution. + * @throws JGitInternalException + * if we fail to run the hook somehow. Causes may include an + * interrupted process or I/O errors. + * @since 3.7 + */ + protected ProcessResult internalRunIfPresent(Repository repository, + final Hook hook, String[] args, PrintStream outRedirect, + PrintStream errRedirect, String stdinArgs) + throws JGitInternalException { + final File hookFile = findHook(repository, hook); + if (hookFile == null) + return new ProcessResult(Status.NOT_PRESENT); + + final String hookPath = hookFile.getAbsolutePath(); + final File runDirectory; + if (repository.isBare()) + runDirectory = repository.getDirectory(); + else + runDirectory = repository.getWorkTree(); + final String cmd = relativize(runDirectory.getAbsolutePath(), + hookPath); + ProcessBuilder hookProcess = runInShell(cmd, args); + hookProcess.directory(runDirectory); + try { + return new ProcessResult(runProcess(hookProcess, outRedirect, + errRedirect, stdinArgs), Status.OK); + } catch (IOException e) { + throw new JGitInternalException(MessageFormat.format( + JGitText.get().exceptionCaughtDuringExecutionOfHook, + hook.getName()), e); + } catch (InterruptedException e) { + throw new JGitInternalException(MessageFormat.format( + JGitText.get().exceptionHookExecutionInterrupted, + hook.getName()), e); + } + } + + + /** + * Tries to find a hook matching the given one in the given repository. + * + * @param repository + * The repository within which to find a hook. + * @param hook + * The hook we're trying to find. + * @return The {@link File} containing this particular hook if it exists in + * the given repository, null otherwise. + * @since 3.7 + */ + public File findHook(Repository repository, final Hook hook) { + final File hookFile = new File(new File(repository.getDirectory(), + Constants.HOOKS), hook.getName()); + return hookFile.isFile() ? hookFile : null; + } + + /** + * Runs the given process until termination, clearing its stdout and stderr + * streams on-the-fly. + * + * @param hookProcessBuilder + * The process builder configured for this hook. + * @param outRedirect + * A print stream on which to redirect the hook's stdout. Can be + * null, in which case the hook's standard output + * will be lost. + * @param errRedirect + * A print stream on which to redirect the hook's stderr. Can be + * null, in which case the hook's standard error + * will be lost. + * @param stdinArgs + * A string to pass on to the standard input of the hook. Can be + * null. + * @return the exit value of this hook. + * @throws IOException + * if an I/O error occurs while executing this hook. + * @throws InterruptedException + * if the current thread is interrupted while waiting for the + * process to end. + * @since 3.7 + */ + protected int runProcess(ProcessBuilder hookProcessBuilder, + OutputStream outRedirect, OutputStream errRedirect, String stdinArgs) + throws IOException, InterruptedException { + final ExecutorService executor = Executors.newFixedThreadPool(2); + Process process = null; + // We'll record the first I/O exception that occurs, but keep on trying + // to dispose of our open streams and file handles + IOException ioException = null; + try { + process = hookProcessBuilder.start(); + final Callable errorGobbler = new StreamGobbler( + process.getErrorStream(), errRedirect); + final Callable outputGobbler = new StreamGobbler( + process.getInputStream(), outRedirect); + executor.submit(errorGobbler); + executor.submit(outputGobbler); + if (stdinArgs != null) { + final PrintWriter stdinWriter = new PrintWriter( + process.getOutputStream()); + stdinWriter.print(stdinArgs); + stdinWriter.flush(); + // We are done with this hook's input. Explicitly close its + // stdin now to kick off any blocking read the hook might have. + stdinWriter.close(); + } + return process.waitFor(); + } catch (IOException e) { + ioException = e; + } finally { + shutdownAndAwaitTermination(executor); + if (process != null) { + try { + process.waitFor(); + } catch (InterruptedException e) { + // Thrown by the outer try. + // Swallow this one to carry on our cleanup, and clear the + // interrupted flag (processes throw the exception without + // clearing the flag). + Thread.interrupted(); + } + // A process doesn't clean its own resources even when destroyed + // Explicitly try and close all three streams, preserving the + // outer I/O exception if any. + try { + process.getErrorStream().close(); + } catch (IOException e) { + ioException = ioException != null ? ioException : e; + } + try { + process.getInputStream().close(); + } catch (IOException e) { + ioException = ioException != null ? ioException : e; + } + try { + process.getOutputStream().close(); + } catch (IOException e) { + ioException = ioException != null ? ioException : e; + } + process.destroy(); + } + } + // We can only be here if the outer try threw an IOException. + throw ioException; + } + + /** + * Shuts down an {@link ExecutorService} in two phases, first by calling + * {@link ExecutorService#shutdown() shutdown} to reject incoming tasks, and + * then calling {@link ExecutorService#shutdownNow() shutdownNow}, if + * necessary, to cancel any lingering tasks. Returns true if the pool has + * been properly shutdown, false otherwise. + *

+ * + * @param pool + * the pool to shutdown + * @return true if the pool has been properly shutdown, + * false otherwise. + */ + private static boolean shutdownAndAwaitTermination(ExecutorService pool) { + boolean hasShutdown = true; + pool.shutdown(); // Disable new tasks from being submitted + try { + // Wait a while for existing tasks to terminate + if (!pool.awaitTermination(5, TimeUnit.SECONDS)) { + pool.shutdownNow(); // Cancel currently executing tasks + // Wait a while for tasks to respond to being canceled + if (!pool.awaitTermination(5, TimeUnit.SECONDS)) + hasShutdown = false; + } + } catch (InterruptedException ie) { + // (Re-)Cancel if current thread also interrupted + pool.shutdownNow(); + // Preserve interrupt status + Thread.currentThread().interrupt(); + hasShutdown = false; + } + return hasShutdown; + } + /** * Initialize a ProcesssBuilder to run a command using the system shell. * @@ -802,4 +1097,50 @@ public abstract class FS { public String normalize(String name) { return name; } + + /** + * This runnable will consume an input stream's content into an output + * stream as soon as it gets available. + *

+ * Typically used to empty processes' standard output and error, preventing + * them to choke. + *

+ *

+ * Note that a {@link StreamGobbler} will never close either of its + * streams. + *

+ */ + private static class StreamGobbler implements Callable { + private final BufferedReader reader; + + private final BufferedWriter writer; + + public StreamGobbler(InputStream stream, OutputStream output) { + this.reader = new BufferedReader(new InputStreamReader(stream)); + if (output == null) + this.writer = null; + else + this.writer = new BufferedWriter(new OutputStreamWriter(output)); + } + + public Void call() throws IOException { + boolean writeFailure = false; + + String line = null; + while ((line = reader.readLine()) != null) { + // Do not try to write again after a failure, but keep reading + // as long as possible to prevent the input stream from choking. + if (!writeFailure && writer != null) { + try { + writer.write(line); + writer.newLine(); + writer.flush(); + } catch (IOException e) { + writeFailure = true; + } + } + } + return null; + } + } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java index b7de056ee..ee2958423 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java @@ -44,11 +44,14 @@ package org.eclipse.jgit.util; import java.io.File; import java.io.IOException; +import java.io.PrintStream; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.eclipse.jgit.api.errors.JGitInternalException; +import org.eclipse.jgit.lib.Repository; /** * Base FS for POSIX based systems @@ -121,4 +124,15 @@ public abstract class FS_POSIX extends FS { proc.command(argv); return proc; } + + /** + * @since 3.7 + */ + @Override + public ProcessResult runIfPresent(Repository repository, Hook hook, + String[] args, PrintStream outRedirect, PrintStream errRedirect, + String stdinArgs) throws JGitInternalException { + return internalRunIfPresent(repository, hook, args, outRedirect, + errRedirect, stdinArgs); + } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java index 81f200112..d0abd3327 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java @@ -44,12 +44,15 @@ package org.eclipse.jgit.util; import java.io.File; +import java.io.PrintStream; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.eclipse.jgit.api.errors.JGitInternalException; +import org.eclipse.jgit.lib.Repository; /** * FS implementation for Cygwin on Windows @@ -135,4 +138,24 @@ public class FS_Win32_Cygwin extends FS_Win32 { proc.command(argv); return proc; } + + /** + * @since 3.7 + */ + @Override + public String relativize(String base, String other) { + final String relativized = super.relativize(base, other); + return relativized.replace(File.separatorChar, '/'); + } + + /** + * @since 3.7 + */ + @Override + public ProcessResult runIfPresent(Repository repository, Hook hook, + String[] args, PrintStream outRedirect, PrintStream errRedirect, + String stdinArgs) throws JGitInternalException { + return internalRunIfPresent(repository, hook, args, outRedirect, + errRedirect, stdinArgs); + } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java index 9e5b22180..1e58245ea 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java @@ -51,6 +51,7 @@ import java.nio.channels.FileLock; import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; +import java.util.regex.Pattern; import org.eclipse.jgit.internal.JGitText; @@ -387,4 +388,69 @@ public class FileUtils { } throw new IOException(JGitText.get().cannotCreateTempDir); } + + /** + * This will try and make a given path relative to another. + *

+ * For example, if this is called with the two following paths : + * + *

+	 * base = "c:\\Users\\jdoe\\eclipse\\git\\project"
+	 * other = "c:\\Users\\jdoe\\eclipse\\git\\another_project\\pom.xml"
+	 * 
+ * + * This will return "..\\another_project\\pom.xml". + *

+ *

+ * This method uses {@link File#separator} to split the paths into segments. + *

+ *

+ * Note that this will return the empty String if base + * and other are equal. + *

+ * + * @param base + * The path against which other should be + * relativized. This will be assumed to denote the path to a + * folder and not a file. + * @param other + * The path that will be made relative to base. + * @return A relative path that, when resolved against base, + * will yield the original other. + * @since 3.7 + */ + public static String relativize(String base, String other) { + if (base.equals(other)) + return ""; //$NON-NLS-1$ + + final boolean ignoreCase = !FS.DETECTED.isCaseSensitive(); + final String[] baseSegments = base.split(Pattern.quote(File.separator)); + final String[] otherSegments = other.split(Pattern + .quote(File.separator)); + + int commonPrefix = 0; + while (commonPrefix < baseSegments.length + && commonPrefix < otherSegments.length) { + if (ignoreCase + && baseSegments[commonPrefix] + .equalsIgnoreCase(otherSegments[commonPrefix])) + commonPrefix++; + else if (!ignoreCase + && baseSegments[commonPrefix] + .equals(otherSegments[commonPrefix])) + commonPrefix++; + else + break; + } + + final StringBuilder builder = new StringBuilder(); + for (int i = commonPrefix; i < baseSegments.length; i++) + builder.append("..").append(File.separator); //$NON-NLS-1$ + for (int i = commonPrefix; i < otherSegments.length; i++) { + builder.append(otherSegments[i]); + if (i < otherSegments.length - 1) + builder.append(File.separator); + } + return builder.toString(); + } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/Hook.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/Hook.java new file mode 100644 index 000000000..c24c9a3d0 --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/Hook.java @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2014 Obeo. + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.util; + +/** + * An enum describing the different hooks a user can implement to customize his + * repositories. + * + * @since 3.7 + */ +public enum Hook { + /** + * Literal for the "pre-commit" git hook. + *

+ * This hook is invoked by git commit, and can be bypassed with the + * "no-verify" option. It takes no parameter, and is invoked before + * obtaining the proposed commit log message and making a commit. + *

+ *

+ * A non-zero exit code from the called hook means that the commit should be + * aborted. + *

+ */ + PRE_COMMIT("pre-commit"), //$NON-NLS-1$ + + /** + * Literal for the "prepare-commit-msg" git hook. + *

+ * This hook is invoked by git commit right after preparing the default + * message, and before any editing possibility is displayed to the user. + *

+ *

+ * A non-zero exit code from the called hook means that the commit should be + * aborted. + *

+ */ + PREPARE_COMMIT_MSG("prepare-commit-msg"), //$NON-NLS-1$ + + /** + * Literal for the "commit-msg" git hook. + *

+ * This hook is invoked by git commit, and can be bypassed with the + * "no-verify" option. Its single parameter is the path to the file + * containing the prepared commit message (typically + * "<gitdir>/COMMIT-EDITMSG"). + *

+ *

+ * A non-zero exit code from the called hook means that the commit should be + * aborted. + *

+ */ + COMMIT_MSG("commit-msg"), //$NON-NLS-1$ + + /** + * Literal for the "post-commit" git hook. + *

+ * This hook is invoked by git commit. It takes no parameter and is invoked + * after a commit has been made. + *

+ *

+ * The exit code of this hook has no significance. + *

+ */ + POST_COMMIT("post-commit"), //$NON-NLS-1$ + + /** + * Literal for the "post-rewrite" git hook. + *

+ * This hook is invoked after commands that rewrite commits (currently, only + * "git rebase" and "git commit --amend"). It a single argument denoting the + * source of the call (one of rebase or amend). It + * then accepts a list of rewritten commits through stdin, in the form + * <old SHA-1> <new SHA-1>LF. + *

+ *

+ * The exit code of this hook has no significance. + *

+ */ + POST_REWRITE("post-rewrite"), //$NON-NLS-1$ + + /** + * Literal for the "pre-rebase" git hook. + *

+ *

+ * This hook is invoked right before the rebase operation runs. It accepts + * up to two parameters, the first being the upstream from which the branch + * to rebase has been forked. If the tip of the series of commits to rebase + * is HEAD, the other parameter is unset. Otherwise, that tip is passed as + * the second parameter of the script. + *

+ * A non-zero exit code from the called hook means that the rebase should be + * aborted. + *

+ */ + PRE_REBASE("pre-rebase"); //$NON-NLS-1$ + + private final String name; + + private Hook(String name) { + this.name = name; + } + + /** + * @return The name of this hook. + */ + public String getName() { + return name; + } +} diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/ProcessResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/ProcessResult.java new file mode 100644 index 000000000..f56bb1577 --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/ProcessResult.java @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2014 Obeo. + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.util; + +/** + * Describes the result of running an external process. + * + * @since 3.7 + */ +public class ProcessResult { + /** + * Status of a process' execution. + */ + public static enum Status { + /** + * The script was found and launched properly. It may still have exited + * with a non-zero {@link #exitCode}. + */ + OK, + + /** The script was not found on disk and thus could not be launched. */ + NOT_PRESENT, + + /** + * The script was found but could not be launched since it was not + * supported by the current {@link FS}. + */ + NOT_SUPPORTED; + } + + /** The exit code of the process. */ + private final int exitCode; + + /** Status of the process' execution. */ + private final Status status; + + /** + * Instantiates a process result with the given status and an exit code of + * -1. + * + * @param status + * Status describing the execution of the external process. + */ + public ProcessResult(Status status) { + this(-1, status); + } + + /** + * @param exitCode + * Exit code of the process. + * @param status + * Status describing the execution of the external process. + */ + public ProcessResult(int exitCode, Status status) { + this.exitCode = exitCode; + this.status = status; + } + + /** + * @return The exit code of the process. + */ + public int getExitCode() { + return exitCode; + } + + /** + * @return The status of the process' execution. + */ + public Status getStatus() { + return status; + } +} From 7f139b8eeebda7bf31ab895f6d8965f5c0161caa Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 25 Jan 2015 01:48:20 +0100 Subject: [PATCH 3/8] Add a hook test Change-Id: I8059ef299aeb43373f4f45274030886171a20a8e Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/util/HookTest.java | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/HookTest.java diff --git a/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/HookTest.java b/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/HookTest.java new file mode 100644 index 000000000..73086ab4a --- /dev/null +++ b/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/HookTest.java @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2014 Matthias Sohn + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; + +import org.eclipse.jgit.junit.JGitTestUtil; +import org.eclipse.jgit.junit.RepositoryTestCase; +import org.junit.Assume; +import org.junit.Test; + +public class HookTest extends RepositoryTestCase { + + @Test + public void testFindHook() throws Exception { + assumeSupportedPlatform(); + + Hook h = Hook.PRE_COMMIT; + assertNull("no hook should be installed", FS.DETECTED.findHook(db, h)); + File hookFile = writeHookFile(h.getName(), + "#!/bin/bash\necho \"test $1 $2\""); + assertEquals("exected to find pre-commit hook", hookFile, + FS.DETECTED.findHook(db, h)); + } + + @Test + public void testRunHook() throws Exception { + assumeSupportedPlatform(); + + Hook h = Hook.PRE_COMMIT; + writeHookFile( + h.getName(), + "#!/bin/sh\necho \"test $1 $2\"\nread INPUT\necho $INPUT\necho 1>&2 \"stderr\""); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ByteArrayOutputStream err = new ByteArrayOutputStream(); + ProcessResult res = FS.DETECTED.runIfPresent(db, h, new String[] { + "arg1", "arg2" }, + new PrintStream(out), new PrintStream(err), "stdin"); + assertEquals("unexpected hook output", "test arg1 arg2\nstdin\n", + out.toString("UTF-8")); + assertEquals("unexpected output on stderr stream", "stderr\n", + err.toString("UTF-8")); + assertEquals("unexpected exit code", 0, res.getExitCode()); + assertEquals("unexpected process status", ProcessResult.Status.OK, + res.getStatus()); + } + + private File writeHookFile(final String name, final String data) + throws IOException { + File path = new File(db.getWorkTree() + "/.git/hooks/", name); + JGitTestUtil.write(path, data); + FS.DETECTED.setExecute(path, true); + return path; + } + + private void assumeSupportedPlatform() { + Assume.assumeTrue(FS.DETECTED instanceof FS_POSIX + || FS.DETECTED instanceof FS_Win32_Java7Cygwin); + } +} From d2e0bfa56844642435c9ba81d488aa0da9b22b36 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Mon, 2 Feb 2015 21:21:09 +0100 Subject: [PATCH 4/8] Fix FileUtils.testRelativize_mixedCase which failed on Mac OS X HFS is case insensitive hence expecting it to return the result for case sensitive filesystem doesn't work. Change-Id: I292eab78e50711529a0412f9a54e174a3ac16109 Signed-off-by: Matthias Sohn --- .../org/eclipse/jgit/util/FileUtilTest.java | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilTest.java index d4be25c0c..0d7d31b3a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilTest.java @@ -450,31 +450,20 @@ public class FileUtilTest { @Test public void testRelativize_mixedCase() { SystemReader systemReader = SystemReader.getInstance(); - String oldOSName = null; String base = toOSPathString("C:\\git\\jgit"); String other = toOSPathString("C:\\Git\\test\\d\\f.txt"); - String expectedWindows = toOSPathString("..\\test\\d\\f.txt"); - String expectedUnix = toOSPathString("..\\..\\Git\\test\\d\\f.txt"); + String expectedCaseInsensitive = toOSPathString("..\\test\\d\\f.txt"); + String expectedCaseSensitive = toOSPathString("..\\..\\Git\\test\\d\\f.txt"); - if (!systemReader.isWindows()) { + if (systemReader.isWindows()) { String actual = FileUtils.relativize(base, other); - assertEquals(expectedUnix, actual); - - // FS_POSIX#isCaseSensitive will return "false" for mac OS X. - // Use this to test both behaviors. - oldOSName = System.getProperty("os.name"); - try { - System.setProperty("os.name", "Mac OS X"); - - actual = FileUtils.relativize(base, other); - assertEquals(expectedWindows, actual); - } finally { - if (oldOSName != null) - System.setProperty("os.name", oldOSName); - } + assertEquals(expectedCaseInsensitive, actual); + } else if (systemReader.isMacOS()) { + String actual = FileUtils.relativize(base, other); + assertEquals(expectedCaseInsensitive, actual); } else { String actual = FileUtils.relativize(base, other); - assertEquals(expectedWindows, actual); + assertEquals(expectedCaseSensitive, actual); } } From 494e893c541b5cf465b362c69354c08d7a81c249 Mon Sep 17 00:00:00 2001 From: Laurent Goubet Date: Fri, 31 Oct 2014 15:20:14 +0100 Subject: [PATCH 5/8] Support for the pre-commit hook Introduce support for the pre-commit hook into JGit, along with the --no-verify commit command option to bypass it when rebasing / cherry-picking. Change-Id: If86df98577fa56c5c03d783579c895a38bee9d18 Signed-off-by: Laurent Goubet Signed-off-by: Matthias Sohn --- .../META-INF/MANIFEST.MF | 1 + .../src/org/eclipse/jgit/util/HookTest.java | 30 ++++++++ .../eclipse/jgit/internal/JGitText.properties | 1 + .../eclipse/jgit/api/CherryPickCommand.java | 3 +- .../org/eclipse/jgit/api/CommitCommand.java | 71 ++++++++++++++++++- .../org/eclipse/jgit/api/RebaseCommand.java | 9 ++- .../api/errors/RejectCommitException.java | 61 ++++++++++++++++ .../org/eclipse/jgit/internal/JGitText.java | 1 + 8 files changed, 169 insertions(+), 8 deletions(-) create mode 100644 org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RejectCommitException.java diff --git a/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF index a6e8f67dd..182c2679e 100644 --- a/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF @@ -6,6 +6,7 @@ Bundle-Version: 3.7.0.qualifier Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Import-Package: org.eclipse.jgit.api;version="[3.7.0,3.8.0)", + org.eclipse.jgit.api.errors;version="[3.7.0,3.8.0)", org.eclipse.jgit.diff;version="[3.7.0,3.8.0)", org.eclipse.jgit.dircache;version="[3.7.0,3.8.0)", org.eclipse.jgit.internal.storage.file;version="3.7.0", diff --git a/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/HookTest.java b/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/HookTest.java index 73086ab4a..96550889c 100644 --- a/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/HookTest.java +++ b/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/HookTest.java @@ -44,12 +44,15 @@ package org.eclipse.jgit.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.PrintStream; +import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.errors.RejectCommitException; import org.eclipse.jgit.junit.JGitTestUtil; import org.eclipse.jgit.junit.RepositoryTestCase; import org.junit.Assume; @@ -91,6 +94,33 @@ public class HookTest extends RepositoryTestCase { res.getStatus()); } + @Test + public void testPreCommitHook() throws Exception { + assumeSupportedPlatform(); + + Hook h = Hook.PRE_COMMIT; + writeHookFile(h.getName(), + "#!/bin/sh\necho \"test\"\n\necho 1>&2 \"stderr\"\nexit 1"); + Git git = Git.wrap(db); + String path = "a.txt"; + writeTrashFile(path, "content"); + git.add().addFilepattern(path).call(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + try { + git.commit().setMessage("commit") + .setHookOutputStream(new PrintStream(out)).call(); + fail("expected pre-commit hook to abort commit"); + } catch (RejectCommitException e) { + assertEquals("unexpected error message from pre-commit hook", + "Commit rejected by \"pre-commit\" hook.\nstderr\n", + e.getMessage()); + assertEquals("unexpected output from pre-commit hook", "test\n", + out.toString()); + } catch (Throwable e) { + fail("unexpected exception thrown by pre-commit hook: " + e); + } + } + private File writeHookFile(final String name, final String data) throws IOException { File path = new File(db.getWorkTree() + "/.git/hooks/", name); diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index 71ec6b2bc..efe61052b 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -104,6 +104,7 @@ commitAlreadyExists=exists {0} commitMessageNotSpecified=commit message not specified commitOnRepoWithoutHEADCurrentlyNotSupported=Commit on repo without HEAD currently not supported commitAmendOnInitialNotPossible=Amending is not possible on initial commit. +commitRejectedByHook=Commit rejected by "{0}" hook.\n{1} compressingObjects=Compressing objects connectionFailed=connection failed connectionTimeOut=Connection time out: {0} diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java index 30dcaa5b6..d4eb0b3b2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java @@ -169,7 +169,8 @@ public class CherryPickCommand extends GitCommand { .setMessage(srcCommit.getFullMessage()) .setReflogComment(reflogPrefix + " " //$NON-NLS-1$ + srcCommit.getShortMessage()) - .setAuthor(srcCommit.getAuthorIdent()).call(); + .setAuthor(srcCommit.getAuthorIdent()) + .setNoVerify(true).call(); cherryPickedRefs.add(src); } else { if (merger.failed()) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java index f8406e023..93400aa4d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java @@ -42,8 +42,10 @@ */ package org.eclipse.jgit.api; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.PrintStream; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; @@ -56,6 +58,7 @@ import org.eclipse.jgit.api.errors.JGitInternalException; import org.eclipse.jgit.api.errors.NoFilepatternException; import org.eclipse.jgit.api.errors.NoHeadException; import org.eclipse.jgit.api.errors.NoMessageException; +import org.eclipse.jgit.api.errors.RejectCommitException; import org.eclipse.jgit.api.errors.UnmergedPathsException; import org.eclipse.jgit.api.errors.WrongRepositoryStateException; import org.eclipse.jgit.dircache.DirCache; @@ -84,6 +87,9 @@ import org.eclipse.jgit.treewalk.CanonicalTreeParser; import org.eclipse.jgit.treewalk.FileTreeIterator; import org.eclipse.jgit.treewalk.TreeWalk; import org.eclipse.jgit.util.ChangeIdUtil; +import org.eclipse.jgit.util.FS; +import org.eclipse.jgit.util.Hook; +import org.eclipse.jgit.util.ProcessResult; /** * A class used to execute a {@code Commit} command. It has setters for all @@ -119,11 +125,20 @@ public class CommitCommand extends GitCommand { private String reflogComment; + /** + * Setting this option bypasses the {@link Hook#PRE_COMMIT pre-commit} and + * {@link Hook#COMMIT_MSG commit-msg} hooks. + */ + private boolean noVerify; + + private PrintStream hookOutRedirect; + /** * @param repo */ protected CommitCommand(Repository repo) { super(repo); + hookOutRedirect = System.out; } /** @@ -144,11 +159,14 @@ public class CommitCommand extends GitCommand { * else * @throws WrongRepositoryStateException * when repository is not in the right state for committing + * @throws RejectCommitException + * if there are either pre-commit or commit-msg hooks present in + * the repository and at least one of them rejects the commit. */ public RevCommit call() throws GitAPIException, NoHeadException, NoMessageException, UnmergedPathsException, - ConcurrentRefUpdateException, - WrongRepositoryStateException { + ConcurrentRefUpdateException, WrongRepositoryStateException, + RejectCommitException { checkCallable(); Collections.sort(only); @@ -160,6 +178,23 @@ public class CommitCommand extends GitCommand { throw new WrongRepositoryStateException(MessageFormat.format( JGitText.get().cannotCommitOnARepoWithState, state.name())); + + if (!noVerify) { + final ByteArrayOutputStream errorByteArray = new ByteArrayOutputStream(); + final PrintStream hookErrRedirect = new PrintStream( + errorByteArray); + ProcessResult preCommitHookResult = FS.DETECTED.runIfPresent( + repo, Hook.PRE_COMMIT, new String[0], hookOutRedirect, + hookErrRedirect, null); + if (preCommitHookResult.getStatus() == ProcessResult.Status.OK + && preCommitHookResult.getExitCode() != 0) { + String errorMessage = MessageFormat.format( + JGitText.get().commitRejectedByHook, Hook.PRE_COMMIT.getName(), + errorByteArray.toString()); + throw new RejectCommitException(errorMessage); + } + } + processOptions(state, rw); if (all && !repo.isBare() && repo.getWorkTree() != null) { @@ -733,4 +768,36 @@ public class CommitCommand extends GitCommand { return this; } + /** + * Sets the {@link #noVerify} option on this commit command. + *

+ * Both the {@link Hook#PRE_COMMIT pre-commit} and {@link Hook#COMMIT_MSG + * commit-msg} hooks can block a commit by their return value; setting this + * option to true will bypass these two hooks. + *

+ * + * @param noVerify + * Whether this commit should be verified by the pre-commit and + * commit-msg hooks. + * @return {@code this} + * @since 3.7 + */ + public CommitCommand setNoVerify(boolean noVerify) { + this.noVerify = noVerify; + return this; + } + + /** + * Set the output stream for hook scripts executed by this command. If not + * set it defaults to {@code System.out}. + * + * @param hookStdOut + * the output stream for hook scripts executed by this command + * @return {@code this} + * @since 3.7 + */ + public CommitCommand setHookOutputStream(PrintStream hookStdOut) { + this.hookOutRedirect = hookStdOut; + return this; + } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java index 47424a907..7d3e82318 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java @@ -462,7 +462,7 @@ public class RebaseCommand extends GitCommand { String newMessage = interactiveHandler .modifyCommitMessage(oldMessage); newHead = new Git(repo).commit().setMessage(newMessage) - .setAmend(true).call(); + .setAmend(true).setNoVerify(true).call(); return null; case EDIT: rebaseState.createFile(AMEND, commitToPick.name()); @@ -768,15 +768,14 @@ public class RebaseCommand extends GitCommand { } retNewHead = new Git(repo).commit() .setMessage(stripCommentLines(commitMessage)) - .setAmend(true).call(); + .setAmend(true).setNoVerify(true).call(); rebaseState.getFile(MESSAGE_SQUASH).delete(); rebaseState.getFile(MESSAGE_FIXUP).delete(); } else { // Next step is either Squash or Fixup - retNewHead = new Git(repo).commit() - .setMessage(commitMessage).setAmend(true) - .call(); + retNewHead = new Git(repo).commit().setMessage(commitMessage) + .setAmend(true).setNoVerify(true).call(); } return retNewHead; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RejectCommitException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RejectCommitException.java new file mode 100644 index 000000000..6036a2731 --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RejectCommitException.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2015 Obeo. + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.api.errors; + +/** + * Exception thrown when a commit is rejected by a hook (either + * {@link org.eclipse.jgit.util.Hook#PRE_COMMIT pre-commit} or + * {@link org.eclipse.jgit.util.Hook#COMMIT_MSG commit-msg}). + * + * @since 3.7 + */ +public class RejectCommitException extends GitAPIException { + private static final long serialVersionUID = 1L; + + /** + * @param message + */ + public RejectCommitException(String message) { + super(message); + } +} diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java index 138f40f7c..8c81c9513 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -163,6 +163,7 @@ public class JGitText extends TranslationBundle { /***/ public String commitMessageNotSpecified; /***/ public String commitOnRepoWithoutHEADCurrentlyNotSupported; /***/ public String commitAmendOnInitialNotPossible; + /***/ public String commitRejectedByHook; /***/ public String compressingObjects; /***/ public String connectionFailed; /***/ public String connectionTimeOut; From 8fe6e51be2e663c477e8f09ca28e9f78c6d34f35 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Tue, 3 Feb 2015 23:36:31 +0100 Subject: [PATCH 6/8] JGit v3.7.0.201502031740-rc1 Change-Id: Ia2ea65945b7e1d4120da3d6e6c9f6d5fdb642ae6 Signed-off-by: Matthias Sohn --- org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.ant.test/pom.xml | 2 +- org.eclipse.jgit.ant/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.ant/pom.xml | 2 +- org.eclipse.jgit.archive/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF | 4 ++-- org.eclipse.jgit.archive/pom.xml | 2 +- org.eclipse.jgit.console/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.console/pom.xml | 2 +- org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.http.apache/pom.xml | 2 +- org.eclipse.jgit.http.server/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.http.server/pom.xml | 2 +- org.eclipse.jgit.http.test/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.http.test/pom.xml | 2 +- org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.java7.test/pom.xml | 2 +- org.eclipse.jgit.java7/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF | 4 ++-- org.eclipse.jgit.java7/pom.xml | 2 +- org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.junit.http/pom.xml | 2 +- org.eclipse.jgit.junit/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.junit/pom.xml | 2 +- .../org.eclipse.jgit.feature/feature.xml | 2 +- org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml | 2 +- .../org.eclipse.jgit.http.apache.feature/feature.xml | 2 +- .../org.eclipse.jgit.http.apache.feature/pom.xml | 2 +- .../org.eclipse.jgit.java7.feature/feature.xml | 2 +- .../org.eclipse.jgit.java7.feature/pom.xml | 2 +- .../org.eclipse.jgit.junit.feature/feature.xml | 2 +- .../org.eclipse.jgit.junit.feature/pom.xml | 2 +- .../org.eclipse.jgit.pgm.feature/feature.xml | 2 +- .../org.eclipse.jgit.pgm.feature/pom.xml | 2 +- .../org.eclipse.jgit.pgm.source.feature/feature.xml | 2 +- .../org.eclipse.jgit.pgm.source.feature/pom.xml | 2 +- .../org.eclipse.jgit.repository/pom.xml | 2 +- .../org.eclipse.jgit.source.feature/feature.xml | 2 +- .../org.eclipse.jgit.source.feature/pom.xml | 2 +- .../org.eclipse.jgit.target/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml | 2 +- org.eclipse.jgit.packaging/pom.xml | 2 +- org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.pgm.test/pom.xml | 2 +- org.eclipse.jgit.pgm/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF | 4 ++-- org.eclipse.jgit.pgm/pom.xml | 2 +- org.eclipse.jgit.test/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.test/pom.xml | 2 +- org.eclipse.jgit.ui/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.ui/pom.xml | 2 +- org.eclipse.jgit/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF | 4 ++-- org.eclipse.jgit/pom.xml | 2 +- pom.xml | 2 +- 55 files changed, 59 insertions(+), 59 deletions(-) diff --git a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF index 84e64ab28..4218c5cb4 100644 --- a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.ant.test -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 Import-Package: org.apache.tools.ant, diff --git a/org.eclipse.jgit.ant.test/pom.xml b/org.eclipse.jgit.ant.test/pom.xml index ecf865028..e22742a83 100644 --- a/org.eclipse.jgit.ant.test/pom.xml +++ b/org.eclipse.jgit.ant.test/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.ant.test diff --git a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF index ba5d1295d..cbac957ac 100644 --- a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.jgit.ant -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-RequiredExecutionEnvironment: J2SE-1.5 Import-Package: org.apache.tools.ant, org.eclipse.jgit.storage.file;version="[3.7.0,3.8.0)" diff --git a/org.eclipse.jgit.ant/pom.xml b/org.eclipse.jgit.ant/pom.xml index 326c9720b..6d479c174 100644 --- a/org.eclipse.jgit.ant/pom.xml +++ b/org.eclipse.jgit.ant/pom.xml @@ -48,7 +48,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.ant diff --git a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF index a9dd94a87..c91cee8d7 100644 --- a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.archive -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF index 8de857518..8734d253c 100644 --- a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF @@ -3,5 +3,5 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit.archive - Sources Bundle-SymbolicName: org.eclipse.jgit.archive.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.7.0.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.archive;version="3.7.0.qualifier";roots="." +Bundle-Version: 3.7.0.201502031740-rc1 +Eclipse-SourceBundle: org.eclipse.jgit.archive;version="3.7.0.201502031740-rc1";roots="." diff --git a/org.eclipse.jgit.archive/pom.xml b/org.eclipse.jgit.archive/pom.xml index 4c1edba73..8ab564ac7 100644 --- a/org.eclipse.jgit.archive/pom.xml +++ b/org.eclipse.jgit.archive/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.archive diff --git a/org.eclipse.jgit.console/META-INF/MANIFEST.MF b/org.eclipse.jgit.console/META-INF/MANIFEST.MF index 0ebd5c4f7..5ac973a10 100644 --- a/org.eclipse.jgit.console/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.console/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.console -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: org.eclipse.jgit.console;version="3.7.0" diff --git a/org.eclipse.jgit.console/pom.xml b/org.eclipse.jgit.console/pom.xml index e262faa8a..7ea222321 100644 --- a/org.eclipse.jgit.console/pom.xml +++ b/org.eclipse.jgit.console/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.console diff --git a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF index d6e685741..1ccf35853 100644 --- a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.jgit.http.apache -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-Localization: plugin Bundle-Vendor: %Provider-Name diff --git a/org.eclipse.jgit.http.apache/pom.xml b/org.eclipse.jgit.http.apache/pom.xml index 28c8e842a..a87bb8b03 100644 --- a/org.eclipse.jgit.http.apache/pom.xml +++ b/org.eclipse.jgit.http.apache/pom.xml @@ -48,7 +48,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.http.apache diff --git a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF index aeb5b6f4a..ce8e7d0ba 100644 --- a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.http.server -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Localization: plugin Bundle-Vendor: %provider_name Export-Package: org.eclipse.jgit.http.server;version="3.7.0", diff --git a/org.eclipse.jgit.http.server/pom.xml b/org.eclipse.jgit.http.server/pom.xml index dd11cd573..bfd65983a 100644 --- a/org.eclipse.jgit.http.server/pom.xml +++ b/org.eclipse.jgit.http.server/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.http.server diff --git a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF index 0588e54f6..dbb315848 100644 --- a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.http.test -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/org.eclipse.jgit.http.test/pom.xml b/org.eclipse.jgit.http.test/pom.xml index 819c9fa0d..9911f58a5 100644 --- a/org.eclipse.jgit.http.test/pom.xml +++ b/org.eclipse.jgit.http.test/pom.xml @@ -51,7 +51,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.http.test diff --git a/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF index 182c2679e..0d9261912 100644 --- a/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.java7.test -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Import-Package: org.eclipse.jgit.api;version="[3.7.0,3.8.0)", diff --git a/org.eclipse.jgit.java7.test/pom.xml b/org.eclipse.jgit.java7.test/pom.xml index 5fb70a3fd..2b0f11bf2 100644 --- a/org.eclipse.jgit.java7.test/pom.xml +++ b/org.eclipse.jgit.java7.test/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.java7.test diff --git a/org.eclipse.jgit.java7/META-INF/MANIFEST.MF b/org.eclipse.jgit.java7/META-INF/MANIFEST.MF index 938e06091..7680b378a 100644 --- a/org.eclipse.jgit.java7/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.java7/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Fragment-Host: org.eclipse.jgit;bundle-version="3.1.1" Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.java7 -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF index 58d294b92..e1544bde6 100644 --- a/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF @@ -3,6 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit.java7 - Sources Bundle-SymbolicName: org.eclipse.jgit.java7.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.7.0.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.java7;version="3.7.0.qualifier";roots="." +Bundle-Version: 3.7.0.201502031740-rc1 +Eclipse-SourceBundle: org.eclipse.jgit.java7;version="3.7.0.201502031740-rc1";roots="." diff --git a/org.eclipse.jgit.java7/pom.xml b/org.eclipse.jgit.java7/pom.xml index 93c9b5c0b..a6078ad7e 100644 --- a/org.eclipse.jgit.java7/pom.xml +++ b/org.eclipse.jgit.java7/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.java7 diff --git a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF index 5ede10778..81e289d00 100644 --- a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.junit.http -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.jgit.junit.http/pom.xml b/org.eclipse.jgit.junit.http/pom.xml index a082e50d5..5c5f3126c 100644 --- a/org.eclipse.jgit.junit.http/pom.xml +++ b/org.eclipse.jgit.junit.http/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.junit.http diff --git a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF index 47e03420d..8d3013519 100644 --- a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.junit -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.jgit.junit/pom.xml b/org.eclipse.jgit.junit/pom.xml index 39a9e6049..a0e0ba7cb 100644 --- a/org.eclipse.jgit.junit/pom.xml +++ b/org.eclipse.jgit.junit/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.junit diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml index 10ea2c9e5..43556ffc3 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml index 253342255..716f749f4 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml index 71ad4ffef..d701c01a9 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml index e7dd844a2..3fe461e56 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml index 49ddae765..9e9b87804 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml index ffbbb1427..9d28a456f 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml index 6446a2c82..95e643e18 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml index ce3355dbc..3b411ba4b 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml index 3296f502a..b1058fe35 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml index b8ee9ac0d..68b516581 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml index 3a52006ca..5bd542838 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml index c3b8150f4..3246f6f75 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml index 96d74e5b3..cc5c2762b 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.repository diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml index b1eb163df..6ef6cf743 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml index 257495510..5a7af61e7 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF index 46dcb3ff9..a4c49d33e 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF @@ -2,4 +2,4 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: JGit Target Platform Bundle Bundle-SymbolicName: org.eclipse.jgit.target -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml index f303f08bf..78386995e 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml @@ -49,7 +49,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.target diff --git a/org.eclipse.jgit.packaging/pom.xml b/org.eclipse.jgit.packaging/pom.xml index 66adffa9d..a242a1efb 100644 --- a/org.eclipse.jgit.packaging/pom.xml +++ b/org.eclipse.jgit.packaging/pom.xml @@ -53,7 +53,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 pom JGit Tycho Parent diff --git a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF index 1289f98ae..41fcf4b7b 100644 --- a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.pgm.test -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.jgit.pgm.test/pom.xml b/org.eclipse.jgit.pgm.test/pom.xml index 2a87690fb..609c26d71 100644 --- a/org.eclipse.jgit.pgm.test/pom.xml +++ b/org.eclipse.jgit.pgm.test/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.pgm.test diff --git a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF index a8ff1b884..471b0de86 100644 --- a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.pgm -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF index d1ba9ca4f..17bf701ac 100644 --- a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF @@ -3,5 +3,5 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit.pgm - Sources Bundle-SymbolicName: org.eclipse.jgit.pgm.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.7.0.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="3.7.0.qualifier";roots="." +Bundle-Version: 3.7.0.201502031740-rc1 +Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="3.7.0.201502031740-rc1";roots="." diff --git a/org.eclipse.jgit.pgm/pom.xml b/org.eclipse.jgit.pgm/pom.xml index 53dc7744a..7cb568291 100644 --- a/org.eclipse.jgit.pgm/pom.xml +++ b/org.eclipse.jgit.pgm/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.pgm diff --git a/org.eclipse.jgit.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.test/META-INF/MANIFEST.MF index af40e883c..97218272e 100644 --- a/org.eclipse.jgit.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.test -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.jgit.test/pom.xml b/org.eclipse.jgit.test/pom.xml index 1d3333793..e532fe75f 100644 --- a/org.eclipse.jgit.test/pom.xml +++ b/org.eclipse.jgit.test/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.test diff --git a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF index ff33691eb..8a5205883 100644 --- a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.ui -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: J2SE-1.5 Export-Package: org.eclipse.jgit.awtui;version="3.7.0" diff --git a/org.eclipse.jgit.ui/pom.xml b/org.eclipse.jgit.ui/pom.xml index a808eb42b..86be7cbf1 100644 --- a/org.eclipse.jgit.ui/pom.xml +++ b/org.eclipse.jgit.ui/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit.ui diff --git a/org.eclipse.jgit/META-INF/MANIFEST.MF b/org.eclipse.jgit/META-INF/MANIFEST.MF index eea13ec7b..b87ddc635 100644 --- a/org.eclipse.jgit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit -Bundle-Version: 3.7.0.qualifier +Bundle-Version: 3.7.0.201502031740-rc1 Bundle-Localization: plugin Bundle-Vendor: %provider_name Export-Package: org.eclipse.jgit.api;version="3.7.0"; diff --git a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF index ddb1e57d5..e6086a1ef 100644 --- a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF @@ -3,5 +3,5 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit - Sources Bundle-SymbolicName: org.eclipse.jgit.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.7.0.qualifier -Eclipse-SourceBundle: org.eclipse.jgit;version="3.7.0.qualifier";roots="." +Bundle-Version: 3.7.0.201502031740-rc1 +Eclipse-SourceBundle: org.eclipse.jgit;version="3.7.0.201502031740-rc1";roots="." diff --git a/org.eclipse.jgit/pom.xml b/org.eclipse.jgit/pom.xml index 36a579ec2..a825c8dc2 100644 --- a/org.eclipse.jgit/pom.xml +++ b/org.eclipse.jgit/pom.xml @@ -53,7 +53,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 org.eclipse.jgit diff --git a/pom.xml b/pom.xml index d222dc2ba..b5c211e5f 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ org.eclipse.jgit org.eclipse.jgit-parent pom - 3.7.0-SNAPSHOT + 3.7.0.201502031740-rc1 JGit - Parent ${jgit-url} From 3c2b4086b61798ad8c48536d34b5abe922567ad7 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 4 Feb 2015 02:04:02 +0100 Subject: [PATCH 7/8] Prepare post 3.7.0.201502031740-rc1 builds Change-Id: Id3728e771a4441757de016cc9d68055f668126b0 Signed-off-by: Matthias Sohn --- org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.ant.test/pom.xml | 2 +- org.eclipse.jgit.ant/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.ant/pom.xml | 2 +- org.eclipse.jgit.archive/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF | 4 ++-- org.eclipse.jgit.archive/pom.xml | 2 +- org.eclipse.jgit.console/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.console/pom.xml | 2 +- org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.http.apache/pom.xml | 2 +- org.eclipse.jgit.http.server/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.http.server/pom.xml | 2 +- org.eclipse.jgit.http.test/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.http.test/pom.xml | 2 +- org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.java7.test/pom.xml | 2 +- org.eclipse.jgit.java7/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF | 4 ++-- org.eclipse.jgit.java7/pom.xml | 2 +- org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.junit.http/pom.xml | 2 +- org.eclipse.jgit.junit/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.junit/pom.xml | 2 +- .../org.eclipse.jgit.feature/feature.xml | 2 +- org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml | 2 +- .../org.eclipse.jgit.http.apache.feature/feature.xml | 2 +- .../org.eclipse.jgit.http.apache.feature/pom.xml | 2 +- .../org.eclipse.jgit.java7.feature/feature.xml | 2 +- .../org.eclipse.jgit.java7.feature/pom.xml | 2 +- .../org.eclipse.jgit.junit.feature/feature.xml | 2 +- .../org.eclipse.jgit.junit.feature/pom.xml | 2 +- .../org.eclipse.jgit.pgm.feature/feature.xml | 2 +- .../org.eclipse.jgit.pgm.feature/pom.xml | 2 +- .../org.eclipse.jgit.pgm.source.feature/feature.xml | 2 +- .../org.eclipse.jgit.pgm.source.feature/pom.xml | 2 +- .../org.eclipse.jgit.repository/pom.xml | 2 +- .../org.eclipse.jgit.source.feature/feature.xml | 2 +- .../org.eclipse.jgit.source.feature/pom.xml | 2 +- .../org.eclipse.jgit.target/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml | 2 +- org.eclipse.jgit.packaging/pom.xml | 2 +- org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.pgm.test/pom.xml | 2 +- org.eclipse.jgit.pgm/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF | 4 ++-- org.eclipse.jgit.pgm/pom.xml | 2 +- org.eclipse.jgit.test/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.test/pom.xml | 2 +- org.eclipse.jgit.ui/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit.ui/pom.xml | 2 +- org.eclipse.jgit/META-INF/MANIFEST.MF | 2 +- org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF | 4 ++-- org.eclipse.jgit/pom.xml | 2 +- pom.xml | 2 +- 55 files changed, 59 insertions(+), 59 deletions(-) diff --git a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF index 4218c5cb4..84e64ab28 100644 --- a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.ant.test -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 Import-Package: org.apache.tools.ant, diff --git a/org.eclipse.jgit.ant.test/pom.xml b/org.eclipse.jgit.ant.test/pom.xml index e22742a83..ecf865028 100644 --- a/org.eclipse.jgit.ant.test/pom.xml +++ b/org.eclipse.jgit.ant.test/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.ant.test diff --git a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF index cbac957ac..ba5d1295d 100644 --- a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.jgit.ant -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-RequiredExecutionEnvironment: J2SE-1.5 Import-Package: org.apache.tools.ant, org.eclipse.jgit.storage.file;version="[3.7.0,3.8.0)" diff --git a/org.eclipse.jgit.ant/pom.xml b/org.eclipse.jgit.ant/pom.xml index 6d479c174..326c9720b 100644 --- a/org.eclipse.jgit.ant/pom.xml +++ b/org.eclipse.jgit.ant/pom.xml @@ -48,7 +48,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.ant diff --git a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF index c91cee8d7..a9dd94a87 100644 --- a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.archive -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF index 8734d253c..8de857518 100644 --- a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF @@ -3,5 +3,5 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit.archive - Sources Bundle-SymbolicName: org.eclipse.jgit.archive.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.7.0.201502031740-rc1 -Eclipse-SourceBundle: org.eclipse.jgit.archive;version="3.7.0.201502031740-rc1";roots="." +Bundle-Version: 3.7.0.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.archive;version="3.7.0.qualifier";roots="." diff --git a/org.eclipse.jgit.archive/pom.xml b/org.eclipse.jgit.archive/pom.xml index 8ab564ac7..4c1edba73 100644 --- a/org.eclipse.jgit.archive/pom.xml +++ b/org.eclipse.jgit.archive/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.archive diff --git a/org.eclipse.jgit.console/META-INF/MANIFEST.MF b/org.eclipse.jgit.console/META-INF/MANIFEST.MF index 5ac973a10..0ebd5c4f7 100644 --- a/org.eclipse.jgit.console/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.console/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.console -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: org.eclipse.jgit.console;version="3.7.0" diff --git a/org.eclipse.jgit.console/pom.xml b/org.eclipse.jgit.console/pom.xml index 7ea222321..e262faa8a 100644 --- a/org.eclipse.jgit.console/pom.xml +++ b/org.eclipse.jgit.console/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.console diff --git a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF index 1ccf35853..d6e685741 100644 --- a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.jgit.http.apache -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-Localization: plugin Bundle-Vendor: %Provider-Name diff --git a/org.eclipse.jgit.http.apache/pom.xml b/org.eclipse.jgit.http.apache/pom.xml index a87bb8b03..28c8e842a 100644 --- a/org.eclipse.jgit.http.apache/pom.xml +++ b/org.eclipse.jgit.http.apache/pom.xml @@ -48,7 +48,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.http.apache diff --git a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF index ce8e7d0ba..aeb5b6f4a 100644 --- a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.http.server -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Export-Package: org.eclipse.jgit.http.server;version="3.7.0", diff --git a/org.eclipse.jgit.http.server/pom.xml b/org.eclipse.jgit.http.server/pom.xml index bfd65983a..dd11cd573 100644 --- a/org.eclipse.jgit.http.server/pom.xml +++ b/org.eclipse.jgit.http.server/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.http.server diff --git a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF index dbb315848..0588e54f6 100644 --- a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.http.test -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/org.eclipse.jgit.http.test/pom.xml b/org.eclipse.jgit.http.test/pom.xml index 9911f58a5..819c9fa0d 100644 --- a/org.eclipse.jgit.http.test/pom.xml +++ b/org.eclipse.jgit.http.test/pom.xml @@ -51,7 +51,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.http.test diff --git a/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF index 0d9261912..182c2679e 100644 --- a/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.java7.test -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Import-Package: org.eclipse.jgit.api;version="[3.7.0,3.8.0)", diff --git a/org.eclipse.jgit.java7.test/pom.xml b/org.eclipse.jgit.java7.test/pom.xml index 2b0f11bf2..5fb70a3fd 100644 --- a/org.eclipse.jgit.java7.test/pom.xml +++ b/org.eclipse.jgit.java7.test/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.java7.test diff --git a/org.eclipse.jgit.java7/META-INF/MANIFEST.MF b/org.eclipse.jgit.java7/META-INF/MANIFEST.MF index 7680b378a..938e06091 100644 --- a/org.eclipse.jgit.java7/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.java7/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Fragment-Host: org.eclipse.jgit;bundle-version="3.1.1" Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.java7 -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF index e1544bde6..58d294b92 100644 --- a/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF @@ -3,6 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit.java7 - Sources Bundle-SymbolicName: org.eclipse.jgit.java7.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.7.0.201502031740-rc1 -Eclipse-SourceBundle: org.eclipse.jgit.java7;version="3.7.0.201502031740-rc1";roots="." +Bundle-Version: 3.7.0.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.java7;version="3.7.0.qualifier";roots="." diff --git a/org.eclipse.jgit.java7/pom.xml b/org.eclipse.jgit.java7/pom.xml index a6078ad7e..93c9b5c0b 100644 --- a/org.eclipse.jgit.java7/pom.xml +++ b/org.eclipse.jgit.java7/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.java7 diff --git a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF index 81e289d00..5ede10778 100644 --- a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.junit.http -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.jgit.junit.http/pom.xml b/org.eclipse.jgit.junit.http/pom.xml index 5c5f3126c..a082e50d5 100644 --- a/org.eclipse.jgit.junit.http/pom.xml +++ b/org.eclipse.jgit.junit.http/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.junit.http diff --git a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF index 8d3013519..47e03420d 100644 --- a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.junit -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.jgit.junit/pom.xml b/org.eclipse.jgit.junit/pom.xml index a0e0ba7cb..39a9e6049 100644 --- a/org.eclipse.jgit.junit/pom.xml +++ b/org.eclipse.jgit.junit/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.junit diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml index 43556ffc3..10ea2c9e5 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml index 716f749f4..253342255 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml index d701c01a9..71ad4ffef 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml index 3fe461e56..e7dd844a2 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml index 9e9b87804..49ddae765 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml index 9d28a456f..ffbbb1427 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml index 95e643e18..6446a2c82 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml index 3b411ba4b..ce3355dbc 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml index b1058fe35..3296f502a 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml index 68b516581..b8ee9ac0d 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml index 5bd542838..3a52006ca 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml index 3246f6f75..c3b8150f4 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml index cc5c2762b..96d74e5b3 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.repository diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml index 6ef6cf743..b1eb163df 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml index 5a7af61e7..257495510 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF index a4c49d33e..46dcb3ff9 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF @@ -2,4 +2,4 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: JGit Target Platform Bundle Bundle-SymbolicName: org.eclipse.jgit.target -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml index 78386995e..f303f08bf 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml @@ -49,7 +49,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.target diff --git a/org.eclipse.jgit.packaging/pom.xml b/org.eclipse.jgit.packaging/pom.xml index a242a1efb..66adffa9d 100644 --- a/org.eclipse.jgit.packaging/pom.xml +++ b/org.eclipse.jgit.packaging/pom.xml @@ -53,7 +53,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT pom JGit Tycho Parent diff --git a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF index 41fcf4b7b..1289f98ae 100644 --- a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.pgm.test -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.jgit.pgm.test/pom.xml b/org.eclipse.jgit.pgm.test/pom.xml index 609c26d71..2a87690fb 100644 --- a/org.eclipse.jgit.pgm.test/pom.xml +++ b/org.eclipse.jgit.pgm.test/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.pgm.test diff --git a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF index 471b0de86..a8ff1b884 100644 --- a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.pgm -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF index 17bf701ac..d1ba9ca4f 100644 --- a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF @@ -3,5 +3,5 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit.pgm - Sources Bundle-SymbolicName: org.eclipse.jgit.pgm.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.7.0.201502031740-rc1 -Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="3.7.0.201502031740-rc1";roots="." +Bundle-Version: 3.7.0.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="3.7.0.qualifier";roots="." diff --git a/org.eclipse.jgit.pgm/pom.xml b/org.eclipse.jgit.pgm/pom.xml index 7cb568291..53dc7744a 100644 --- a/org.eclipse.jgit.pgm/pom.xml +++ b/org.eclipse.jgit.pgm/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.pgm diff --git a/org.eclipse.jgit.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.test/META-INF/MANIFEST.MF index 97218272e..af40e883c 100644 --- a/org.eclipse.jgit.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.test -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.jgit.test/pom.xml b/org.eclipse.jgit.test/pom.xml index e532fe75f..1d3333793 100644 --- a/org.eclipse.jgit.test/pom.xml +++ b/org.eclipse.jgit.test/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.test diff --git a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF index 8a5205883..ff33691eb 100644 --- a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.ui -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: J2SE-1.5 Export-Package: org.eclipse.jgit.awtui;version="3.7.0" diff --git a/org.eclipse.jgit.ui/pom.xml b/org.eclipse.jgit.ui/pom.xml index 86be7cbf1..a808eb42b 100644 --- a/org.eclipse.jgit.ui/pom.xml +++ b/org.eclipse.jgit.ui/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit.ui diff --git a/org.eclipse.jgit/META-INF/MANIFEST.MF b/org.eclipse.jgit/META-INF/MANIFEST.MF index b87ddc635..eea13ec7b 100644 --- a/org.eclipse.jgit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit -Bundle-Version: 3.7.0.201502031740-rc1 +Bundle-Version: 3.7.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Export-Package: org.eclipse.jgit.api;version="3.7.0"; diff --git a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF index e6086a1ef..ddb1e57d5 100644 --- a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF @@ -3,5 +3,5 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit - Sources Bundle-SymbolicName: org.eclipse.jgit.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.7.0.201502031740-rc1 -Eclipse-SourceBundle: org.eclipse.jgit;version="3.7.0.201502031740-rc1";roots="." +Bundle-Version: 3.7.0.qualifier +Eclipse-SourceBundle: org.eclipse.jgit;version="3.7.0.qualifier";roots="." diff --git a/org.eclipse.jgit/pom.xml b/org.eclipse.jgit/pom.xml index a825c8dc2..36a579ec2 100644 --- a/org.eclipse.jgit/pom.xml +++ b/org.eclipse.jgit/pom.xml @@ -53,7 +53,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT org.eclipse.jgit diff --git a/pom.xml b/pom.xml index b5c211e5f..d222dc2ba 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ org.eclipse.jgit org.eclipse.jgit-parent pom - 3.7.0.201502031740-rc1 + 3.7.0-SNAPSHOT JGit - Parent ${jgit-url} From fc801dd79f7c6eb3765e4652136f219480478bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Herrmann?= Date: Sat, 31 Jan 2015 00:09:27 +0100 Subject: [PATCH 8/8] Add option --orphan for checkout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I546a93f3e147d8d6fc70094b22679c0d11cd8921 Signed-off-by: RĂ¼diger Herrmann --- .../tst/org/eclipse/jgit/pgm/CheckoutTest.java | 12 ++++++++++++ .../org/eclipse/jgit/pgm/internal/CLIText.properties | 1 + .../src/org/eclipse/jgit/pgm/Checkout.java | 9 ++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java index 90284736c..cef9b9e1a 100644 --- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java +++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java @@ -188,6 +188,18 @@ public class CheckoutTest extends CLIRepositoryTestCase { assertEquals("Hello world a", read(fileA)); } + @Test + public void testCheckoutOrphan() throws Exception { + Git git = new Git(db); + git.commit().setMessage("initial commit").call(); + + assertEquals("Switched to a new branch 'new_branch'", + execute("git checkout --orphan new_branch")); + assertEquals("refs/heads/new_branch", db.getRef("HEAD").getTarget().getName()); + RevCommit commit = git.commit().setMessage("orphan commit").call(); + assertEquals(0, commit.getParentCount()); + } + /** * Steps: *
    diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties index 8a77bf928..2806f9146 100644 --- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties +++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties @@ -345,3 +345,4 @@ usage_updateRemoteRefsFromAnotherRepository=Update remote refs from another repo usage_useNameInsteadOfOriginToTrackUpstream=use instead of 'origin' to track upstream usage_checkoutBranchAfterClone=checkout named branch instead of remotes's HEAD usage_viewCommitHistory=View commit history +usage_orphan=Create a new orphan branch. The first commit made on this new branch will have no parents amd it will be the root of a new history totally disconnected from other branches and commits. \ No newline at end of file diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java index 8f911fd92..56d4fcff0 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java @@ -71,6 +71,9 @@ class Checkout extends TextBuiltin { @Option(name = "--force", aliases = { "-f" }, usage = "usage_forceCheckout") private boolean force = false; + @Option(name = "--orphan", usage = "usage_orphan") + private boolean orphan = false; + @Argument(required = true, index = 0, metaVar = "metaVar_name", usage = "usage_checkout") private String name; @@ -95,6 +98,7 @@ class Checkout extends TextBuiltin { command.setCreateBranch(createBranch); command.setName(name); command.setForce(force); + command.setOrphan(orphan); } try { String oldBranch = db.getBranch(); @@ -107,10 +111,9 @@ class Checkout extends TextBuiltin { name)); return; } - if (createBranch) + if (createBranch || orphan) outw.println(MessageFormat.format( - CLIText.get().switchedToNewBranch, - Repository.shortenRefName(ref.getName()))); + CLIText.get().switchedToNewBranch, name)); else outw.println(MessageFormat.format( CLIText.get().switchedToBranch,