git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [JGIT PATCH 2/2] Add support for remote.name.pushurl

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Jun 21, 2009, 17:30 UTC
Message-ID
<200906211930.43809.robin.rosenberg@dewire.com>
In-Reply-To
<1245547316-10299-2-git-send-email-spearce@spearce.org>
söndag 21 juni 2009 03:21:56 skrev "Shawn O. Pearce" <spearce@spearce.org>:
Show 29 quoted lines
> In C Git commit 203462347fce Michael J Gruber added support for a
> new URL key within a remote block, permitting a different URL to
> be used for push than for fetch.  In the commit message he cites
> an example where fetch runs over git://, but push uses ssh://,
> as the git:// protocol has lower connection setup overheads.
> 
> This change complicates the Transport API as now we must know
> in advance when the Transport.open() call is made what type of
> operation the caller wants to perform, so we know which config
> key to honor when constructing the Transport objects.
> 
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
> ---
>  .../src/org/spearce/jgit/pgm/Push.java             |    3 +-
>  .../org/spearce/jgit/transport/RemoteConfig.java   |   47 ++++++
>  .../src/org/spearce/jgit/transport/Transport.java  |  150 ++++++++++++++++++--
>  3 files changed, 190 insertions(+), 10 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 19d31a1..9364e4a 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
> @@ -102,7 +102,8 @@ protected void run() throws Exception {
>  				refSpecs.add(spec.setForceUpdate(true));
>  		}
>  
> -		final List<Transport> transports = Transport.openAll(db, remote);
> +		final List<Transport> transports;
> +		transports = Transport.openAll(db, remote, Transport.Operation.PUSH);
Nit-pick. We usually initialize in one statement. I'll squash that for you.

Seems we need to consider the Eclipse UI, since that has only of only one UI. Can we hold on to that or at least establish a related issue in the bug tracker for Egit.

-- robin
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 3 of 4 in “Cleanup Transport.applyConfig to use setter methods more consistently”
  1. 1/2 Cleanup Transport.applyConfig to use setter methods more consistentlyShawn O. Pearce, Jun 21, 2009
  2. 2/2 Add support for remote.name.pushurlShawn O. Pearce, Jun 21, 2009
  3. Robin RosenbergJun 21, 2009
  4. Shawn O. PearceJun 23, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.