* [EGIT PATCH 6/6] Add actions in history view to perform reset actions
From: Robin Rosenberg @ 2008-07-10 22:39 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Marek Zawirski, Robin Rosenberg
In-Reply-To: <1215729573-26536-6-git-send-email-robin.rosenberg@dewire.com>
Soft, mixed and hard reset supported
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
org.spearce.egit.ui/plugin.xml | 43 +++++++++++---------
.../actions/HardResetToRevisionAction.java | 26 ++++++++++++
.../actions/MixedResetToRevisionAction.java | 26 ++++++++++++
.../actions/SoftResetToRevisionAction.java | 26 ++++++++++++
4 files changed, 102 insertions(+), 19 deletions(-)
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/HardResetToRevisionAction.java
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/MixedResetToRevisionAction.java
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SoftResetToRevisionAction.java
diff --git a/org.spearce.egit.ui/plugin.xml b/org.spearce.egit.ui/plugin.xml
index 924c6e5..cfd4b80 100644
--- a/org.spearce.egit.ui/plugin.xml
+++ b/org.spearce.egit.ui/plugin.xml
@@ -97,29 +97,34 @@
menubarPath="team.main/group1"
tooltip="%CommitAction_tooltip"/>
</objectContribution>
- <objectContribution
- id="org.spearce.egit.ui.revobjectContributions"
- adaptable="true"
- objectClass="org.spearce.jgit.revwalk.RevObject">
+ <objectContribution
+ id="org.spearce.egit.ui.resetto"
+ objectClass="org.spearce.jgit.revwalk.RevCommit">
<action
- class="org.spearce.egit.ui.internal.actions.BranchAction"
- id="org.spearce.egit.ui.action1"
- label="Kolla"
- enablesFor="*"
- menubarPath="additions">
+ class="org.spearce.egit.ui.internal.actions.SoftResetToRevisionAction"
+ id="org.spearce.egit.ui.softresettorevision"
+ label="Soft Reset"
+ menubarPath="additions"
+ enablesFor="1"
+ tooltip="Resets HEAD but not working directory nor index">
</action>
- </objectContribution>
- <viewerContribution
- id="org.spearce.egit.ui.viewerContribution1"
- targetID="org.spearce.egit.ui.historyPageContributions">
<action
- class="org.spearce.egit.ui.internal.actions.ResetAction"
- id="org.spearce.egit.ui.action1"
- label="Titta"
- enablesFor="*"
- menubarPath="additions">
+ class="org.spearce.egit.ui.internal.actions.MixedResetToRevisionAction"
+ id="org.spearce.egit.ui.mixedresettorevision"
+ label="Mixed Reset"
+ menubarPath="additions"
+ enablesFor="1"
+ tooltip="Resets HEAD and index, but not working directory">
</action>
- </viewerContribution>
+ <action
+ class="org.spearce.egit.ui.internal.actions.HardResetToRevisionAction"
+ id="org.spearce.egit.ui.hardresettorevision"
+ label="Hard Reset"
+ menubarPath="additions"
+ enablesFor="1"
+ tooltip="Resets HEAD and index, and working directory (changed in tracked files will be lost)">
+ </action>
+ </objectContribution>
</extension>
<extension
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/HardResetToRevisionAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/HardResetToRevisionAction.java
new file mode 100644
index 0000000..78fd87f
--- /dev/null
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/HardResetToRevisionAction.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * See LICENSE for the full license text, also available.
+ *******************************************************************************/
+package org.spearce.egit.ui.internal.actions;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.jface.action.IAction;
+import org.spearce.egit.core.op.ResetOperation;
+
+/**
+ * Hard reset to selected revision
+ */
+public class HardResetToRevisionAction extends AbstractRevObjectAction {
+
+ @Override
+ protected IWorkspaceRunnable createOperation(IAction act, List selection) {
+ return new ResetOperation(getActiveRepository(), selection.get(0)
+ .toString(), ResetOperation.ResetType.HARD);
+ }
+}
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/MixedResetToRevisionAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/MixedResetToRevisionAction.java
new file mode 100644
index 0000000..6e4a9bf
--- /dev/null
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/MixedResetToRevisionAction.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * See LICENSE for the full license text, also available.
+ *******************************************************************************/
+package org.spearce.egit.ui.internal.actions;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.jface.action.IAction;
+import org.spearce.egit.core.op.ResetOperation;
+
+/**
+ * Mixed reset to selected revision
+ */
+public class MixedResetToRevisionAction extends AbstractRevObjectAction {
+
+ @Override
+ protected IWorkspaceRunnable createOperation(IAction act, List selection) {
+ return new ResetOperation(getActiveRepository(), selection.get(0)
+ .toString(), ResetOperation.ResetType.MIXED);
+ }
+}
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SoftResetToRevisionAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SoftResetToRevisionAction.java
new file mode 100644
index 0000000..7abbc92
--- /dev/null
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SoftResetToRevisionAction.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * See LICENSE for the full license text, also available.
+ *******************************************************************************/
+package org.spearce.egit.ui.internal.actions;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.jface.action.IAction;
+import org.spearce.egit.core.op.ResetOperation;
+
+/**
+ * Soft reset to selected revision
+ */
+public class SoftResetToRevisionAction extends AbstractRevObjectAction {
+
+ @Override
+ protected IWorkspaceRunnable createOperation(IAction act, List selection) {
+ return new ResetOperation(getActiveRepository(), selection.get(0)
+ .toString(), ResetOperation.ResetType.SOFT);
+ }
+}
--
1.5.6.2.220.g44701
^ permalink raw reply related
* [EGIT PATCH 5/6] Create baseclasses for actions and operations on RevObjects
From: Robin Rosenberg @ 2008-07-10 22:39 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Marek Zawirski, Robin Rosenberg
In-Reply-To: <1215729573-26536-5-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../internal/actions/AbstractOperationAction.java | 15 +++++++----
.../internal/actions/AbstractRevObjectAction.java | 26 ++++++++++++++++++++
.../actions/AbstractRevObjectOperation.java | 21 ++++++++++++++++
3 files changed, 57 insertions(+), 5 deletions(-)
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractRevObjectAction.java
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractRevObjectOperation.java
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractOperationAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractOperationAction.java
index be6d0d5..52f60f5 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractOperationAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractOperationAction.java
@@ -32,11 +32,20 @@ import org.spearce.egit.ui.UIText;
* Common functionality for EGit operations.
*/
public abstract class AbstractOperationAction implements IObjectActionDelegate {
- private IWorkbenchPart wp;
+ /**
+ * The active workbench part
+ */
+ protected IWorkbenchPart wp;
private IWorkspaceRunnable op;
public void selectionChanged(final IAction act, final ISelection sel) {
+ // work performed in setActivePart
+ }
+
+ public void setActivePart(final IAction act, final IWorkbenchPart part) {
+ wp = part;
+ ISelection sel = part.getSite().getPage().getSelection();
final List selection;
if (sel instanceof IStructuredSelection && !sel.isEmpty()) {
selection = ((IStructuredSelection) sel).toList();
@@ -47,10 +56,6 @@ public abstract class AbstractOperationAction implements IObjectActionDelegate {
act.setEnabled(op != null && wp != null);
}
- public void setActivePart(final IAction act, final IWorkbenchPart part) {
- wp = part;
- }
-
/**
* Instantiate an operation on an action on provided objects.
*
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractRevObjectAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractRevObjectAction.java
new file mode 100644
index 0000000..b7f4285
--- /dev/null
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractRevObjectAction.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * See LICENSE for the full license text, also available.
+ *******************************************************************************/
+package org.spearce.egit.ui.internal.actions;
+
+import org.spearce.egit.ui.internal.history.RevObjectSelectionProvider;
+import org.spearce.jgit.lib.Repository;
+
+abstract class AbstractRevObjectAction extends AbstractOperationAction {
+
+ /**
+ * Find out which repository is involved here
+ *
+ * @return the Git repository associated with the selected RevObject
+ */
+ protected Repository getActiveRepository() {
+ RevObjectSelectionProvider selectionProvider = (RevObjectSelectionProvider) wp
+ .getSite().getSelectionProvider();
+ return selectionProvider.getActiveRepository();
+ }
+
+}
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractRevObjectOperation.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractRevObjectOperation.java
new file mode 100644
index 0000000..0c5d570
--- /dev/null
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractRevObjectOperation.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * See LICENSE for the full license text, also available.
+ *******************************************************************************/
+package org.spearce.egit.ui.internal.actions;
+
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.spearce.jgit.lib.Repository;
+
+abstract class AbstractRevObjectOperation implements IWorkspaceRunnable {
+
+ Repository repository;
+
+ AbstractRevObjectOperation(final Repository repository) {
+ this.repository = repository;
+ }
+
+}
--
1.5.6.2.220.g44701
^ permalink raw reply related
* [EGIT PATCH 3/6] Adapt Git team operations to non-resouce objects
From: Robin Rosenberg @ 2008-07-10 22:39 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Marek Zawirski, Robin Rosenberg
In-Reply-To: <1215729573-26536-3-git-send-email-robin.rosenberg@dewire.com>
Sometimes structures in the workbench, such as in the Project Explorer
in the Java EE perspective, are not represented directly as resources,
but connect to resources. We use the IAdaptable interface to ask for
the underlying resource and the proceed as usual.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../org/spearce/egit/core/internal/UpdateJob.java | 2 ++
.../egit/core/op/AssumeUnchangedOperation.java | 6 +++---
.../egit/core/op/DisconnectProviderOperation.java | 7 +++----
.../org/spearce/egit/core/op/TrackOperation.java | 6 +++---
.../org/spearce/egit/core/op/UntrackOperation.java | 6 +++---
5 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/internal/UpdateJob.java b/org.spearce.egit.core/src/org/spearce/egit/core/internal/UpdateJob.java
index 9641529..be1c591 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/internal/UpdateJob.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/internal/UpdateJob.java
@@ -21,6 +21,7 @@ import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -65,6 +66,7 @@ public class UpdateJob extends Job {
final int[] count=new int[1];
long t0=System.currentTimeMillis();
for (Object obj : rsrcList) {
+ obj = ((IAdaptable)obj).getAdapter(IResource.class);
if (obj instanceof IContainer) {
((IContainer)obj).accept(new IResourceProxyVisitor() {
public boolean visit(IResourceProxy rp) throws CoreException {
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/AssumeUnchangedOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/AssumeUnchangedOperation.java
index 856ef3f..78a84bb 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/AssumeUnchangedOperation.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/AssumeUnchangedOperation.java
@@ -18,6 +18,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.spearce.egit.core.Activator;
@@ -51,9 +52,8 @@ public class AssumeUnchangedOperation implements IWorkspaceRunnable {
final IdentityHashMap<RepositoryMapping, Boolean> tomerge = new IdentityHashMap<RepositoryMapping, Boolean>();
m.beginTask(CoreText.AssumeUnchangedOperation_adding, rsrcList.size() * 200);
try {
- final Iterator i = rsrcList.iterator();
- while (i.hasNext()) {
- final Object obj = i.next();
+ for (Object obj : rsrcList) {
+ obj = ((IAdaptable)obj).getAdapter(IResource.class);
if (obj instanceof IResource) {
final IResource toAssumeValid = (IResource)obj;
final RepositoryMapping rm = RepositoryMapping.getMapping(toAssumeValid);
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/DisconnectProviderOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/DisconnectProviderOperation.java
index 7fde335..b63c69b 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/DisconnectProviderOperation.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/DisconnectProviderOperation.java
@@ -8,13 +8,13 @@
package org.spearce.egit.core.op;
import java.util.Collection;
-import java.util.Iterator;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
@@ -51,9 +51,8 @@ public class DisconnectProviderOperation implements IWorkspaceRunnable {
m.beginTask(CoreText.DisconnectProviderOperation_disconnecting,
projectList.size() * 200);
try {
- final Iterator i = projectList.iterator();
- while (i.hasNext()) {
- final Object obj = i.next();
+ for (Object obj : projectList) {
+ obj = ((IAdaptable)obj).getAdapter(IResource.class);
if (obj instanceof IProject) {
final IProject p = (IProject) obj;
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java
index af16cdb..29b4344 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java
@@ -21,6 +21,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.team.core.Team;
@@ -65,9 +66,8 @@ public class TrackOperation implements IWorkspaceRunnable {
final IdentityHashMap<RepositoryMapping, Boolean> tomerge = new IdentityHashMap<RepositoryMapping, Boolean>();
m.beginTask(CoreText.AddOperation_adding, rsrcList.size() * 200);
try {
- final Iterator i = rsrcList.iterator();
- while (i.hasNext()) {
- final Object obj = i.next();
+ for (Object obj : rsrcList) {
+ obj = ((IAdaptable)obj).getAdapter(IResource.class);
if (obj instanceof IResource) {
final IResource toAdd = (IResource)obj;
final RepositoryMapping rm = RepositoryMapping.getMapping(toAdd);
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java
index fdc9c2e..369ff38 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java
@@ -20,6 +20,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.spearce.egit.core.Activator;
@@ -62,9 +63,8 @@ public class UntrackOperation implements IWorkspaceRunnable {
final IdentityHashMap<RepositoryMapping, Boolean> tomerge = new IdentityHashMap<RepositoryMapping, Boolean>();
m.beginTask(CoreText.AddOperation_adding, rsrcList.size() * 200);
try {
- final Iterator i = rsrcList.iterator();
- while (i.hasNext()) {
- final Object obj = i.next();
+ for (Object obj : rsrcList) {
+ obj = ((IAdaptable)obj).getAdapter(IResource.class);
if (obj instanceof IResource) {
final IResource toRemove = (IResource)obj;
final IProject p = toRemove.getProject();
--
1.5.6.2.220.g44701
^ permalink raw reply related
* [EGIT PATCH 4/6] Teach the revision selection handler about the active repository
From: Robin Rosenberg @ 2008-07-10 22:39 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Marek Zawirski, Robin Rosenberg
In-Reply-To: <1215729573-26536-4-git-send-email-robin.rosenberg@dewire.com>
The handler needs to know which repository the selected revision was in.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../egit/ui/internal/history/GitHistoryPage.java | 4 ++++
.../history/RevObjectSelectionProvider.java | 19 +++++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
index d8777ef..6b55185 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
@@ -503,6 +503,8 @@ public class GitHistoryPage extends HistoryPage {
@Override
public boolean inputSet() {
+ if (revObjectSelectionProvider != null)
+ revObjectSelectionProvider.setActiveRepository(null);
cancelRefreshJob();
if (graph == null)
@@ -589,9 +591,11 @@ public class GitHistoryPage extends HistoryPage {
list.source(currentWalk);
final GenerateHistoryJob rj = new GenerateHistoryJob(this, list);
+ final Repository fdb = db;
rj.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(final IJobChangeEvent event) {
+ revObjectSelectionProvider.setActiveRepository(fdb);
final Control graphctl = graph.getControl();
if (job != rj || graphctl.isDisposed())
return;
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/RevObjectSelectionProvider.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/RevObjectSelectionProvider.java
index c44b229..46a091c 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/RevObjectSelectionProvider.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/RevObjectSelectionProvider.java
@@ -14,6 +14,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.spearce.jgit.lib.Repository;
/**
* A selection provider for Git revision objects
@@ -24,6 +25,8 @@ public class RevObjectSelectionProvider implements ISelectionProvider {
private ISelection selection;
+ private Repository repository;
+
public void addSelectionChangedListener(ISelectionChangedListener listener) {
listeners.add(listener);
}
@@ -45,4 +48,20 @@ public class RevObjectSelectionProvider implements ISelectionProvider {
}
}
+ /**
+ * Sets the active repository. This one is called by the view when the view
+ * is updated with new data.
+ *
+ * @param repository
+ */
+ public void setActiveRepository(Repository repository) {
+ this.repository = repository;
+ }
+
+ /**
+ * @return currently active repository
+ */
+ public Repository getActiveRepository() {
+ return repository;
+ }
}
--
1.5.6.2.220.g44701
^ permalink raw reply related
* [EGIT PATCH 1/6] Create a selection handler for the revision graph.
From: Robin Rosenberg @ 2008-07-10 22:39 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Marek Zawirski, Robin Rosenberg
In-Reply-To: <1215729573-26536-1-git-send-email-robin.rosenberg@dewire.com>
This make it possible to associate content menu contributions
with selections in the history graph.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../egit/ui/internal/history/GitHistoryPage.java | 11 ++++-
.../history/RevObjectSelectionProvider.java | 48 ++++++++++++++++++++
2 files changed, 57 insertions(+), 2 deletions(-)
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/RevObjectSelectionProvider.java
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
index 9bcae19..6eaa6e4 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
@@ -181,6 +181,11 @@ public class GitHistoryPage extends HistoryPage {
*/
private List<String> pathFilters;
+ /**
+ * The selection provider tracks the selected revisions for the context menu
+ */
+ private RevObjectSelectionProvider revObjectSelectionProvider;
+
@Override
public void createControl(final Composite parent) {
GridData gd;
@@ -211,6 +216,7 @@ public class GitHistoryPage extends HistoryPage {
layoutSashForm(graphDetailSplit, SPLIT_GRAPH);
layoutSashForm(revInfoSplit, SPLIT_INFO);
+ revObjectSelectionProvider = new RevObjectSelectionProvider();
popupMgr = new MenuManager(null, POPUP_ID);
attachCommitSelectionChanged();
createLocalToolbarActions();
@@ -221,7 +227,6 @@ public class GitHistoryPage extends HistoryPage {
attachContextMenu(graph.getControl());
attachContextMenu(commentViewer.getControl());
attachContextMenu(fileViewer.getControl());
-
layout();
}
@@ -229,7 +234,8 @@ public class GitHistoryPage extends HistoryPage {
popupMgr.add(new Separator());
popupMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
getSite().registerContextMenu(POPUP_ID, popupMgr,
- getSite().getSelectionProvider());
+ revObjectSelectionProvider);
+ getSite().setSelectionProvider(revObjectSelectionProvider);
}
private void attachContextMenu(final Control c) {
@@ -299,6 +305,7 @@ public class GitHistoryPage extends HistoryPage {
c = (PlotCommit<?>) sel.getFirstElement();
commentViewer.setInput(c);
fileViewer.setInput(c);
+ revObjectSelectionProvider.setSelection(s);
}
});
commentViewer
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/RevObjectSelectionProvider.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/RevObjectSelectionProvider.java
new file mode 100644
index 0000000..c44b229
--- /dev/null
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/RevObjectSelectionProvider.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * See LICENSE for the full license text, also available.
+ *******************************************************************************/
+package org.spearce.egit.ui.internal.history;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+
+/**
+ * A selection provider for Git revision objects
+ */
+public class RevObjectSelectionProvider implements ISelectionProvider {
+
+ private List<ISelectionChangedListener> listeners = new ArrayList<ISelectionChangedListener>();
+
+ private ISelection selection;
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ listeners.add(listener);
+ }
+
+ public ISelection getSelection() {
+ return selection;
+ }
+
+ public void removeSelectionChangedListener(
+ ISelectionChangedListener listener) {
+ listeners.remove(listener);
+ }
+
+ public void setSelection(ISelection selection) {
+ this.selection = selection;
+ SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
+ for (ISelectionChangedListener l : listeners) {
+ l.selectionChanged(event);
+ }
+ }
+
+}
--
1.5.6.2.220.g44701
^ permalink raw reply related
* [EGIT PATCH 2/6] Using the page site selection turned out to be cumbersome.
From: Robin Rosenberg @ 2008-07-10 22:39 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Marek Zawirski, Robin Rosenberg
In-Reply-To: <1215729573-26536-2-git-send-email-robin.rosenberg@dewire.com>
So we use the view site instead. I'm not sure that is the proper
way though.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
org.spearce.egit.ui/plugin.xml | 23 ++++++++++++++++++++
.../egit/ui/internal/history/GitHistoryPage.java | 3 +-
2 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/org.spearce.egit.ui/plugin.xml b/org.spearce.egit.ui/plugin.xml
index 611829a..924c6e5 100644
--- a/org.spearce.egit.ui/plugin.xml
+++ b/org.spearce.egit.ui/plugin.xml
@@ -97,6 +97,29 @@
menubarPath="team.main/group1"
tooltip="%CommitAction_tooltip"/>
</objectContribution>
+ <objectContribution
+ id="org.spearce.egit.ui.revobjectContributions"
+ adaptable="true"
+ objectClass="org.spearce.jgit.revwalk.RevObject">
+ <action
+ class="org.spearce.egit.ui.internal.actions.BranchAction"
+ id="org.spearce.egit.ui.action1"
+ label="Kolla"
+ enablesFor="*"
+ menubarPath="additions">
+ </action>
+ </objectContribution>
+ <viewerContribution
+ id="org.spearce.egit.ui.viewerContribution1"
+ targetID="org.spearce.egit.ui.historyPageContributions">
+ <action
+ class="org.spearce.egit.ui.internal.actions.ResetAction"
+ id="org.spearce.egit.ui.action1"
+ label="Titta"
+ enablesFor="*"
+ menubarPath="additions">
+ </action>
+ </viewerContribution>
</extension>
<extension
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
index 6eaa6e4..d8777ef 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
@@ -235,7 +235,8 @@ public class GitHistoryPage extends HistoryPage {
popupMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
getSite().registerContextMenu(POPUP_ID, popupMgr,
revObjectSelectionProvider);
- getSite().setSelectionProvider(revObjectSelectionProvider);
+ getHistoryPageSite().getPart().getSite().setSelectionProvider(
+ revObjectSelectionProvider);
}
private void attachContextMenu(final Control c) {
--
1.5.6.2.220.g44701
^ permalink raw reply related
* [EGIT PATCH 0/6] RevObject selection handler
From: Robin Rosenberg @ 2008-07-10 22:39 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Marek Zawirski, Robin Rosenberg
This adds a new type of selection handler that connects to the
history view, but could be used in other, yet to be invented
views. It allows us to declare actions using the view and
object contribution mechanism. And then some uses of that code.
-- robin
Robin Rosenberg (6):
Create a selection handler for the revision graph.
Using the page site selection turned out to be cumbersome.
Adapt Git team operations to non-resouce objects
Teach the revision selection handler about the active repository
Create baseclasses for actions and operations on RevObjects
Add actions in history view to perform reset actions
.../org/spearce/egit/core/internal/UpdateJob.java | 2 +
.../egit/core/op/AssumeUnchangedOperation.java | 6 +-
.../egit/core/op/DisconnectProviderOperation.java | 7 +-
.../org/spearce/egit/core/op/TrackOperation.java | 6 +-
.../org/spearce/egit/core/op/UntrackOperation.java | 6 +-
org.spearce.egit.ui/plugin.xml | 28 ++++++++
.../internal/actions/AbstractOperationAction.java | 15 +++--
.../internal/actions/AbstractRevObjectAction.java | 26 ++++++++
.../actions/AbstractRevObjectOperation.java | 21 ++++++
.../actions/HardResetToRevisionAction.java | 26 ++++++++
.../actions/MixedResetToRevisionAction.java | 26 ++++++++
.../actions/SoftResetToRevisionAction.java | 26 ++++++++
.../egit/ui/internal/history/GitHistoryPage.java | 16 ++++-
.../history/RevObjectSelectionProvider.java | 67 ++++++++++++++++++++
14 files changed, 258 insertions(+), 20 deletions(-)
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractRevObjectAction.java
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractRevObjectOperation.java
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/HardResetToRevisionAction.java
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/MixedResetToRevisionAction.java
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SoftResetToRevisionAction.java
create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/RevObjectSelectionProvider.java
^ permalink raw reply
* Re: [PATCH] bisect: test merge base if good rev is not an ancestor of bad rev
From: Johannes Schindelin @ 2008-07-10 22:38 UTC (permalink / raw)
To: Christian Couder; +Cc: Junio C Hamano, Michael Haggerty, Jeff King, git
In-Reply-To: <200807110036.17504.chriscool@tuxfamily.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1178 bytes --]
Hi,
On Fri, 11 Jul 2008, Christian Couder wrote:
> Le jeudi 10 juillet 2008, Junio C Hamano a écrit :
>
> > - "Test this merge-base before going forward, please" will add
> > typically only one round of check (if you have more merge bases
> > between good and bad, you need to test all of them are good to be
> > sure), so it is not "slower nor more complex".
>
> By "slower" I meant that it would need more rounds of check on average.
> By "more complex" I meant that more code is needed.
>
> And I think you are right, all the merge bases need to be tested so I
> will send a patch on top of the patch discussed here.
Good luck. This will open the scenario where people use a proper ancestor
as "good" revision. In this case, you test that. If it is "bad" you
report that it is the _first_ one.
You are opening a can of worms here, and I doubt that this is a good idea.
git-bisect as-is has very precise, and _simple_ semantics, and users
should really know what they are doing (i.e. not marking something as
"good" which is on a branch containing a fix).
Trying to be too clever here might just make the whole tool rather
useless.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] git-mailinfo: Fix getting the subject from the body
From: Lukas Sandström @ 2008-07-10 22:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List, Lukas Sandström
In-Reply-To: <7vod55o0tx.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
> Lukas Sandström <lukass@etek.chalmers.se> writes:
>
>> "Subject: " isn't in the static array "header", and thus
>> memcmp("Subject: ", header[i], 7) will never match.
>>
>> Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
>> ---
>>
>> This has been broken since 2007-03-12, with commit
>> 87ab799234639c26ea10de74782fa511cb3ca606
>> so it might not be very important.
>
> Wow, thanks. Perhaps we would want some additional test scripts?
Yes, apparently.
After looking at this part some more, I see that there is no guarantee
that hdr_data[i] != NULL in this codepath, and then we won't use the
subject anyway.
I'm currently working on rewriting git-mailinfo to use strbuf's insted
of the preallocated buffers currently used. Do you want me to send a
patch allocating hdr_data[i], or can you wait for my strbuf-conversion
patch? It'll propably be ready for review tonight.
/Lukas
^ permalink raw reply
* Re: [PATCH] bisect: test merge base if good rev is not an ancestor of bad rev
From: Christian Couder @ 2008-07-10 22:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Schindelin, Michael Haggerty, Jeff King, git
In-Reply-To: <7vd4llpkxq.fsf@gitster.siamese.dyndns.org>
Le jeudi 10 juillet 2008, Junio C Hamano a écrit :
> Christian Couder <chriscool@tuxfamily.org> writes:
> > Yeah, in that case...
> >
> >> The whole idea of "bisect" relies on that idea, that any ancestor of a
> >> good commit is good. Otherwise you'd have to check the commits one by
> >> one, not in a bisecting manner.
>
> Didn't we already discuss this at length?
Yes, the thread is there:
http://thread.gmane.org/gmane.comp.version-control.git/86951
> > No, you just need to check that the merge bases between the bad rev on
> > one side and each good rev on the other side are good too. And if that
> > is the case, then you can be sure that bisection will point to a first
> > bad commit.
> >
> > So the choice is between a simple and fast but not fully reliable
> > bisect, or a more complex and slower but fully reliable bisect.
>
> I have not looked at your implementation, but I do think:
>
> - The current one is not "fully reliable"; the user needs to know what
> he is doing. You might call it "prone to user errors".
I agree.
> - "Test this merge-base before going forward, please" will add typically
> only one round of check (if you have more merge bases between good and
> bad, you need to test all of them are good to be sure), so it is not
> "slower nor more complex".
By "slower" I meant that it would need more rounds of check on average.
By "more complex" I meant that more code is needed.
And I think you are right, all the merge bases need to be tested so I will
send a patch on top of the patch discussed here.
Another idea to fix the problem, might be to bisect as usual and at the end
before saying "X is first bad commit" to check if some of X parents are
merge bases between the bad rev and a good rev. If that is the case, then
we could ask the user to check that these parents are all good. On average
this would probably reduce the number of revs the user must check.
Regards,
Christian.
^ permalink raw reply
* Re: [JGIT PATCH 2/5] Don't display passwords on the console in fetch/push output
From: Johannes Schindelin @ 2008-07-10 22:25 UTC (permalink / raw)
To: Robin Rosenberg; +Cc: Shawn O. Pearce, Marek Zawirski, git
In-Reply-To: <200807102217.38459.robin.rosenberg.lists@dewire.com>
Hi,
On Thu, 10 Jul 2008, Robin Rosenberg wrote:
> >From 99c09cf2321f36eb81043aed2fa6834811ee762b Mon Sep 17 00:00:00 2001
> From: Robin Rosenberg <robin.rosenberg@dewire.com>
> Date: Thu, 10 Jul 2008 22:16:19 +0200
> Subject: [PATCH] Avoid password leak from URIIsh
What is this new fashion of sending them headers in the mail body? Robin,
I thought you knew better.
Ciao,
Dscho
^ permalink raw reply
* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
From: Johannes Schindelin @ 2008-07-10 22:24 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jakub Narebski, Toralf Förster, git
In-Reply-To: <7v8ww9pkv8.fsf@gitster.siamese.dyndns.org>
Hi,
On Thu, 10 Jul 2008, Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
> > Besides, it would be nice to have some command (git-rev-parse
> > perhaps?) which could take ambiguous commit-ish, and list all commit
> > which matches it.
>
> Have fun writing it and send in a patch.
Note that this really could be a patch, but not for rev-parse. Patch
revision.c instead to parse the argument into _all_ matching revisions.
The :/ notation I no longer like so much should give you a lot of
inspiration.
Good luck,
Dscho
^ permalink raw reply
* Re: THREADED_DELTA_SEARCH
From: Alex Riesen @ 2008-07-10 22:19 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Junio C Hamano, Pierre Habouzit, Git ML
In-Reply-To: <alpine.LFD.1.10.0807101633480.12484@xanadu.home>
Nicolas Pitre, Thu, Jul 10, 2008 22:36:35 +0200:
> > There are just systems were resources are a problem.
>
> Then on those systems you simply have to adjust the appropriate knob.
_after_ they crashed?
^ permalink raw reply
* Re: Errors importing Apache Synapse SVN using Git
From: Björn Steinbrink @ 2008-07-10 22:02 UTC (permalink / raw)
To: Michael J Gruber; +Cc: git
In-Reply-To: <g55130$n3i$1@ger.gmane.org>
On 2008.07.10 14:59:11 +0200, Michael J Gruber wrote:
> Asankha C. Perera venit, vidit, dixit 10.07.2008 14:01:
>> Hi All
>>
>> I am an Apache Synapse developer, and want to import the Synapse SVN
>> repo into Git, so that Ohloh can properly get the Synapse history
>> (http://www.ohloh.net/topics/1326?page=1#post_6287)
>>
>> However, when I try the command: "git svn clone --trunk=trunk
>> --tags=tags --branches=branches
>> http://svn.apache.org/repos/asf/synapse" it seems to take forever, (or
>> at least until the next network glitch), and keeps filling up a file
>> with just plain zeros ("0") :
>> ./.git/svn/trunk/.rev_db.13f79535-47bb-0310-9956-ffa450edef68
>>
>> Can someone try the above command on the Synapse repo and tell me what
>> I can do to import from the SVN?
>
> "svn log" takes forever on that repo, too. Current rev seems to be
> 675546, and the synapse path does not exist in early revisions. Knowing
> the initial revision would help, then you could save "git svn" from
> having to comb through (supposedly) tens of thousands of irrelevant revs.
>
> I just checked out trunk using svn 1.4.6, "svn log ." takes forever in
> the root dir. So the svn repo seems to be largely unusable, at least
> when accessed from svn 1.4.6 clients (the server is 1.5.0, I see).
>
> Okay, I bisected it and got r234477 as the beginning of time for
> synapse. "svn log -r 234477:HEAD" is still painful.
>
> You may want to fetch 1000 revs each or so from there each time.
Also, upgrading git to 1.5.6.2 might be a good idea. It doesn't use the
.revdb file format anymore, but a more efficient .revmap file. And it
has quite a few performance improvements (although they won't help
against the primary issue with that svn server). Don't use
1.5.6/1.5.6.1, they have a git-svn bug that can lead to corrupted clones
(just in case that your distro has packages for those versions but not
yet got 1.5.6.2).
Björn
^ permalink raw reply
* [PATCH] git-mailinfo: Fix getting the subject from the body
From: Lukas Sandström @ 2008-07-10 21:41 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Lukas Sandström, Git Mailing List
"Subject: " isn't in the static array "header", and thus
memcmp("Subject: ", header[i], 7) will never match.
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
---
This has been broken since 2007-03-12, with commit
87ab799234639c26ea10de74782fa511cb3ca606
so it might not be very important.
builtin-mailinfo.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 962aa34..2d1520f 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -334,7 +334,7 @@ static int check_header(char *line, unsigned linesize, char **hdr_data, int over
return 1;
if (!memcmp("[PATCH]", line, 7) && isspace(line[7])) {
for (i = 0; header[i]; i++) {
- if (!memcmp("Subject: ", header[i], 9)) {
+ if (!memcmp("Subject", header[i], 7)) {
if (! handle_header(line, hdr_data[i], 0)) {
return 1;
}
--
1.5.4.5
^ permalink raw reply related
* [PATCH] git-mailinfo: document the -n option
From: Lukas Sandström @ 2008-07-10 21:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Lukas Sandström, Git Mailing List
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
---
Documentation/git-mailinfo.txt | 5 ++++-
builtin-mailinfo.c | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-mailinfo.txt b/Documentation/git-mailinfo.txt
index cc52db3..316bcc6 100644
--- a/Documentation/git-mailinfo.txt
+++ b/Documentation/git-mailinfo.txt
@@ -8,7 +8,7 @@ git-mailinfo - Extracts patch and authorship from a single e-mail message
SYNOPSIS
--------
-'git mailinfo' [-k] [-u | --encoding=<encoding>] <msg> <patch>
+'git mailinfo' [-k] [-u | --encoding=<encoding> | -n] <msg> <patch>
DESCRIPTION
@@ -46,6 +46,9 @@ conversion, even with this flag.
from what is specified by i18n.commitencoding, this flag
can be used to override it.
+-n::
+ Disable all charset re-coding of the metadata.
+
<msg>::
The commit log message extracted from e-mail, usually
except the title line which comes from e-mail Subject.
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index fa6e8f9..962aa34 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -960,7 +960,7 @@ static int mailinfo(FILE *in, FILE *out, int ks, const char *encoding,
}
static const char mailinfo_usage[] =
- "git-mailinfo [-k] [-u | --encoding=<encoding>] msg patch <mail >info";
+ "git-mailinfo [-k] [-u | --encoding=<encoding> | -n] msg patch <mail >info";
int cmd_mailinfo(int argc, const char **argv, const char *prefix)
{
--
1.5.4.5
^ permalink raw reply related
* [PATCH] tutorial: clarify "pull" is "fetch + merge"
From: Junio C Hamano @ 2008-07-10 21:01 UTC (permalink / raw)
To: git; +Cc: Ian Katz, Miklos Vajna
In-Reply-To: <dc5b80bf0807101127q63e3132fw207baf0d88db3d9d@mail.gmail.com>
The document says that a fetch with a configured remote stores what are
fetched in the remote tracking branches "Unlike the longhand form", but
there is no longhand form "fetch" demonstrated earlier.
This adds a missing demonstration of the longhand form, and a new
paragraph to explain why some people might want to fetch before pull.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/gittutorial.txt | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/Documentation/gittutorial.txt b/Documentation/gittutorial.txt
index e71b561..38807f3 100644
--- a/Documentation/gittutorial.txt
+++ b/Documentation/gittutorial.txt
@@ -306,6 +306,32 @@ is the default.)
The "pull" command thus performs two operations: it fetches changes
from a remote branch, then merges them into the current branch.
+Note that in general, Alice would want her local changes committed before
+initiating this "pull". If Bob's work conflicts with what Alice did since
+their histories forked, Alice will use her working tree and the index to
+resolve conflicts, and existing local changes will interfere with the
+conflict resolution process (git will still perform the fetch but will
+refuse to merge --- Alice will have to get rid of her local changes in
+some way and pull again when this happens).
+
+Alice can peek what Bob did without merging first, using the "fetch"
+command; this allows Alice to inspect what bob did, using a special
+symbol "FETCH_HEAD", in order to determine if he has anything worth
+pulling, like this:
+
+------------------------------------------------
+$ git fetch /home/bob/myrepo master
+$ git log -p ..FETCH_HEAD
+------------------------------------------------
+
+This operation is safe even if Alice has uncommitted local changes.
+
+After inspecting what Bob did, if there is nothing urgent, Alice may
+decide to continue working without pulling from Bob. If Bob's history
+does have something Alice would immediately need, Alice may choose to
+stash her work-in-progress first, do a "pull", and then finally unstash
+her work-in-progress on top of the resulting history.
+
When you are working in a small closely knit group, it is not
unusual to interact with the same repository over and over
again. By defining 'remote' repository shorthand, you can make
@@ -315,7 +341,7 @@ it easier:
$ git remote add bob /home/bob/myrepo
------------------------------------------------
-With this, Alice can perform the first operation alone using the
+With this, Alice can perform the first part of "pull" operation alone using the
'git-fetch' command without merging them with her own branch,
using:
^ permalink raw reply related
* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
From: Linus Torvalds @ 2008-07-10 20:36 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Junio C Hamano, Toralf Förster, git
In-Reply-To: <m3d4lledbn.fsf@localhost.localdomain>
On Thu, 10 Jul 2008, Jakub Narebski wrote:
>
> Nevertheless it _could_ be unique.
NO IT COULD NOT!
It doesn't matter if it's unique in _one_ repository. What matters is if
it is globally unique!
Otherwise, people will start sending these version numbers out in emails,
and now somethign that was unique in the senders repo is actually not
unique at the receivers side (or _is_ unique, but points to something
totally different).
So no. A revision number like "v2.6.26-rc8-227" is fundamentally and
utterly broken. No way it should ever be accepted, even as a "helpful"
thing, because it's not helpful at all. It would be a sure way to crap.
Linus
^ permalink raw reply
* Re: THREADED_DELTA_SEARCH
From: Nicolas Pitre @ 2008-07-10 20:36 UTC (permalink / raw)
To: Alex Riesen; +Cc: Junio C Hamano, Pierre Habouzit, Git ML
In-Reply-To: <20080710202919.GB3717@blimp.local>
On Thu, 10 Jul 2008, Alex Riesen wrote:
> Nicolas Pitre, Thu, Jul 10, 2008 22:26:03 +0200:
> > On Thu, 10 Jul 2008, Alex Riesen wrote:
> > >
> > > Have you ever seen what happens to Windows XP on memory shortage?
> >
> > Who said this would be enabled on Windows?
> >
>
> Windows is just an example (exaggerated one).
Don't use that example then.
> There are just systems were resources are a problem.
Then on those systems you simply have to adjust the appropriate knob.
That's why those knobs are available after all.
Nicolas
^ permalink raw reply
* Re: THREADED_DELTA_SEARCH
From: Alex Riesen @ 2008-07-10 20:29 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Junio C Hamano, Pierre Habouzit, Git ML
In-Reply-To: <alpine.LFD.1.10.0807101625330.12484@xanadu.home>
Nicolas Pitre, Thu, Jul 10, 2008 22:26:03 +0200:
> On Thu, 10 Jul 2008, Alex Riesen wrote:
> >
> > Have you ever seen what happens to Windows XP on memory shortage?
>
> Who said this would be enabled on Windows?
>
Windows is just an example (exaggerated one). There are just systems
were resources are a problem.
^ permalink raw reply
* Re: THREADED_DELTA_SEARCH
From: Nicolas Pitre @ 2008-07-10 20:26 UTC (permalink / raw)
To: Alex Riesen; +Cc: Junio C Hamano, Pierre Habouzit, Git ML
In-Reply-To: <20080710201352.GA3717@blimp.local>
On Thu, 10 Jul 2008, Alex Riesen wrote:
> Nicolas Pitre, Thu, Jul 10, 2008 18:21:09 +0200:
> > On Thu, 10 Jul 2008, Junio C Hamano wrote:
> > > (2) exploding memory use, suspected to be due to malloc pool
> > > fragmentation under multithreading.
> ...
> > > but I do not
> > > recall the latter issue has been addressed.
> >
> > Well, for "standard" repositories such as the Linux kernel, things
> > always worked just fine. And commit eac12e2d is apparently helping a
> > lot with the remaining odd cases. And if someone has problems due to
> > this then a simple 'git config --global pack.threads 1' would restore
> > the non threaded behavior.
>
> Have you ever seen what happens to Windows XP on memory shortage?
Who said this would be enabled on Windows?
Nicolas
^ permalink raw reply
* Re: [JGIT PATCH 2/5] Don't display passwords on the console in fetch/push output
From: Robin Rosenberg @ 2008-07-10 20:17 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Marek Zawirski, git
In-Reply-To: <200807102056.43912.robin.rosenberg@dewire.com>
>From 99c09cf2321f36eb81043aed2fa6834811ee762b Mon Sep 17 00:00:00 2001
From: Robin Rosenberg <robin.rosenberg@dewire.com>
Date: Thu, 10 Jul 2008 22:16:19 +0200
Subject: [PATCH] Avoid password leak from URIIsh
The toString() method is commonly used for dumping information. We
never ever want to use toString when the password is needed. By masking
out the password we avoid unintentional password leaks.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../src/org/spearce/jgit/transport/URIish.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/URIish.java b/org.spearce.jgit/src/org/spearce/jgit/transport/URIish.java
index e022e57..632c8ad 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/URIish.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/URIish.java
@@ -318,7 +318,7 @@ public class URIish {
r.append(getUser());
if (getPass() != null) {
r.append(':');
- r.append(getPass());
+ r.append("PASSWORD");
}
}
--
1.5.6.2.220.g44701
^ permalink raw reply related
* Re: THREADED_DELTA_SEARCH
From: Alex Riesen @ 2008-07-10 20:13 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Junio C Hamano, Pierre Habouzit, Git ML
In-Reply-To: <alpine.LFD.1.10.0807101212000.12484@xanadu.home>
Nicolas Pitre, Thu, Jul 10, 2008 18:21:09 +0200:
> On Thu, 10 Jul 2008, Junio C Hamano wrote:
> > (2) exploding memory use, suspected to be due to malloc pool
> > fragmentation under multithreading.
...
> > but I do not
> > recall the latter issue has been addressed.
>
> Well, for "standard" repositories such as the Linux kernel, things
> always worked just fine. And commit eac12e2d is apparently helping a
> lot with the remaining odd cases. And if someone has problems due to
> this then a simple 'git config --global pack.threads 1' would restore
> the non threaded behavior.
Have you ever seen what happens to Windows XP on memory shortage?
It freezes *hard*. Not a good behaviour for _default_ settings.
And if someone has no problems with memory, then a simple "git config
pack.threads 100" would restore the threaded behaviour for a
repository which supposedly will never grow up.
^ permalink raw reply
* Re: [PATCH] bisect: test merge base if good rev is not an ancestor of bad rev
From: Junio C Hamano @ 2008-07-10 20:13 UTC (permalink / raw)
To: Christian Couder; +Cc: Johannes Schindelin, Michael Haggerty, Jeff King, git
In-Reply-To: <7vd4llpkxq.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> I have not looked at your implementation, but I do not think:
Sheesh. "I *do* think"...
> - The current one is not "fully reliable"; the user needs to know what
> he is doing. You might call it "prone to user errors".
>
> - "Test this merge-base before going forward, please" will add typically
> only one round of check (if you have more merge bases between good and
> bad, you need to test all of them are good to be sure), so it is not
> "slower nor more complex".
and I think it is a reasonable thing to do.
^ permalink raw reply
* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
From: Junio C Hamano @ 2008-07-10 20:03 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Toralf Förster, git
In-Reply-To: <m3d4lledbn.fsf@localhost.localdomain>
Jakub Narebski <jnareb@gmail.com> writes:
> Besides, it would be nice to have some command (git-rev-parse perhaps?)
> which could take ambiguous commit-ish, and list all commit which matches
> it.
Have fun writing it and send in a patch.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox