• Unknown mailing list, search.
  • Unknown mailing list, search.

Re: [PATCH] Reset the graph plotter internals when HEAD has changed.

Previous thread: Re: [PATCH v2] cat-file --batch / --batch-check: do not exit if hashes are missing by Junio C Hamano on Monday, June 9, 2008 - 4:42 pm. (1 message)

Next thread: none
To: <git@...>
Cc: <spearce@...>
Date: Monday, June 9, 2008 - 6:50 pm

-- robin

.../egit/core/op/ConnectProviderOperation.java | 15 ++++++-
org.spearce.egit.ui/icons/toolbar/trackd.png | Bin 0 -> 387 bytes
org.spearce.egit.ui/icons/toolbar/tracke.png | Bin 0 -> 411 bytes
org.spearce.egit.ui/plugin.properties | 2 +-
org.spearce.egit.ui/plugin.xml | 19 +++++----
.../src/org/spearce/egit/ui/UIText.java | 3 +
.../egit/ui/internal/actions/ResetAction.java | 2 +-
.../spearce/egit/ui/internal/actions/Track.java | 40 +++++++++++++++++---
.../internal/decorators/GitResourceDecorator.java | 2 +-
.../egit/ui/internal/history/GitHistoryPage.java | 24 +++++++++---
.../ui/internal/sharing/ExistingOrNewPage.java | 17 ++++++++
.../egit/ui/internal/sharing/SharingWizard.java | 16 +++++++-
.../src/org/spearce/egit/ui/uitext.properties | 1 +
13 files changed, 115 insertions(+), 26 deletions(-)
--

To: Robin Rosenberg <robin.rosenberg.lists@...>
Cc: <git@...>
Date: Monday, June 9, 2008 - 8:31 pm

How did you you send this series? Its not format-patch output.
The diff-stat is missing from each commit, and there's no ---
to split message from diff. I didn't bother trying to run them
through git-am yet as I assume I can just fetch from you, I'm
just saying the patches look "odd".

--
Shawn.
--

To: Shawn O. Pearce <spearce@...>
Cc: <git@...>
Date: Tuesday, June 10, 2008 - 2:29 am

It was git format-patch --binary. Seems that option drops the diffstat
in that case. Yes you can just pull and get the same series. I mostly
sent it as patches for review purposes. It is much easier in e-mail.
Using gtik for reviiew isn't optimal. A nice tool for reviewing and
commenting directly from a repo would be nice.

-- robin
--

To: <git@...>
Cc: Robin Rosenberg <robin.rosenberg@...>, <spearce@...>
Date: Monday, June 9, 2008 - 6:50 pm

From: Robin Rosenberg <robin.rosenberg@dewire.com>

