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

Re: [PATCH 3/5] Add option for using a foreign VCS

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Mar 25, 2009, 16:20 UTC
Message-ID
<alpine.LNX.1.00.0903251042280.19665@iabervon.org>
In-Reply-To
<7v1vsm9jwd.fsf@gitster.siamese.dyndns.org>
On Tue, 24 Mar 2009, Junio C Hamano wrote:
Show 29 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > This simply configures the remote to use a transport that doesn't have
> > any methods at all and is therefore unable to do anything yet.
> >
> > Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> > ---
> >  Documentation/config.txt |    4 ++++
> >  remote.c                 |    2 ++
> >  remote.h                 |    2 ++
> >  transport.c              |    3 ++-
> >  4 files changed, 10 insertions(+), 1 deletions(-)
> >
> > diff --git a/remote.h b/remote.h
> > index de3d21b..e77dc1b 100644
> > --- a/remote.h
> > +++ b/remote.h
> > @@ -11,6 +11,8 @@ struct remote {
> >  	const char *name;
> >  	int origin;
> >  
> > +	const char *foreign_vcs;
> > +
> >  	const char **url;
> >  	int url_nr;
> >  	int url_alloc;
> 
> What are these extra blank lines for?  Isn't it pretty much part of the
> URL group that immediately follows it?

I'd been thinking of it as being a higher-level switch than the URLs, but it could go together.

Show 15 quoted lines
> > diff --git a/transport.c b/transport.c
> > index 26c578e..8a37db5 100644
> > --- a/transport.c
> > +++ b/transport.c
> > @@ -939,7 +939,8 @@ struct transport *transport_get(struct remote *remote, const char *url)
> >  	ret->remote = remote;
> >  	ret->url = url;
> >  
> > -	if (!prefixcmp(url, "rsync:")) {
> > +	if (remote && remote->foreign_vcs) {
> > +	} else if (!prefixcmp(url, "rsync:")) {
> 
> 	if (...) {
>         	; /* empty */
> 	} else ...

I don't think I've ever tried writing an empty block for git before. It's braces containing a semicolon and comment? (Of course, the reason I wrote this one this way is so that the next patch could put two "+" lines in there and have no "-" lines)

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “Add option for using a foreign VCS”
  1. 3/5 Add option for using a foreign VCSDaniel Barkalow, Mar 25, 2009
  2. Junio C HamanoMar 25, 2009
  3. Daniel BarkalowMar 25, 2009
  4. Junio C HamanoMar 25, 2009
  5. Daniel BarkalowMar 25, 2009
  6. Junio C HamanoMar 25, 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.