Re: [EGIT PATCH 00/31] Push GUI, GUI improvements, various jgit stuff

Previous thread: git clone operation by Mike Gant on Sunday, August 17, 2008 - 11:44 am. (5 messages)

Next thread: none
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

That's the final series for one of my core tasks for GSoC: GUI related
stuff. Little late, but it required lot of polishing.

Traditionally, it's also available at
http://repo.or.cz/w/egit/zawir.git?a=shortlog;h=refs/heads/push
But wait... this time it was pushed from Eclipse! ;)

The series consists of few parts:
1) Various small fixes and improvements to jgit.
2) Lot of refactor, fixes, improvements in Git Clone Wizard.
3) Push GUI with some general purpose components.
(more in commit messages)

Fetch GUI is not implemented yet, although with this
Eclipse-experience and new stuff available in .components, I suspect
it we'll be *much* much easier to do it than this push GUI, so I may
try to do it as well, especially if you enjoy this one. I'm just
starting working on that.

Changes in plugin were tested on Eclipse 3.4 at Linux, Windows XP and
partially at MacOS 10.4 (there are some issues that makes it looking
worse there, one very annoying bug is reported to Eclipse' bugzilla).
I'm now using mostly Eclipse 3.4, but I've tried to use up to 3.3 API.
Shawn also tried this code at Eclipse 3.3 on OS X 10.5, at least up to
some stage.

Comments regarding this GUI are welcome, I hope that yet another mind
can bring some ideas. Recently (few days ago), Shawn brought some
great idea of making Eclipse view for results of operations on remote
(fetch, push) instead of dialog. That would be cool, although
unfortunatelly it was too late for me to do it - to change project at
this stage.

I've got some problem with icons right now, as I'm pretty far from
stating that I'm good at doing that sort of art.
Robin, Tor, I know that you were already contributing some graphics to
egit. If someone of you would like to do some icon for push/fetch with
pleasure, you are welcome. Otherwise I'll have to do some crappy icon
instead ;) Another matter are checkboxes screenshots. I'm not sure
about legality status of including them. Any ideas if/how we co use
them or some another set that we can for ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