When we reset HEAD to an old revision it becomes more visible than when
we add a new commit. This is an intermediate solution.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>

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 27cda08..278e1e4 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
@@ -162,6 +162,9 @@ public class GitHistoryPage extends HistoryPage {
/** Revision walker that allocated our graph's commit nodes. */
private SWTWalk currentWalk;

+ /** Last HEAD */
+ private AnyObjectId currentHeadId;
+
/**
* Highlight flag that can be applied to commits to make them stand out.
* <p>
@@ -521,8 +524,18 @@ public class GitHistoryPage extends HistoryPage {
if (db == null)
return false;

+ final AnyObjectId headId;
+ try {
+ headId = db.resolve("HEAD");
+ } catch (IOException e) {
+ Activator.logError("Cannot parse HEAD in: "
+ + db.getDirectory().getAbsolutePath(), e);
+ return false;
+ }
+
if (currentWalk == null || currentWalk.getRepository() != db
- || pathChange(pathFilters, paths)) {
+ || pathChange(pathFilters, paths)
+ || headId != null && !headId.equals(currentHeadId)) {
currentWalk = new SWTWalk(db);
currentWalk.sort(RevSort.COMMIT_TIME_DESC, true);
currentWalk.sort(RevSort.BOUNDARY, true);
@@ -531,13 +544,12 @@ public class GitHistoryPage extends HistoryPage {
currentWalk.reset();
}

+ if (headId == null)
+ return false;
try {
- final AnyObjectId headId = db.resolve("HEAD");
- if (headId == null)
- return false;
currentWalk.markStart(currentWalk.parseCommit(headId));
} catch (IOException e) {
- Activator.logError...

To: Robin Rosenberg <robin.rosenberg.lists@...>
Cc: Robin Rosenberg <robin.rosenberg@...>, <git@...>
Date: Monday, June 9, 2008 - 8:40 pm

Tossing the currentWalk just because HEAD changed to a different
commit shouldn't be necessary. Its very heavy-handed. Clearly
there is a bug in the plotter code where the reset does not clear
state right.

For now this is a reasonable work around. I'll try to remember
to come back and debug this case in the future as tossing the
entire SWTWalk does reduce redraw performance.

Thanks for at least coming up with the work-around.

--
Shawn.
--

To: <git@...>
Cc: Robin Rosenberg <robin.rosenberg@...>, <spearce@...>
Date: Monday, June 9, 2008 - 6:50 pm

From: Robin Rosenberg <robin.rosenberg@dewire.com>

In order to share repository, the Git repository must be located
outside the project. This patch extends the scope to the parent
directory.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>

diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/ConnectProviderOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/ConnectProviderOperation.java
index b029de7..3ed3569 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/ConnectProviderOperation.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/ConnectProviderOperation.java
@@ -15,8 +15,10 @@ 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.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.team.core.RepositoryProvider;
import org.spearce.egit.core.Activator;
@@ -57,7 +59,7 @@ public class ConnectProviderOperation implements IWorkspaceRunnable {

m.beginTask(CoreText.ConnectProviderOperation_connecting, 100);
try {
- final Collection repos = new ArrayList();
+ final Collection<RepositoryMapping> repos = new ArrayList<RepositoryMapping>();

if (newGitDir != null) {
try {
@@ -68,8 +70,17 @@ public class ConnectProviderOperation implements IWorkspaceRunnable {

db = new Repository(newGitDir);
db.create();
+ IPath gitDirParent = Path.fromOSString(
+ db.getDirectory().getAbsolutePath())
+ .removeLastSegments(1);
+ IPath cPath = project.getLocation();
+ String subset = null;
+ if (gitDirParent.isPrefixOf(cPath)) {
+ int n = cPath.matchingFirstSegments(gitDirParent);
+ subset = cPath.re...

To: <git@...>
Cc: Robin Rosenberg <robin.rosenberg@...>, <spearce@...>
Date: Monday, June 9, 2008 - 6:50 pm

From: Robin Rosenberg <robin.rosenberg@dewire.com>

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetAction.java
index 2187278..7ca48af 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetAction.java
@@ -24,7 +24,7 @@ import org.spearce.egit.ui.internal.dialogs.BranchSelectionDialog;
import org.spearce.jgit.lib.Repository;

/**
- * An acton to reset the current branch to a specific revision.
+ * An action to reset the current branch to a specific revision.
*
* @see ResetOperation
*/
--
1.5.5.1.178.g1f811

--

To: <git@...>
Cc: Robin Rosenberg <robin.rosenberg@...>, <spearce@...>
Date: Monday, June 9, 2008 - 6:50 pm

From: Robin Rosenberg <robin.rosenberg@dewire.com>

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>

diff --git a/org.spearce.egit.ui/plugin.xml b/org.spearce.egit.ui/plugin.xml
index c71c763..e47d75a 100644
--- a/org.spearce.egit.ui/plugin.xml
+++ b/org.spearce.egit.ui/plugin.xml
@@ -97,14 +97,6 @@
menubarPath="team.main/group1"
tooltip="%CommitAction_tooltip"/>
</objectContribution>
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- id="org.spearce.egit.ui.IFileContributions">
- <filter name="projectPersistentProperty"
- value="org.eclipse.team.core.repository=org.spearce.egit.core.GitProvider">
- </filter>
- </objectContribution>
</extension>

<extension
--
1.5.5.1.178.g1f811

--

To: <git@...>
Cc: Robin Rosenberg <robin.rosenberg@...>, <spearce@...>
Date: Monday, June 9, 2008 - 6:50 pm

From: Robin Rosenberg <robin.rosenberg@dewire.com>

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
index 10e740e..4b6394c 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
@@ -310,7 +310,7 @@ public class GitResourceDecorator extends LabelProvider implements

decoration.addOverlay(UIIcons.OVR_SHARED);

- if (entry.isModified(mapped.getWorkDir())) {
+ if (entry.isModified(mapped.getWorkDir(), true)) {
decoration.addPrefix(">");
decoration.addSuffix("(not updated)");
orState(rsrc.getParent(), CHANGED);
--
1.5.5.1.178.g1f811

--

Previous thread: Re: [PATCH v2] cat-file --batch / --batch-check: do not exit if hashes are missing by Junio C Hamano on Monday, June 9, 2008 - 4:42 pm. (1 message)

Next thread: none