Subject: Re: [jgit] index v2 pull request

From: "Shawn O. Pearce" <[email-masked]>
Date: Wed, 12 Mar 2008 03:52:05 -0400

Robin Rosenberg <[email-masked]> wrote:
> Den Wednesday 12 March 2008 03.52.05 skrev Imran M Yousuf:
> 
> > I am currently looking into .git/config format as Shawn suggested.
> 
> That's a good one too. I have code for parsing the remotes specs, though
> e.g. "+refs/heads/master/*:refs/remotes/origin/*", but nothing for the "branch" config. I haven't used it yet, so it's a rip-out.	

Your RemoteSpec is missing the fact that some people have more than
one URL, fetch, and/or push lines in the same remote.  :-)
 
> + * <pre>
> + *  [remote &quot;name&quot;]
> + *     url = URL:ish
> + *     fetch = [+]remoteref:localref
> + * </pre>
> + *
> + * There are more variants but we do not support them here yet.

Or is that what you mean by the above statement?

In any case the remote spec needs a list of URLs a list of the
fetch/push Info objects.  That changes the public API of the
RemoteSpec class rather significantly.

> +public class RemoteSpec {
> +
> +	static class Info {
> +		boolean overwriteAlways;
> +
> +		boolean matchAny;
> +
> +		String remoteRef;
> +
> +		String localRef;
> +	}
> +
> +	Info fetch = new Info();
> +
> +	Info push = null;
> +
> +	private final String name;
> +
> +	private final String url;

-- 
Shawn.