When object doesn't exist, instead of returning null as stated in javadoc
this method was throwing NullPointerException. Now it returns null.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/lib/Repository.java       |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index 7679e53..a8591cc 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -385,6 +385,8 @@ public class Repository {
 	 */
 	public Object mapObject(final ObjectId id, final String refName) throws IOException {
 		final ObjectLoader or = openObject(id);
+		if (or == null)
+			return null;
 		final byte[] raw = or.getBytes();
 		if (or.getType() == Constants.OBJ_TREE)
 			return makeTree(id, raw);
@@ -394,7 +396,8 @@ public class Repository {
 			return makeTag(id, refName, raw);
 		if (or.getType() == Constants.OBJ_BLOB)
 			return raw;
-		return null;
+		throw new IncorrectObjectTypeException(id,
+				"COMMIT nor TREE nor BLOB nor TAG");
 	}
 
 	/**
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

Empty name is obviously invalid - method should return false.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/lib/Repository.java       |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index a8591cc..17cdb40 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -986,6 +986,9 @@ public class Repository {
 	 */
 	public static boolean isValidRefName(final String refName) {
 		final int len = refName.length();
+		if (len == 0)
+			return false;
+		
 		char p = '\0';
 		for (int i=0; i<len; ++i) {
 			char c = refName.charAt(i);
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

resolve() was throwing undocumented runtime exceptions.
ArrayIndexOutOfBoundsException was thrown when it couldn't find commit's
parents and NumberFormatException when it couldn't parse parents number.

Now it returns null when it can't find appropriate commit's parents
and (already checked) RevisionSyntaxException when it can't parse number.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/lib/Repository.java       |   56 ++++++++++++++++----
 1 files changed, 45 insertions(+), 11 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index 17cdb40..756e3b9 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -569,9 +569,22 @@ public class Repository {
 								break;
 						}
 						String parentnum = new String(rev, i+1, j-i-1);
-						int pnum = Integer.parseInt(parentnum);
-						if (pnum != 0)
-							refId = ((Commit)ref).getParentIds()[pnum - 1];
+						int pnum;
+						try {
+							pnum = Integer.parseInt(parentnum);
+						} catch (NumberFormatException e) {
+							throw new RevisionSyntaxException(
+									"Invalid commit parent number",
+									revstr);
+						}
+						if (pnum != 0) {
+							final ObjectId parents[] = ((Commit) ref)
+									.getParentIds();
+							if (pnum > parents.length)
+								refId = null;
+							else
+								refId = parents[pnum - 1];
+						}
 						i = j - 1;
 						break;
 					case '{':
@@ -632,17 +645,27 @@ public class Repository {
 						break;
 					default:
 						ref = mapObject(refId, null);
-						if (ref instanceof Commit)
-							refId = ((Commit)ref).getParentIds()[0];
-						else
+						if (ref instanceof Commit) {
+							final ObjectId parents[] = ((Commit) ref)
+									.getParentIds();
+							if (parents.length == 0)
+								refId = null;
+							else
+								refId = ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

RemoteConfig may have empty URIs list.
It would be nicer to throw documented exception than
ArrayIndexOutOfBoundsException in this case.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/transport/Transport.java  |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
index 5bec4d2..30175e3 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
@@ -103,9 +103,16 @@ public abstract class Transport {
 	 * @return the new transport instance. Never null.
 	 * @throws NotSupportedException
 	 *             the protocol specified is not supported.
+	 * @throws IllegalArgumentException
+	 *             if provided remote configuration doesn't have any URI
+	 *             associated.
 	 */
 	public static Transport open(final Repository local, final RemoteConfig cfg)
 			throws NotSupportedException {
+		if (cfg.getURIs().isEmpty())
+			throw new IllegalArgumentException(
+					"Remote config \""
+					+ cfg.getName() + "\" has no URIs associated");
 		final Transport tn = open(local, cfg.getURIs().get(0));
 		tn.setOptionUploadPack(cfg.getUploadPack());
 		tn.fetch = cfg.getFetchRefSpecs();
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

We can give expandSource() a wildcard as argument, so it will produce
new wildcard spec, which is still correct.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/transport/RefSpec.java    |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/RefSpec.java b/org.spearce.jgit/src/org/spearce/jgit/transport/RefSpec.java
index 25d5977..e489233 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/RefSpec.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/RefSpec.java
@@ -331,8 +331,11 @@ public class RefSpec {
 	 * otherwise expansion results may be unpredictable.
 	 *
 	 * @param r
-	 *            a ref name that matched our source specification.
-	 * @return a new specification that is not a wildcard.
+	 *            a ref name that matched our source specification. Could be a
+	 *            wildcard also.
+	 * @return a new specification expanded from provided ref name. Result
+	 *         specification is wildcard if and only if provided ref name is
+	 *         wildcard.
 	 */
 	public RefSpec expandFromSource(final String r) {
 		return isWildcard() ? new RefSpec(this, r) : this;
@@ -345,8 +348,11 @@ public class RefSpec {
 	 * otherwise expansion results may be unpredictable.
 	 * 
 	 * @param r
-	 *            a ref that matched our source specification.
-	 * @return a new specification that is not a wildcard.
+	 *            a ref that matched our source specification. Could be a
+	 *            wildcard also.
+	 * @return a new specification expanded from provided ref name. Result
+	 *         specification is wildcard if and only if provided ref name is
+	 *         wildcard.
 	 */
 	public RefSpec expandFromSource(final Ref r) {
 		return isWildcard() ? new RefSpec(this, r.getName()) : this;
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

This constant and method can/should be reused in GUI.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/transport/RefSpec.java    |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/RefSpec.java b/org.spearce.jgit/src/org/spearce/jgit/transport/RefSpec.java
index e489233..9ec5847 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/RefSpec.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/RefSpec.java
@@ -47,9 +47,20 @@ import org.spearce.jgit.lib.Ref;
  * reference in one repository to another reference in another repository.
  */
 public class RefSpec {
-	private static final String WILDCARD_SUFFIX = "/*";
+	/**
+	 * Suffix for wildcard ref spec component, that indicate matching all refs
+	 * with specified prefix.
+	 */
+	public static final String WILDCARD_SUFFIX = "/*";
 
-	private static boolean isWildcard(final String s) {
+	/**
+	 * Check whether provided string is a wildcard ref spec component.
+	 * 
+	 * @param s
+	 *            ref spec component - string to test. Can be null.
+	 * @return true if provided string is a wildcard ref spec component.
+	 */
+	public static boolean isWildcard(final String s) {
 		return s != null && s.endsWith(WILDCARD_SUFFIX);
 	}
 
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

openAll() method honours many URIs in remote configuration when opening
transports. Old open() calls remained, they still open only 1 transport
at time.

openAll() is used during push operation - pgm.Push implementation was
fixed to use it.

applyConfig() is used internally here, but could be interesting for
clients and it's safe to call it.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/pgm/Push.java             |   44 ++++++-----
 .../src/org/spearce/jgit/transport/Transport.java  |   83 ++++++++++++++++++--
 2 files changed, 99 insertions(+), 28 deletions(-)

diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
index 6b35ab8..a952309 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
@@ -86,7 +86,7 @@ class Push extends TextBuiltin {
 	@Option(name = "--receive-pack", metaVar = "path")
 	private String receivePack;
 
-	private boolean first = true;
+	private boolean shownURI;
 
 	@Override
 	protected void run() throws Exception {
@@ -97,27 +97,31 @@ class Push extends TextBuiltin {
 				refSpecs.add(spec.setForceUpdate(true));
 		}
 
-		final Transport transport = Transport.open(db, remote);
-		transport.setPushThin(thin);
-		if (receivePack != null)
-			transport.setOptionReceivePack(receivePack);
-		final Collection<RemoteRefUpdate> toPush = transport
-				.findRemoteRefUpdatesFor(refSpecs);
+		final List<Transport> transports = Transport.openAll(db, remote);
+		for (final Transport transport : transports) {
+			transport.setPushThin(thin);
+			if (receivePack != null)
+				transport.setOptionReceivePack(receivePack);
 
-		final PushResult result = transport.push(new TextProgressMonitor(),
-				toPush);
-		transport.close();
+			final Collection<RemoteRefUpdate> toPush = transport
+					.findRemoteRefUpdatesFor(refSpecs);
 
-		printPushResult(result);
+			final ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

Implementation of C Git --dry-run behavior for push operation.
It allows investigating possible push result, while not performing real
push operation - not updating remote refs.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/pgm/Push.java             |    4 ++
 .../org/spearce/jgit/transport/PushProcess.java    |   18 +++++++-
 .../src/org/spearce/jgit/transport/Transport.java  |   40 ++++++++++++++++++--
 3 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
index a952309..f5b24c6 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
@@ -85,6 +85,9 @@ class Push extends TextBuiltin {
 
 	@Option(name = "--receive-pack", metaVar = "path")
 	private String receivePack;
+	
+	@Option(name = "--dry-run")
+	private boolean dryRun = Transport.DEFAULT_DRY_RUN;
 
 	private boolean shownURI;
 
@@ -102,6 +105,7 @@ class Push extends TextBuiltin {
 			transport.setPushThin(thin);
 			if (receivePack != null)
 				transport.setOptionReceivePack(receivePack);
+			transport.setDryRun(dryRun);
 
 			final Collection<RemoteRefUpdate> toPush = transport
 					.findRemoteRefUpdatesFor(refSpecs);
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/PushProcess.java b/org.spearce.jgit/src/org/spearce/jgit/transport/PushProcess.java
index 6a2176f..cafec05 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/PushProcess.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/PushProcess.java
@@ -100,7 +100,10 @@ class PushProcess {
 	/**
 	 * Perform push operation between local and remote repository - set remote
 	 * refs appropriately, send needed objects and update local tracking refs.
-	 *
+	 * <p>
+	 * When {@link Transport#isDryRun()} is true, result of this operation is
+	 * just estimation of real operation result, no real ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

This method could be used outside of specific URI scope, so let it be
static. Otherwise, if someone want to generate remote ref updates from
refspecs he/she may have to create some dummy transport just for that.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/transport/Transport.java  |  147 ++++++++++++--------
 1 files changed, 90 insertions(+), 57 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
index 98853e6..e986e48 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
@@ -211,7 +211,92 @@ public abstract class Transport {
 
 		throw new NotSupportedException("URI not supported: " + remote);
 	}
+	
+	/**
+	 * Convert push remote refs update specification from {@link RefSpec} form
+	 * to {@link RemoteRefUpdate}. Conversion expands wildcards by matching
+	 * source part to local refs. expectedOldObjectId in RemoteRefUpdate is
+	 * always set as null. Tracking branch is configured if RefSpec destination
+	 * matches source of any fetch ref spec for this transport remote
+	 * configuration.
+	 * 
+	 * @param db
+	 *            local database.
+	 * @param specs
+	 *            collection of RefSpec to convert.
+	 * @param fetchSpecs
+	 *            fetch specifications used for finding localtracking refs. May
+	 *            be null or empty collection.
+	 * @return collection of set up {@link RemoteRefUpdate}.
+	 * @throws TransportException
+	 *             when problem occurred during conversion or specification set
+	 *             up: most probably, missing objects or refs.
+	 */
+	public static Collection<RemoteRefUpdate> findRemoteRefUpdatesFor(
+			final Repository db, final Collection<RefSpec> specs,
+			Collection<RefSpec> fetchSpecs) throws TransportException {
+		if (fetchSpecs == null)
+			fetchSpecs = ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

Let's state explicitly that remote ref updates are modified during this
call.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/transport/Transport.java  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
index e986e48..8e42516 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
@@ -627,7 +627,7 @@ public abstract class Transport {
 	 *            collection to use the specifications from the RemoteConfig
 	 *            converted by {@link #findRemoteRefUpdatesFor(Collection)}. No
 	 *            more than 1 RemoteRefUpdate with the same remoteName is
-	 *            allowed.
+	 *            allowed. These objects are modified during this call.
 	 * @return information about results of remote refs updates, tracking refs
 	 *         updates and refs advertised by remote repository.
 	 * @throws NotSupportedException
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

IllegalArgumentException was probably a wrong choice for exception
thrown in RemoteRefUpdate when src object can't be resolved - it should
be checked one.

Now it's IOException, which makes call more safe for external clients.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../spearce/jgit/transport/RemoteRefUpdate.java    |   12 +++---
 .../src/org/spearce/jgit/transport/Transport.java  |   48 +++++++++----------
 2 files changed, 29 insertions(+), 31 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
index 7db6c55..5afb8a4 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
@@ -166,23 +166,23 @@ public class RemoteRefUpdate {
 	 *            remote ref with this name.
 	 * @throws IOException
 	 *             when I/O error occurred during creating
-	 *             {@link TrackingRefUpdate} for local tracking branch.
+	 *             {@link TrackingRefUpdate} for local tracking branch or srcRef
+	 *             can't be resolved to any object.
 	 * @throws IllegalArgumentException
-	 *             if some required parameter was null or srcRef can't be
-	 *             resolved to any object.
+	 *             if some required parameter was null
 	 */
 	public RemoteRefUpdate(final Repository db, final String srcRef,
 			final String remoteName, final boolean forceUpdate,
 			final String localName, final ObjectId expectedOldObjectId)
 			throws IOException {
 		if (remoteName == null)
-			throw new IllegalArgumentException("remote name can't be null");
+			throw new IllegalArgumentException("Remote name can't be null.");
 		this.srcRef = srcRef;
 		this.newObjectId = (srcRef == null ? ObjectId.zeroId() : db
 				.resolve(srcRef));
 		if (newObjectId == null)
-			throw new IllegalArgumentException(
-					"source ref doesn't resolve to ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

New constructor base on existing RemoteRefUpdate instance, providing
deep copy of object, but allowing change of expectedOldObjectId.

It may be useful for copying ref updates during one-to-many push or
2-stage push, with first 1st step being dry run, 2nd being actual push.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../spearce/jgit/transport/RemoteRefUpdate.java    |   28 +++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
index 5afb8a4..42588c1 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
@@ -123,7 +123,7 @@ public class RemoteRefUpdate {
 
 	private final TrackingRefUpdate trackingRefUpdate;
 
-	private String srcRef;
+	private final String srcRef;
 
 	private final boolean forceUpdate;
 
@@ -133,6 +133,8 @@ public class RemoteRefUpdate {
 
 	private String message;
 
+	private final Repository db;
+
 	/**
 	 * Construct remote ref update request by providing an update specification.
 	 * Object is created with default {@link Status#NOT_ATTEMPTED} status and no
@@ -190,11 +192,35 @@ public class RemoteRefUpdate {
 					remoteName, forceUpdate, newObjectId, "push");
 		else
 			trackingRefUpdate = null;
+		this.db = db;
 		this.expectedOldObjectId = expectedOldObjectId;
 		this.status = Status.NOT_ATTEMPTED;
 	}
 
 	/**
+	 * Create a new instance of this object basing on existing instance for
+	 * configuration. State (like {@link #getMessage()}, {@link #getStatus()})
+	 * of base object is not shared. Expected old object id is set up from
+	 * scratch, as this constructor may be used for 2-stage push: first one
+	 * being dry run, second one being actual push.
+	 * 
+	 * @param base
+	 *            configuration base.
+	 * @param newExpectedOldObjectId
+	 ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

Introduce the method allowing us to parse all configured remotes.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/lib/RepositoryConfig.java |   21 ++++++++++++++++
 .../org/spearce/jgit/transport/RemoteConfig.java   |   26 ++++++++++++++++++++
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
index 048940d..397c294 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
@@ -53,9 +53,11 @@ import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.spearce.jgit.util.FS;
 
@@ -277,6 +279,25 @@ public class RepositoryConfig {
 			return baseConfig.getStringList(section, subsection, name);
 		return new String[0];
 	}
+	
+	/**
+	 * @param section
+	 *            section to search for.
+	 * @return set of all subsections of specified section within this
+	 *         configuration and its base configuration; may be empty if no
+	 *         subsection exists.
+	 */
+	public Set<String> getSubsections(final String section) {
+		final Set<String> result = new HashSet<String>();
+
+		for (final Entry e : entries) {
+			if (section.equals(e.base) && e.extendedBase != null)
+				result.add(e.extendedBase);
+		}
+		if (baseConfig != null)
+			result.addAll(baseConfig.getSubsections(section));
+		return result;
+	}
 
 	private String getRawString(final String section, final String subsection,
 			final String name) {
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteConfig.java b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteConfig.java
index bb21511..cde5d43 100644
--- ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

These methods allows us overriding whole collections of specifications,
saving unnecessary external code.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../org/spearce/jgit/transport/RemoteConfig.java   |   24 ++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteConfig.java b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteConfig.java
index cde5d43..5b5e4d1 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteConfig.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteConfig.java
@@ -267,6 +267,30 @@ public class RemoteConfig {
 	}
 
 	/**
+	 * Override existing fetch specifications with new ones.
+	 * 
+	 * @param specs
+	 *            list of fetch specifications to set. List is copied, it can be
+	 *            modified after this call.
+	 */
+	public void setFetchRefSpecs(final List<RefSpec> specs) {
+		fetch.clear();
+		fetch.addAll(specs);
+	}
+
+	/**
+	 * Override existing push specifications with new ones.
+	 * 
+	 * @param specs
+	 *            list of push specifications to set. List is copied, it can be
+	 *            modified after this call.
+	 */
+	public void setPushRefSpecs(final List<RefSpec> specs) {
+		push.clear();
+		push.addAll(specs);
+	}
+
+	/**
 	 * Remove a fetch RefSpec from this remote.
 	 * 
 	 * @param s
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

It's common usage to search for short, but unique abbreviation of
object's SHA-1, so let's have a method for that.

This is a really workaround implementation, but it has been already used
in other places. Let's have other usages pointing here, so we can easily
change only this implementation later.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/pgm/Fetch.java            |   10 +++++-----
 .../src/org/spearce/jgit/pgm/Push.java             |    7 +++----
 .../src/org/spearce/jgit/pgm/TextBuiltin.java      |    4 ----
 .../src/org/spearce/jgit/lib/AnyObjectId.java      |   15 +++++++++++++++
 4 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java
index 4eff32b..99ed101 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java
@@ -93,7 +93,7 @@ class Fetch extends TextBuiltin {
 		}
 	}
 
-	private static String longTypeOf(final TrackingRefUpdate u) {
+	private String longTypeOf(final TrackingRefUpdate u) {
 		final RefUpdate.Result r = u.getResult();
 		if (r == RefUpdate.Result.LOCK_FAILURE)
 			return "[lock fail]";
@@ -110,14 +110,14 @@ class Fetch extends TextBuiltin {
 		}
 
 		if (r == RefUpdate.Result.FORCED) {
-			final String aOld = abbreviateObject(u.getOldObjectId());
-			final String aNew = abbreviateObject(u.getNewObjectId());
+			final String aOld = u.getOldObjectId().abbreviate(db);
+			final String aNew = u.getNewObjectId().abbreviate(db);
 			return aOld + "..." + aNew;
 		}
 
 		if (r == RefUpdate.Result.FAST_FORWARD) {
-			final String aOld = abbreviateObject(u.getOldObjectId());
-			final String aNew = abbreviateObject(u.getNewObjectId());
+			final String aOld = u.getOldObjectId().abbreviate(db);
+			final String aNew = u.getNewObjectId().abbreviate(db);
 			return aOld + ".." + aNew;
 		}
 
diff --git ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

Typical Eclipse users (read: me) usually doesn't like unnecessary
output on Eclipse stdout.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/lib/GitIndex.java         |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java b/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java
index c7a4402..2255c1a 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java
@@ -190,7 +190,6 @@ public class GitIndex {
 	 * @throws IOException
 	 */
 	public void read() throws IOException {
-		long t0 = System.currentTimeMillis();
 		changed = false;
 		statDirty = false;
 		if (!cacheFile.exists()) {
@@ -214,9 +213,7 @@ public class GitIndex {
 				Entry entry = new Entry(buffer);
 				entries.put(entry.name, entry);
 			}
-			long t1 = System.currentTimeMillis();
 			lastCacheTime = cacheFile.lastModified();
-			System.out.println("Read index "+cacheFile+" in "+((t1-t0)/1000.0)+"s");
 		} finally {
 			cache.close();
 		}
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/egit/ui/uitext.properties      |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties
index 9516aa0..55b1348 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties
@@ -16,7 +16,7 @@
 ##
 
 SharingWizard_windowTitle=Configure Git Repository
-SharingWizard_failed=Failed to initalize Git team provider.
+SharingWizard_failed=Failed to initialize Git team provider.
 
 GenericOperationFailed={0} Failed
 
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:43 pm

CloneSourcePage is refactored to serve as generic wizard page for
repository selection. Selection can be performed now as custom URI or
(optionally - configurable) from preconfigured remote repositories. That
allows us to this wizard page for selection of both source and destination
repository in wizards.

As there was need for code rewrite in few places, some things get fixed or
improved by the way:
- Controls are disabled/enabled recursively, so user get better feedback
  what he/she can type.
- URI panel behaved strange when bad URI was typed, now it's probably more
  obvious what's going on.
- Distinction is introduced between internal URI/RemoteConfig selection
  (possibly invalid) and exposed one - for other pages. Hence, clients of
  this class don't have to handle internal validation issues.
- isPageComplete() logic is moved to checkPage(), as it seems to be
  strange (and hard to follow?) pattern to mix setPageComplete() and
  custom isPageComplete().
- possibly minor forgotten issues.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/egit/ui/UIText.java            |   47 +-
 .../ui/internal/clone/CloneDestinationPage.java    |   24 +-
 .../egit/ui/internal/clone/CloneSourcePage.java    |  460 -------------
 .../egit/ui/internal/clone/GitCloneWizard.java     |   13 +-
 .../egit/ui/internal/clone/SourceBranchPage.java   |   37 +-
 .../ui/internal/clone/URIishChangeListener.java    |   20 -
 .../components/RepositorySelectionListener.java    |   32 +
 .../components/RepositorySelectionPage.java        |  680 ++++++++++++++++++++
 .../src/org/spearce/egit/ui/uitext.properties      |   37 +-
 9 files changed, 798 insertions(+), 552 deletions(-)
 delete mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneSourcePage.java
 delete mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/URIishChangeListener.java
 create mode 100644 ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

At some stage, it was hard to change or improve anything in Clone wizard
or reuse some of its components without some global refactor or clean-up.

This changeset introduces some common patterns of handling internal pages
validation and inter-pages dependencies, it tries to address existing
issues (complicated internal dependencies, redundant asymmetrical code)
with clone code that IMHO were making it hard to maintain or modify.

Some of these changes introduce new behavior (fixes or improvements),
as it was hard for me to separate this in my iterative process...

- Remove mess of using both setPageComplete() and custom isPageComplete().
  Now, checkPage() is used (calling setPageComplete()) instead - for
  internal validation, while direct setPageComplete() calls are used in
  special situations like handling inter-pages dependencies.
- RepositorySelection class introduces encapsulated result of
  RepositorySelectionPage with helper methods working on that result.
- SelectionChangeListener became new common interface for notifying other
  (dependent) pages about selection changes in current page.
  BaseWizardPage is helper abstract class handling these listeners.
- User can move backward in wizard, change something, revert this change,
  then subsequent pages doesn't set page complete to false. It's now
  supported in common way in whole wizard by *selectionEquals() methods.
- Real-time checking for some fields of destination page is introduced.
- Minor changes like renames or some simplifications, forgotten changes.

Some of this commit resulting components, may be reused in other places,
that's why they are actually in .components package.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../ui/internal/clone/CloneDestinationPage.java    |  115 ++++++-----
 .../egit/ui/internal/clone/GitCloneWizard.java     |    3 +-
 .../egit/ui/internal/clone/SourceBranchPage.java   |  212 ++++++++++----------
 .../ui/internal/components/BaseWizardPage.java     |   58 ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

Clone logic was unnaturally splitted between GitCloneWizard and
CloneOperation classes. Now, repository initialization part is moved
to CloneOperation, so there is cleaner separation of responsibilties.

Failure handling is also improved, incompletely cloned repository
directory is removed before reporting problem to user.

Directory creation is problematic issue because of potential errors,
so it's keeped in GitCloneWizard.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../org/spearce/egit/core/op/CloneOperation.java   |  129 +++++++++++++++++---
 .../src/org/spearce/egit/ui/UIText.java            |    4 +
 .../egit/ui/internal/clone/GitCloneWizard.java     |   78 +++----------
 .../src/org/spearce/egit/ui/uitext.properties      |    1 +
 4 files changed, 130 insertions(+), 82 deletions(-)

diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java
index 656f3cb..531045b 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java
@@ -3,6 +3,7 @@
  * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
  * Copyright (C) 2008, Roger C. Soares <rogersoares@intelinet.com.br>
  * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
+ * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
  *
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -10,8 +11,11 @@
  *******************************************************************************/
 package org.spearce.egit.core.op;
 
+import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
+import java.net.URISyntaxException;
+import java.util.Collection;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

This method provide user with live-feedback when chosen subdirectory
can't be created for sure.

This is only a heuristic (may produce false-positive errors), as it is
problematic to handle File#canWrite() noisy return values for Windows'
Java.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../ui/internal/clone/CloneDestinationPage.java    |   23 ++++++++++++++++++-
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
index 01bf54a..e1e9858 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
@@ -220,9 +220,17 @@ class CloneDestinationPage extends WizardPage {
 			setPageComplete(false);
 			return;
 		}
-		if (new File(dstpath).exists()) {
+		final File dstFile = new File(dstpath);
+		if (dstFile.exists()) {
 			setErrorMessage(NLS.bind(UIText.CloneDestinationPage_errorExists,
-					new File(dstpath).getName()));
+					dstFile.getName()));
+			setPageComplete(false);
+			return;
+		}
+		final File absoluteFile = dstFile.getAbsoluteFile();
+		if (!canCreateSubdir(absoluteFile.getParentFile())) {
+			setErrorMessage(NLS.bind(UIText.GitCloneWizard_errorCannotCreate,
+					dstFile.getPath()));
 			setPageComplete(false);
 			return;
 		}
@@ -243,6 +251,17 @@ class CloneDestinationPage extends WizardPage {
 		setPageComplete(true);
 	}
 
+	// this is actually just an optimistic heuristic - should be named
+	// isThereHopeThatCanCreateSubdir() as probably there is no 100% reliable
+	// way to check that in Java for Windows
+	private static boolean canCreateSubdir(final File parent) {
+		if (parent == null)
+			return true;
+		if (parent.exists())
+			return parent.isDirectory() && parent.canWrite();
+		return ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

Previous selection scheme was probably not correct, or at least not
portable. It hasn't worked on GTK+ SWT implementation.

New code still doesn't work on GTK+ SWT in Eclipse 3.3, but it works in
Eclipse 3.4. FileDialog for GTK+ in 3.3 was probably buggy. I've created
a bug at eclipse.org bugzilla for that (241824), but it won't be fixed
for 3.3.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../ui/internal/clone/CloneDestinationPage.java    |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
index e1e9858..a445cf5 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
@@ -128,9 +128,10 @@ class CloneDestinationPage extends WizardPage {
 
 				d = new FileDialog(getShell(), SWT.APPLICATION_MODAL | SWT.SAVE);
 				if (directoryText.getText().length() > 0) {
-					final File f = new File(directoryText.getText());
-					d.setFilterPath(f.getAbsoluteFile().getAbsolutePath());
-					d.setFileName(f.getName());
+					final File file = new File(directoryText.getText())
+							.getAbsoluteFile();
+					d.setFilterPath(file.getParent());
+					d.setFileName(file.getName());
 				}
 				final String r = d.open();
 				if (r != null)
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

Previous behavior was to not allow selecting empty directory. While
it seems to be sensible to use empty dir as destination and it's just
a little bit more complex, this feature is added.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/egit/ui/UIText.java            |    2 +-
 .../ui/internal/clone/CloneDestinationPage.java    |   20 ++++++++++++++------
 .../egit/ui/internal/clone/GitCloneWizard.java     |    3 ++-
 .../src/org/spearce/egit/ui/uitext.properties      |    2 +-
 4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
index 9150832..189b769 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
@@ -170,7 +170,7 @@ public class UIText extends NLS {
 	public static String CloneDestinationPage_browseButton;
 
 	/** */
-	public static String CloneDestinationPage_errorExists;
+	public static String CloneDestinationPage_errorNotEmptyDir;
 
 	/** */
 	public static String Decorator_failedLazyLoading;
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
index a445cf5..97f166a 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
@@ -221,17 +221,17 @@ class CloneDestinationPage extends WizardPage {
 			setPageComplete(false);
 			return;
 		}
-		final File dstFile = new File(dstpath);
-		if (dstFile.exists()) {
-			setErrorMessage(NLS.bind(UIText.CloneDestinationPage_errorExists,
-					dstFile.getName()));
+		final File absoluteFile = new File(dstpath).getAbsoluteFile();
+		if (!isEmptyDir(absoluteFile)) ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

When user moves backward in wizard from destination page to source
branch selection, then moves forward, we shouldn't overwrite his/her
directory selection in destination page.
Let's do it only when repository selection changes.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../ui/internal/clone/CloneDestinationPage.java    |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
index 97f166a..508781d 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
@@ -278,15 +278,19 @@ class CloneDestinationPage extends WizardPage {
 			checkPage();
 			return;
 		}
-		validatedRepoSelection = sourcePage.getSelection();
+		
+		if (!sourcePage.selectionEquals(validatedRepoSelection)) {
+			validatedRepoSelection = sourcePage.getSelection();
+			// update repo-related selection only if it changed
+			final String n = getSuggestedName();
+			setDescription(NLS.bind(UIText.CloneDestinationPage_description, n));
+			directoryText.setText(new File(ResourcesPlugin.getWorkspace()
+					.getRoot().getRawLocation().toFile(), n).getAbsolutePath());
+		}
+		
 		validatedSelectedBranches = branchPage.getSelectedBranches();
 		validatedHEAD = branchPage.getHEAD();
 
-		final String n = getSuggestedName();
-		setDescription(NLS.bind(UIText.CloneDestinationPage_description, n));
-		directoryText.setText(new File(ResourcesPlugin.getWorkspace().getRoot()
-				.getRawLocation().toFile(), n).getAbsolutePath());
-
 		initialBranch.removeAll();
 		final Ref head = branchPage.getHEAD();
 		int newix = 0;
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

This code is a common task, so it's now bundled in this operation
with simple progress monitor information.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/egit/core/CoreText.java        |    3 +
 .../src/org/spearce/egit/core/coretext.properties  |    2 +
 .../spearce/egit/core/op/ListRemoteOperation.java  |  104 ++++++++++++++++++++
 3 files changed, 109 insertions(+), 0 deletions(-)
 create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/op/ListRemoteOperation.java

diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java b/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java
index 8fbda4a..5974a5f 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java
@@ -95,6 +95,9 @@ public class CoreText extends NLS {
 	/** */
 	public static String CloneOperation_title;
 
+	/** */
+	public static String ListRemoteOperation_title;
+
 	static {
 		final Class c = CoreText.class;
 		initializeMessages(c.getPackage().getName() + ".coretext", c);
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/coretext.properties b/org.spearce.egit.core/src/org/spearce/egit/core/coretext.properties
index 3b3c229..c412161 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/coretext.properties
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/coretext.properties
@@ -55,3 +55,5 @@ CheckpointJob_writingTrees=modified trees
 CheckpointJob_failed=Failed to write modified objects.
 
 CloneOperation_title=Cloning from {0}
+
+ListRemoteOperation_title=Getting remote branches information
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/ListRemoteOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/ListRemoteOperation.java
new file mode 100644
index 0000000..d3f777a
--- /dev/null
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/ListRemoteOperation.java
@@ -0,0 +1,104 ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

-Show page description and progress monitor so user get some feedback
what's happening when we're listing remote refs (which may take some
time... sometimes).
-Don't display error during connection to remote repo.
-Set page error before showing error dialog (avoid flashing over Our
Dear User eyers).
-Enable/disable select all and unselect all buttons in response to
current selections.
-Use ListRemoteOperation instead of our own anonymous class. This
introduces some progress information. It also remove unnecessary
(wrong?) code for cancellation handling and always close Transport (even
if fetch is not supported by Transport).

Perhaps-making-too-big-commit...

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/egit/ui/UIText.java            |    9 +-
 .../egit/ui/internal/clone/GitCloneWizard.java     |    1 +
 .../egit/ui/internal/clone/SourceBranchPage.java   |  134 +++++++++-----------
 .../src/org/spearce/egit/ui/uitext.properties      |    3 +-
 4 files changed, 67 insertions(+), 80 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
index 189b769..9b290f3 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
@@ -119,6 +119,9 @@ public class UIText extends NLS {
 	public static String SourceBranchPage_title;
 
 	/** */
+	public static String SourceBranchPage_description;
+
+	/** */
 	public static String SourceBranchPage_branchList;
 
 	/** */
@@ -134,15 +137,15 @@ public class UIText extends NLS {
 	public static String SourceBranchPage_transportError;
 
 	/** */
-	public static String SourceBranchPage_interrupted;
-
-	/** */
 	public static String SourceBranchPage_cannotListBranches;
 
 	/** */
 	public static String SourceBranchPage_remoteListingCancelled;
 
 	/** */
+	public static String SourceBranchPage_cannotCreateTemp;
+
+	/** */
 	public static String ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

These are icons describing common taks, borrowed from official Eclipse
icons set. Some of them can be accessed through Eclipse 3.4 API, but we
still should try to be compatible with 3.3 version.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 org.spearce.egit.ui/icons/elcl16/add.gif           |  Bin 0 -> 318 bytes
 org.spearce.egit.ui/icons/elcl16/clear.gif         |  Bin 0 -> 595 bytes
 org.spearce.egit.ui/icons/elcl16/delete.gif        |  Bin 0 -> 351 bytes
 org.spearce.egit.ui/icons/elcl16/trash.gif         |  Bin 0 -> 590 bytes
 .../src/org/spearce/egit/ui/UIIcons.java           |   12 ++++++++++++
 5 files changed, 12 insertions(+), 0 deletions(-)
 create mode 100644 org.spearce.egit.ui/icons/elcl16/add.gif
 create mode 100644 org.spearce.egit.ui/icons/elcl16/clear.gif
 create mode 100644 org.spearce.egit.ui/icons/elcl16/delete.gif
 create mode 100644 org.spearce.egit.ui/icons/elcl16/trash.gif

diff --git a/org.spearce.egit.ui/icons/elcl16/add.gif b/org.spearce.egit.ui/icons/elcl16/add.gif
new file mode 100644
index 0000000000000000000000000000000000000000..252d7ebcb8c74d6e5de66ef0eb8856622a0e9d89
GIT binary patch
literal 318
zcmZ?wbhEHb6krfwxXQp_S{7na6>d=(Ze15;Qy1mX8t2lT<l2+$3M9LeU3-$eCZ~H%
z&hVd=6EG_$WMN_G!orY+1rf_jLl+gstf`FOP#wFbvUf{x@0O5hJ42`K3|nv@V&Q>^
zHOHgY9FJamJZkN+sI|wVk6ueSb}ixP)r4bLfn?%^+sU^crQUj&`rv8W|Ns9PC;*B-
zSr{1@v>9|jW`O*}z!rUAYJrE2RKG`JYNRKhwpQrnor{(Ph`sVEnyR2Kc;c~(o$WdP
zMb0Wl6K^dQ-0hgs;<SKI<H^q-;x25QTwKyJ($ZWU?Cc(_l2WWuEE3|(QH)cWq8R2f
LL@ik0$Y2cszSC!^

literal 0
HcmV?d00001

diff --git a/org.spearce.egit.ui/icons/elcl16/clear.gif b/org.spearce.egit.ui/icons/elcl16/clear.gif
new file mode 100644
index 0000000000000000000000000000000000000000..af30a42f83d2f91801206463e1f4601a747dd38e
GIT binary patch
literal ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

Screenshots of checkboxes in various states, made at QT with Plastik
style. These images may be used as workaround in cases when we can
only display images and handle buttons pressed, but can't display Button
directly.

I'm somewhat uncertain about license issues regarding these images.
Recently, I realized that they are LGPL licensed perhaps. Is it possible
to license that small stuff? If so, we may have to replace them by some
other images or create ours.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../icons/checkboxes/disabled_checked.gif          |  Bin 0 -> 166 bytes
 .../icons/checkboxes/disabled_unchecked.gif        |  Bin 0 -> 125 bytes
 .../icons/checkboxes/enabled_checked.gif           |  Bin 0 -> 166 bytes
 .../icons/checkboxes/enabled_unchecked.gif         |  Bin 0 -> 157 bytes
 .../src/org/spearce/egit/ui/UIIcons.java           |   13 +++++++++++++
 5 files changed, 13 insertions(+), 0 deletions(-)
 create mode 100644 org.spearce.egit.ui/icons/checkboxes/disabled_checked.gif
 create mode 100644 org.spearce.egit.ui/icons/checkboxes/disabled_unchecked.gif
 create mode 100644 org.spearce.egit.ui/icons/checkboxes/enabled_checked.gif
 create mode 100644 org.spearce.egit.ui/icons/checkboxes/enabled_unchecked.gif

diff --git a/org.spearce.egit.ui/icons/checkboxes/disabled_checked.gif b/org.spearce.egit.ui/icons/checkboxes/disabled_checked.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6b86dc94de2bb83490c2f506fa76855e11b7b838
GIT binary patch
literal 166
zcmZ?wbhEHb<YnMxc+A1DcHP=z$B&&meeT@(bI+eYfB*VD5Pbjq{XY(%_)pNeC^fMp
zHASI3vm`^o-P1RKLGdRGBNqb)gAM}_fDC3}u?uMM)SjUJy7rmmfrOp~FBly&8ZsYl
wRFv9vVB@Kk9=FTwF10b`7-=vhDkuen`7m)zj=mVtWXE}9&9|hNTuKbq0JEx6@Bjb+

literal 0
HcmV?d00001

diff --git a/org.spearce.egit.ui/icons/checkboxes/disabled_unchecked.gif b/org.spearce.egit.ui/icons/checkboxes/disabled_unchecked.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4b20c7eddc78f300565f520e2661abcc4c081122
GIT ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

RefSpecPanel provides universal GUI (Control) for editing list of RefSpec
specifications for both push or fetch, depending on panel configuration.

It is intended to allow user easily edit specifications, supporting user
with rich content assistant and giving feedback with error information as
soon as possible. Component uses editable specifications table and panels
for easy creation of new specifications basing on typical push/fetch
schemes (like branch update, deletion, all branches update, saved
configuration etc.).

Possibly there are still some places when this panel usability could be
improved by some UI-engineer. I hope it shouldn't be very hard and panel
core and API should resist such changes. Keyboard handling could be
improved perhaps, some bugs are still open for MacOS, with one critical
reported to bugzilla.

RefSpecPage class is fetch/push WizardPage using RefSpecPanel extensively.

Beside of RefSpecPanel class this commit introduces some components needed
to build this one. As these components as potentially reusable, they are
put in components package and declared as public.

Influenced-by-smart-comments-of: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/egit/ui/UIText.java            |  207 +++
 .../components/CenteredImageLabelProvider.java     |   52 +
 .../internal/components/CheckboxLabelProvider.java |  138 ++
 .../internal/components/ClickableCellEditor.java   |   68 +
 .../internal/components/ComboLabelingSupport.java  |   77 +
 .../ui/internal/components/RefContentProposal.java |  140 ++
 .../egit/ui/internal/components/RefSpecPage.java   |  237 +++
 .../egit/ui/internal/components/RefSpecPanel.java  | 1823 ++++++++++++++++++++
 .../src/org/spearce/egit/ui/uitext.properties      |   71 +
 9 files changed, 2813 insertions(+), 0 deletions(-)
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/CenteredImageLabelProvider.java
 create mode 100644 ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

PushOperation is designed to handle push-to-one and push-to-many URIs,
using some supporting classes. Failure of connection to any of
repositories doesn't cause to fail whole operation - they are
independent that way. It is also possible to specify different expected
old object id for each remote repository.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/egit/core/CoreText.java        |   15 +
 .../src/org/spearce/egit/core/coretext.properties  |    6 +
 .../org/spearce/egit/core/op/PushOperation.java    |  148 +++++++++++
 .../spearce/egit/core/op/PushOperationResult.java  |  273 ++++++++++++++++++++
 .../egit/core/op/PushOperationSpecification.java   |   82 ++++++
 5 files changed, 524 insertions(+), 0 deletions(-)
 create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/op/PushOperation.java
 create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/op/PushOperationResult.java
 create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/op/PushOperationSpecification.java

diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java b/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java
index 5974a5f..35e17b9 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java
@@ -98,6 +98,21 @@ public class CoreText extends NLS {
 	/** */
 	public static String ListRemoteOperation_title;
 
+	/** */
+	public static String PushOperation_resultCancelled;
+
+	/** */
+	public static String PushOperation_resultNotSupported;
+
+	/** */
+	public static String PushOperation_resultTransportError;
+
+	/** */
+	public static String PushOperation_taskNameDryRun;
+
+	/** */
+	public static String PushOperation_taskNameNormalRun;
+
 	static {
 		final Class c = CoreText.class;
 		initializeMessages(c.getPackage().getName() + ".coretext", c);
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/coretext.properties ...
From: Marek Zawirski
Date: Sunday, August 17, 2008 - 1:44 pm

Push operation in GUI is implemented as wizard consisting of 3 pages:
-repository selection
-ref specifications selection
-confirmation page with dry run results (optional - can be skipped)

Wizard finish-action starts Job with PushOperation. Dialog with results
is shown when job ends. It can be configured to be displayed only if
results change since confirmation.

With confirmation page, it is possible to perform 2-stage push, allowing
user to preview updates and mark them to be performed only if
advertised refs don't change.

Eventually, results Dialog can be replaced with Result/Transport view
some day, as this idea arose recently.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 org.spearce.egit.ui/plugin.properties              |    3 +
 org.spearce.egit.ui/plugin.xml                     |   15 +
 .../src/org/spearce/egit/ui/UIText.java            |  129 ++++++++
 .../egit/ui/internal/actions/PushAction.java       |   47 +++
 .../egit/ui/internal/push/ConfirmationPage.java    |  211 +++++++++++++
 .../egit/ui/internal/push/PushResultTable.java     |  327 ++++++++++++++++++++
 .../spearce/egit/ui/internal/push/PushWizard.java  |  250 +++++++++++++++
 .../ui/internal/push/RefUpdateContentProvider.java |   62 ++++
 .../egit/ui/internal/push/RefUpdateElement.java    |   67 ++++
 .../egit/ui/internal/push/ResultDialog.java        |   65 ++++
 .../src/org/spearce/egit/ui/uitext.properties      |   47 +++
 11 files changed, 1223 insertions(+), 0 deletions(-)
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/PushAction.java
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/push/ConfirmationPage.java
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/push/PushResultTable.java
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/push/PushWizard.java
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/push/RefUpdateContentProvider.java
 create mode ...
From: Robin Rosenberg
Date: Tuesday, August 19, 2008 - 11:24 am

"Stealing" artwork is not good, though there are bordercases like this. It
is also the wrong look on my box which uses check marks instead of X.

Are all options exhauested wrt to using the native L&F, commented out in 
patch 31. For example toucher caching of generated images so mac users
would only see less flicker. I see no problems with GTK when using the
out-commented portion. Windows (XP) seems fine too. A really ugly, codewise,
would be to detect OSX and use custom images only for it until we find a
fix.

-- robin
--

From: Shawn O. Pearce
Date: Tuesday, August 19, 2008 - 9:45 am

I think we should document that this is the *local* (source)
repository and not the remote (dest) repository.

-- 
Shawn.
--

From: Shawn O. Pearce
Date: Tuesday, August 19, 2008 - 9:28 am

Having a boolean constant DEFAULT_DRY_RUN = false is sort of
overkill in my opinion.  Most people would assume a boolean with
no value assigned and not marked final will default to false.
Setting something like dryRun to false by default is reasonable,
as you usually want it to actually execute.

What's worse though is if one day someone changes
Transport.DEFAULT_DRY_RUN = true in the library.  When that happens
the push command line tool will never function as there is no
"--no-dry-run" to set dryRun = false.

So this assignment is likely not a good idea.

-- 
Shawn.
--

From: Shawn O. Pearce
Date: Tuesday, August 19, 2008 - 10:59 am

So my office-mate suggests that the output of a program (in this
case the checkbox icon) isn't covered by the same copyright as the
program that created it.  So we may be OK.  Or we just use some
other sort of icon for the checkbox.  Maybe Tor would be able to
come up with something useful here?

Anyway, most of this series looks pretty good to me.  I found a
few other annoying bugs in JGit and EGit as a result of testing
this series, but they are unrelated to the series and have been

Heh.  Been busy, hmm?  ;-)

-- 
Shawn.
--

From: Robin Rosenberg
Date: Tuesday, August 19, 2008 - 12:21 pm

It's not that simple. That obviously may be the case, but I'm certain
it does not apply to individual well defined pieces of artwork (or text for

The weather in and around the Baltic Sea has been horrible for much
of August so far. Maybe that helped him. :)

-- robin
--

From: Marek Zawirski
Date: Tuesday, August 19, 2008 - 7:42 pm

Well, consider that they are even more of them. GTK+ has configurable 
themes (in my case it is delegation to QT with Plastik theme, where 
screenshot was made). I don't know about other platforms, but always 
having hyper-UI Mac OS X and Windows Vista may also have some 
customization options.
No matter how icons we would prepare, always there will be somebody who 
can say that these icons are somehow inconsistent with his/her LAF.

So I think, it'd better to have this mentioned ugly code workaround just 
for Mac OS (only there flashing window is so annoying). Less people 
suffering.

Or as Shawn said, we can try to make our own funny icon for Force Update 
(red "F"-enabled and gray "F"-disabled?) that is equally (in)consistent 

Nice testing then, as I have spend hours on testing UI tricks and 

I swear guys, I wasn't sailing for over 1 month;)
Actually, I'm now leaving for few days, so I'm sending out just fixes 
for issues pointed out by Shawn and found by me in the mean time. I'll 
squash these patches with existing commits in push branch, as it is 
probably worth nothing to keep this in history.

Fetch UI and dynamic team menu entries for push and fetch (for 
configured remotes) are underway, I'll come back to them after coming 
back home.

BTW, as another developers are getting involved in jgit/egit coding, 
maybe we could use (update) some wiki page for marking who is working on 
some topic currently? Now it's not obvious for me, and as we're not so 
numerous it would be pity to waste our time and do some redundant stuff 
one day.

-- 
Marek Zawirski [zawir]
marek.zawirski@gmail.com
--

From: Marek Zawirski
Date: Tuesday, August 19, 2008 - 7:57 pm

This constant was pointless as changing it would brake code in the same
way as changing hardcoded value instead.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/jgit/pgm/Push.java             |    2 +-
 .../src/org/spearce/jgit/transport/Transport.java  |    7 +------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
index b61071c..d36bf4f 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
@@ -87,7 +87,7 @@ void nothin(final boolean ignored) {
 	private String receivePack;
 	
 	@Option(name = "--dry-run")
-	private boolean dryRun = Transport.DEFAULT_DRY_RUN;
+	private boolean dryRun;
 
 	private boolean shownURI;
 
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
index 939347e..ca68ca6 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
@@ -313,11 +313,6 @@ private static String findTrackingRefName(final String remoteName,
 	public static final RefSpec REFSPEC_PUSH_ALL = new RefSpec(
 			"refs/heads/*:refs/heads/*");
 
-	/**
-	 * Default setting for {@link #dryRun} option.
-	 */
-	public static final boolean DEFAULT_DRY_RUN = false;
-
 	/** The repository this transport fetches into, or pushes out of. */
 	protected final Repository local;
 
@@ -354,7 +349,7 @@ private static String findTrackingRefName(final String remoteName,
 	private boolean pushThin = DEFAULT_PUSH_THIN;
 
 	/** Should push just check for operation result, not really push. */
-	private boolean dryRun = DEFAULT_DRY_RUN;
+	private boolean dryRun;
 
 	/**
 	 * Create a new transport instance.
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Tuesday, August 19, 2008 - 7:57 pm

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../spearce/jgit/transport/RemoteRefUpdate.java    |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
index 42588c1..66fe6a1 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
@@ -133,15 +133,15 @@
 
 	private String message;
 
-	private final Repository db;
+	private final Repository localDb;
 
 	/**
 	 * Construct remote ref update request by providing an update specification.
 	 * Object is created with default {@link Status#NOT_ATTEMPTED} status and no
 	 * message.
-	 *
-	 * @param db
-	 *            repository to push from.
+	 * 
+	 * @param localDb
+	 *            local repository to push from.
 	 * @param srcRef
 	 *            source revision - any string resolvable by
 	 *            {@link Repository#resolve(String)}. This resolves to the new
@@ -173,26 +173,26 @@
 	 * @throws IllegalArgumentException
 	 *             if some required parameter was null
 	 */
-	public RemoteRefUpdate(final Repository db, final String srcRef,
+	public RemoteRefUpdate(final Repository localDb, final String srcRef,
 			final String remoteName, final boolean forceUpdate,
 			final String localName, final ObjectId expectedOldObjectId)
 			throws IOException {
 		if (remoteName == null)
 			throw new IllegalArgumentException("Remote name can't be null.");
 		this.srcRef = srcRef;
-		this.newObjectId = (srcRef == null ? ObjectId.zeroId() : db
+		this.newObjectId = (srcRef == null ? ObjectId.zeroId() : localDb
 				.resolve(srcRef));
 		if (newObjectId == null)
 			throw new IOException("Source ref " + srcRef
 					+ " doesn't resolve to any object.");
 		this.remoteName = remoteName;
 		this.forceUpdate = forceUpdate;
-		if ...
From: Marek Zawirski
Date: Tuesday, August 19, 2008 - 7:57 pm

ErrorDialog is used instead of MessageDialog (more information), strings
are externalized.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../src/org/spearce/egit/ui/UIText.java            |    6 ++++++
 .../egit/ui/internal/actions/PushAction.java       |   13 +++++++++----
 .../src/org/spearce/egit/ui/uitext.properties      |    3 +++
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
index cc785f7..b45d2e9 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
@@ -464,6 +464,12 @@
 	public static String HistoryPreferencePage_title;
 
 	/** */
+	public static String PushAction_wrongURIDescription;
+
+	/** */
+	public static String PushAction_wrongURITitle;
+
+	/** */
 	public static String PushWizard_cantConnectToAny;
 
 	/** */
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/PushAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/PushAction.java
index 61833d0..b4af3b5 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/PushAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/PushAction.java
@@ -9,9 +9,13 @@
 
 import java.net.URISyntaxException;
 
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.wizard.WizardDialog;
+import org.spearce.egit.ui.Activator;
+import org.spearce.egit.ui.UIText;
 import org.spearce.egit.ui.internal.push.PushWizard;
 import org.spearce.jgit.lib.Repository;
 
@@ -31,9 +35,10 @@ public void run(IAction action) {
 		try {
 			pushWizard = new PushWizard(repository);
 		} catch (URISyntaxException x) ...
From: Marek Zawirski
Date: Tuesday, August 19, 2008 - 7:57 pm

Proposal provider for destination fields in fetch was inappropriately
proposing illegal local expression like HEAD^, while we should propose
there only refs or wildcard expressions.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../egit/ui/internal/components/RefSpecPanel.java  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPanel.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPanel.java
index caef4d2..1621434 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPanel.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPanel.java
@@ -323,7 +323,7 @@ private static void setControlDecoration(final ControlDecoration control,
 	 */
 	public RefSpecPanel(final Composite parent, final boolean pushSpecs) {
 		this.pushSpecs = pushSpecs;
-		this.localProposalProvider = new RefContentProposalProvider(true);
+		this.localProposalProvider = new RefContentProposalProvider(pushSpecs);
 		this.remoteProposalProvider = new RefContentProposalProvider(false);
 		this.imageRegistry = new ImageRegistry(parent.getDisplay());
 
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Tuesday, August 19, 2008 - 7:57 pm

If we call only pack() after controls were layed out, label may disappear
on dialog resize. So we probably need to relayout whole panel when label
content changes.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../egit/ui/internal/components/RefSpecPage.java   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPage.java
index 4471e24..b526cf3 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPage.java
@@ -209,7 +209,7 @@ private void revalidateImpl(final RepositorySelection newRepoSelection) {
 			saveButton.setVisible(true);
 			saveButton.setText(NLS.bind(UIText.RefSpecPage_saveSpecifications,
 					remoteName));
-			saveButton.pack();
+			saveButton.getParent().layout();
 		}
 		checkPage();
 	}
-- 
1.5.6.3

--

From: Marek Zawirski
Date: Tuesday, August 19, 2008 - 7:57 pm

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../egit/ui/internal/components/RefSpecPage.java   |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPage.java
index b526cf3..70856ca 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPage.java
@@ -191,7 +191,8 @@ private void revalidateImpl(final RepositorySelection newRepoSelection) {
 		} catch (InvocationTargetException e) {
 			final Throwable cause = e.getCause();
 			transportError(cause.getMessage());
-			ErrorDialog.openError(getShell(), UIText.RefSpecPage_errorTransportDialogTitle,
+			ErrorDialog.openError(getShell(),
+					UIText.RefSpecPage_errorTransportDialogTitle,
 					UIText.RefSpecPage_errorTransportDialogMessage, new Status(
 							IStatus.ERROR, Activator.getPluginId(), 0, cause
 									.getMessage(), cause));
-- 
1.5.6.3

--

From: Shawn O. Pearce
Date: Wednesday, August 20, 2008 - 7:13 am

Thanks.  These fixes look good to me, and they address my immediate

I've thought about starting a code.google.com project just to use
the issue tracking system there.  I'm using an internal tool to
keep of issues for myself, but that's not fair to the end-users or
other contributors...

-- 
Shawn.
--

From: Petr Baudis
Date: Wednesday, August 20, 2008 - 8:23 am

I have been thinking about issue tracking for some of my projects too,
but I'm wondering, does anyone have a comprehensive picture of the state
of the Git-supporting issue tracking tools, especially those that keep
the tracked issues in a Git repository as well?

	http://git.or.cz/gitwiki/InterfacesFrontendsAndTools#head-73b23f376ebd0222d1e4b08f0915...

has three, but two of them are in Ruby, which is rather discouraging.
But Cil (in Perl) is already "self-hosting", so it might be well usable?

-- 
				Petr "Pasky" Baudis
The next generation of interesting software will be done
on the Macintosh, not the IBM PC.  -- Bill Gates
--

From: Shawn O. Pearce
Date: Wednesday, August 20, 2008 - 9:44 am

Cil is interesting.  I'm concerned about keeping the state in tree
with the repository though in a distributed development team.

If I mark the status of an issue in a branch that isn't ready
for mainline how do I share that status update with everyone else?
I have to put it into a branch somewhere, no big deal.  repo.or.cz is
pretty good at publishing things.

But do that now for 5 developers working on 10 or 20 different
branches at once.  We'll have status updates all over the place
and Marek's desire to see what we are each working on (to reduce
wasted effort and perhaps help each other out more) still isn't met.

This is the number one reason a DIT (distributed issue tracker)
isn't available.  Nobody has solved the hard technical problem of
making it easy to distribute the state changes, yet still provide
a reasonably current global view of the issue status.

Perhaps running Cil in its own egit-cil.git repository would get
us what we neeed.  I looked at the code and its pretty clean,
but I didn't see how merges of the .cil database work.

-- 
Shawn.
--

From: Robin Rosenberg
Date: Wednesday, August 20, 2008 - 1:25 pm

Actually his name is Mik Kersten, the main figure behind Mylyn.
Mylyn is a plugin for Eclipse that actually does this. It connects to 
bugzilla, trac and som other trackers and caches changes locally
until it connect to the website and syncrhronize. It does a lot more,
than that. The objectives partially overlap what Git does. Having

-- robin
--

From: Martin Langhoff
Date: Thursday, August 21, 2008 - 1:47 am

[Empty message]
From: Jakub Narebski
Date: Wednesday, August 20, 2008 - 11:52 am

There is also Bugs Everywhere, written in Python, which supposedly has
(some form of) Git support:
  http://git.or.cz/gitwiki/InterfacesFrontendsAndToolsWishlist#be

There was also 'grit' by Pierre Habouzit, also in Python, which got
abandoned and removed (also from wiki):
http://git.or.cz/gitwiki/InterfacesFrontendsAndTools?action=diff&rev2=203&rev1...
If I remember correcly Pierre promised to write down what he learned
about distributed bug tracking from his work on grit[*1*], when he had
a bit of free time, but I don't remember him doing it...

See also "[RFC] git integrated bugtracking" thread on git mailing list
(http://thread.gmane.org/gmane.comp.version-control.git/48981) where
grit started, and later "[RFC] Idea for Git Bugtracking Tool"
(http://thread.gmane.org/gmane.comp.version-control.git/76411), where
you can find different distributed bug trackers, not all of them
thought supporting Git.

HTH.

Footnotes:
==========
[*1*] http://thread.gmane.org/gmane.comp.version-control.git/76411/focus=76565
-- 
Jakub Narebski
Poland
ShadeHawk on #git
--

From: Pierre Habouzit
Date: Thursday, August 21, 2008 - 1:30 am

Actually there is a list, bugs-dist@kitenet.net or sth similar where I
did it. One should look at the archives of that list. Though it's
somehow dead again.

--=20
=C2=B7O=C2=B7  Pierre Habouzit
=C2=B7=C2=B7O                                                madcoder@debia=
n.org
OOO                                                http://www.madism.org
From: Jakub Narebski
Date: Thursday, August 21, 2008 - 2:23 am

Archives are at http://kitenet.net/pipermail/dist-bugs/ for what its
worth (only 39 messages there).

-- 
Jakub Narebski
Poland
--

From: Mike Dalessio
Date: Wednesday, August 20, 2008 - 1:22 pm

I haven't played with it, but this looks like it's along the lines of
what you're discussing:

     http://github.com/jwiegley/git-issues/tree/master

It apparently uses an unchecked-out branch in the project to manage its data,
which is stored in a hash directory structure similar to .git/objects.
--

From: Imran M Yousuf
Date: Thursday, August 21, 2008 - 1:55 am

I would also like to see FishEye support git. They have a issue for it
where they have asked interested personnel to place their comment or
vote.

http://jira.atlassian.com/browse/FE-337

Integration with FishEye would mean integration with JIRA as well.
IMO, that would be cool!

Best regards,




-- 
Imran M Yousuf
Email: imran@smartitengineering.com
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557
--

From: Marek Zawirski
Date: Monday, August 25, 2008 - 6:59 am

That seems to be nice idea.
The only downside I see is that using code.coogle.com with Mylyn may be 
hard[1]. As if we start to use issues system, it may be nice opportunity 
to start using Mylyn - if anybody want to?

[1] http://www.jroller.com/alexRuiz/entry/using_mylyn_with_google_code

-- 
Marek Zawirski [zawir]
marek.zawirski@gmail.com
--

From: Shawn O. Pearce
Date: Monday, August 25, 2008 - 7:24 am

A comment there suggests its gotten slightly better:


I may give it a try later today.

I also know some of the folks behind code.google.com.  I can poke
them to see if Mylyn support is going to be coming along in the
near future.  Google uses Eclipse a lot internally, and we have
a number of open source projects using code.google.com as their
hosting/issue tracking, and Eclipse as their IDE.  We probably
should be making the issue tracking product more accessible to IDEs.

-- 
Shawn.
--

From: Robin Rosenberg
Date: Thursday, August 21, 2008 - 1:12 pm

As I'm too eager to get this out (seems to work), I can squash it and
rearrange the checkbox-related code a little like stealing the icons
from the Eclipse CVS and grouping the checkbox classes with the
icons plus a tweak for selecting how the images for the checkbox
are created.

-- robin
--

From: Shawn O. Pearce
Date: Thursday, August 21, 2008 - 1:16 pm

Yea.  Go for it.  Reusing icons from Eclipse CVS is a good way
around the icon issue.

-- 
Shawn.
--

From: Robin Rosenberg
Date: Thursday, August 21, 2008 - 4:25 pm

I pushed the cleanups to pu using the Eclipse plugin(!) built from that version. 
You may want to take a quick look before we declare it master. 

Nice work Marek!

-- robin
--

From: Shawn O. Pearce
Date: Thursday, August 21, 2008 - 8:05 pm

Yay!  I'll take a quick look at the series tomorrow, and if
it looks good to me too I'll merge it over to master.  But I'm
not going to spend much time on EGit tomorrow if I can help it.
I need to focus on some work related stuff, and the Git in HTTP
RPC protocol specification.
 
-- 
Shawn.
--

From: Marek Zawirski
Date: Monday, August 25, 2008 - 7:13 am

I'm back and looked at this solution - it is probably the best 

Nice to hear that:)

-- 
Marek Zawirski [zawir]
marek.zawirski@gmail.com
--

From: Shawn O. Pearce
Date: Monday, August 25, 2008 - 7:15 am

I used the plugin to push itself to master.  Your changes are in
the main tree.  Yay!

-- 
Shawn.
--

Previous thread: git clone operation by Mike Gant on Sunday, August 17, 2008 - 11:44 am. (5 messages)

Next thread: none