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

Re: [PATCH 5/8] Add a config option for remotes to specify a foreign vcs

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 10, 2009, 08:47 UTC
Message-ID
<7v63cw3vjv.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.2.00.0908092153520.27553@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
> I think that users should never need to know the names of the helpers. I 
> mean, the native protocol uses helpers that most users are completely 
> unaware of. The users do need to know what the 
... heck ;-)?
But seriously, why not?
Show 9 quoted lines
> The problem is not that foreign systems don't have "urls" in particular. 
> The problem is that there are foreign systems, like perforce, where the 
> lines between different repositories in the git sense are drawn in very 
> different ways. In perforce, for example, there is a single namespace for 
> all branches of all projects hosted on the same server. It's like... 
> ...
> (and hundreds more, mixing all the branches of all of the repositories 
> for all of the projects, without any conventions beyond what the 
> community on the particular server made up)

That looks similar to a subversion server with multiple projects with multiple branches, and they seem to be able to use

    "svn://<whatever svn uses as its own convention>"
just fine.

Why p4 cannot do what svn can? Doesn't p4 ever "name" a repository/branch inside that "single namespace" with a simple string that is easy to remember for users? And if there is one, I do not see what prevents you from using "p4://<whatever information p4 users use>"?

Show 15 quoted lines
> You really need a different sort of configuration option to specify what 
> we think of as "the git.git repository", which includes certain branches 
> and doesn't include other projects hosted on kernel.org. And in order to 
> find the server, it uses an arbitrary shell command line that acts like 
> rsh (and often consists of "ssh" as the command and a bunch of complicated 
> options to connect to the right port of the right host to get the right 
> restricted shell with the right preset environment). So there's nothing 
> you can put in the <whatever string the helper understands> part, because 
> the helper really has to figure out what it's doing from a bunch of 
> options.
>
> Furthermore, I don't want to just use "p4:" as what people should use in 
> remote.*.url in order to select the right helper, because then people are 
> going to have different remotes with the same url option value in order to 
> access entirely different data.

Maybe it is the _primary_ itch you would want to scratch, but this does sound like a very special case that wants to have multiple pieces of pre-parsed information to identify a "repository".

Perhaps in such a case it would be equally valid if you said "p4:hello" and "p4:goodbye" to identify two "repositories", with p4-helper specific configuration option that is keyed off of of p4.hello.* and p4.goodbye.* namespace, e.g. (without knowing p4 at all)

	[remote "origin"]
        	url = p4:hello
	[p4 "hello"]
        	find-server-command = ssh bunch of complicated options
		random-p4-option = ...
		random-other-p4-option = ...

Of course it does not have to be called "url", and you could do the same thing with:

	[remote "origin"]
        	vcs = p4
	[p4 "origin"]
        	find-server-command = ssh bunch of complicated options
		random-p4-option = ...
		random-other-p4-option = ...

And probably there aren't much difference either way between these two appraoches. The former gives an extra name ("hello") that may simply be redundant, or perhaps adds value by descriptive, depending on your viewpoint.

Previous: Johannes SchindelinNext: Bert Wesarg
Message 24 of 35 in “Add a config option for remotes to specify a foreign vcs”
  1. 5/8 Add a config option for remotes to specify a foreign vcsDaniel Barkalow, Aug 9, 2009
  2. Johannes SchindelinAug 9, 2009
  3. Junio C HamanoAug 10, 2009
  4. Daniel BarkalowAug 10, 2009
  5. Johan HerlandAug 10, 2009
  6. Daniel BarkalowAug 10, 2009
  7. 0/6 Graceful handling of missing remote helpersJohan Herland, Aug 11, 2009
  8. 1/6 Minor unrelated fixesJohan Herland, Aug 11, 2009
  9. 2/6 transport_get(): Don't SEGFAULT on missing urlJohan Herland, Aug 11, 2009
  10. Junio C HamanoAug 12, 2009
  11. Johan HerlandAug 12, 2009
  12. 3/6 Move setup of curl remote helper from transport.c to transport-helper.cJohan Herland, Aug 11, 2009
  13. Johannes SchindelinAug 11, 2009
  14. 4/6 Add is_git_command_or_alias() for checking availability of a given git commandJohan Herland, Aug 11, 2009
  15. Johannes SchindelinAug 11, 2009
  16. 5/6 Let transport_helper_init() decide if a remote helper program can be usedJohan Herland, Aug 11, 2009
  17. Johannes SchindelinAug 11, 2009
  18. Daniel BarkalowAug 11, 2009
  19. Jeff KingAug 12, 2009
  20. Daniel BarkalowAug 12, 2009
  21. 6/6 Add testcase to verify handling of missing remote helper programsJohan Herland, Aug 11, 2009
  22. Junio C HamanoAug 11, 2009
  23. Johannes SchindelinAug 11, 2009
  24. Junio C HamanoAug 10, 2009
  25. Bert WesargAug 11, 2009
  26. Johannes SchindelinAug 11, 2009
  27. Jeff KingAug 11, 2009
  28. Johannes SchindelinAug 11, 2009
  29. Jeff KingAug 12, 2009
  30. Jakub NarebskiAug 12, 2009
  31. Junio C HamanoAug 12, 2009
  32. Jakub NarebskiAug 13, 2009
  33. Jeff KingAug 11, 2009
  34. Johannes SchindelinAug 12, 2009
  35. Junio C HamanoAug 12, 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.