Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Hohenegger2016-10-30 13:37:55 -0400
committerMax Hohenegger2016-11-10 10:06:25 -0500
commit1ed2029dd714ad970e3b17ee3aa66d346dc66d81 (patch)
tree81ab523deb405953ec37472f3b2384d7d7d1ebb7
parentd44f4ef231e74fd58a529e43d74d3c1aa683aa37 (diff)
downloadorg.eclipse.ease.scripts-1ed2029dd714ad970e3b17ee3aa66d346dc66d81.tar.gz
org.eclipse.ease.scripts-1ed2029dd714ad970e3b17ee3aa66d346dc66d81.tar.xz
org.eclipse.ease.scripts-1ed2029dd714ad970e3b17ee3aa66d346dc66d81.zip
Bug 507360: Example Scripts for EGit integration
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=507360 Change-Id: I6c0bb33c77a3d8ca3d8197567c5f9d55a6b0df2f Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
-rw-r--r--JavaScript Snippets/Git/checkoutDevelop.js18
-rw-r--r--JavaScript Snippets/Git/createBranch.js18
-rw-r--r--JavaScript Snippets/Git/deleteBranch.js18
-rw-r--r--JavaScript Snippets/Git/handleUncommittedChanges.js18
-rw-r--r--JavaScript Snippets/Git/mergeDevelop.js18
-rw-r--r--JavaScript Snippets/Git/rebase.js19
-rw-r--r--JavaScript Snippets/Git/renameBranch.js18
-rw-r--r--JavaScript Snippets/Git/resetHard.js18
8 files changed, 145 insertions, 0 deletions
diff --git a/JavaScript Snippets/Git/checkoutDevelop.js b/JavaScript Snippets/Git/checkoutDevelop.js
new file mode 100644
index 0000000..a1ee709
--- /dev/null
+++ b/JavaScript Snippets/Git/checkoutDevelop.js
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (C) 2016, Max Hohenegger <eclipse@hohenegger.eu>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+// name : Checkout develop
+// popup : enableFor(org.eclipse.egit.ui.internal.repository.tree.RepositoryNode)
+// description : Do something with a repository
+loadModule("/System/Platform")
+loadModule('/System/UI')
+
+loadModule("/System/Git UI")
+
+checkoutBranch(getRepository(getSelection()), "develop");
diff --git a/JavaScript Snippets/Git/createBranch.js b/JavaScript Snippets/Git/createBranch.js
new file mode 100644
index 0000000..7980876
--- /dev/null
+++ b/JavaScript Snippets/Git/createBranch.js
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (C) 2016, Max Hohenegger <eclipse@hohenegger.eu>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+// name : Create new branch
+// popup : enableFor(org.eclipse.egit.ui.internal.repository.tree.RepositoryNode)
+// description : Do something with a repository
+loadModule("/System/Platform")
+loadModule('/System/UI')
+
+loadModule("/System/Git UI")
+
+createBranch(getRepository(getSelection()));
diff --git a/JavaScript Snippets/Git/deleteBranch.js b/JavaScript Snippets/Git/deleteBranch.js
new file mode 100644
index 0000000..ae38a59
--- /dev/null
+++ b/JavaScript Snippets/Git/deleteBranch.js
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (C) 2016, Max Hohenegger <eclipse@hohenegger.eu>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+// name : Delete Branch
+// popup : enableFor(org.eclipse.egit.ui.internal.repository.tree.RepositoryNode)
+// description : Do something with a repository
+loadModule("/System/Platform")
+loadModule('/System/UI')
+
+loadModule("/System/Git UI")
+
+deleteBranch(getRepository(getSelection()));
diff --git a/JavaScript Snippets/Git/handleUncommittedChanges.js b/JavaScript Snippets/Git/handleUncommittedChanges.js
new file mode 100644
index 0000000..8a25e47
--- /dev/null
+++ b/JavaScript Snippets/Git/handleUncommittedChanges.js
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (C) 2016, Max Hohenegger <eclipse@hohenegger.eu>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+// name : Handle uncommitted changes
+// popup : enableFor(org.eclipse.egit.ui.internal.repository.tree.RepositoryNode)
+// description : Do something with a repository
+loadModule("/System/Platform")
+loadModule('/System/UI')
+
+loadModule("/System/Git UI")
+
+handleUncommittedFiles(getRepository(getSelection()));
diff --git a/JavaScript Snippets/Git/mergeDevelop.js b/JavaScript Snippets/Git/mergeDevelop.js
new file mode 100644
index 0000000..78d68da
--- /dev/null
+++ b/JavaScript Snippets/Git/mergeDevelop.js
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (C) 2016, Max Hohenegger <eclipse@hohenegger.eu>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+// name : Merge develop
+// popup : enableFor(org.eclipse.egit.ui.internal.repository.tree.RepositoryNode)
+// description : Do something with a repository
+loadModule("/System/Platform")
+loadModule('/System/UI')
+
+loadModule("/System/Git UI")
+
+mergeFrom(getRepository(getSelection()), "develop");
diff --git a/JavaScript Snippets/Git/rebase.js b/JavaScript Snippets/Git/rebase.js
new file mode 100644
index 0000000..49d92a5
--- /dev/null
+++ b/JavaScript Snippets/Git/rebase.js
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (C) 2016, Max Hohenegger <eclipse@hohenegger.eu>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+// name : Rebase on develop
+// toolbar : Git Repositories
+// popup : enableFor(org.eclipse.egit.ui.internal.repository.tree.RepositoryNode)
+// description : Do something with a repository
+loadModule("/System/Platform")
+loadModule('/System/UI')
+
+loadModule("/System/Git UI")
+
+rebaseOn(getRepository(getSelection()), "develop");
diff --git a/JavaScript Snippets/Git/renameBranch.js b/JavaScript Snippets/Git/renameBranch.js
new file mode 100644
index 0000000..940b769
--- /dev/null
+++ b/JavaScript Snippets/Git/renameBranch.js
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (C) 2016, Max Hohenegger <eclipse@hohenegger.eu>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+// name : Rename Branch
+// popup : enableFor(org.eclipse.egit.ui.internal.repository.tree.RepositoryNode)
+// description : Do something with a repository
+loadModule("/System/Platform")
+loadModule('/System/UI')
+
+loadModule("/System/Git UI")
+
+renameBranch(getRepository(getSelection()));
diff --git a/JavaScript Snippets/Git/resetHard.js b/JavaScript Snippets/Git/resetHard.js
new file mode 100644
index 0000000..0af079e
--- /dev/null
+++ b/JavaScript Snippets/Git/resetHard.js
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (C) 2016, Max Hohenegger <eclipse@hohenegger.eu>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+// name : Reset to previous commit
+// popup : enableFor(org.eclipse.egit.ui.internal.repository.tree.RepositoryNode)
+// description : Do something with a repository
+loadModule("/System/Platform")
+loadModule('/System/UI')
+
+loadModule("/System/Git UI")
+
+resetToOriginHead(getRepository(getSelection()), 1);

Back to the top