git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Revision resolution for remote-helpers?
@ 2017-08-18  6:42 Mike Hommey
  2017-08-18 12:15 ` Jeff King
  2017-08-18 22:06 ` Jonathan Nieder
  0 siblings, 2 replies; 11+ messages in thread
From: Mike Hommey @ 2017-08-18  6:42 UTC (permalink / raw)
  To: git

Hi,

As you might remember, I'm maintaining a remote helper that allows to
talk directly to mercurial servers with git: git-cinnabar.

When dealing with "foreign (non-git) repositories", it is often
necessary to refer to revisions with their native name. With mercurial,
that's a sha1, with svn it's a revision number, etc.

Git-cinnabar does provide a helper command that gives back the git
commit from the mercurial revision (and vice versa), but that's
cumbersome to use in commands.

I was thinking it could be useful to have a special syntax for revisions
that would query a helper program. The helper program could use a
similar protocol to that of the remote helpers.

My thought is that a string like <helper>::<revision> could be used
wherever a committish is expected. That would call some helper
and request to resolve revision, and the helper would provide a git
commit as a response.

The reason for the <helper>:: prefix is that it matches the <helper>::
prefix used for remote helpers.

Now, there are a few caveats:
- <revision>, for e.g. svn, pretty much would depend on the remote.
  OTOH, in mercurial, it doesn't. I think it would be fair for the
  helper to have to deal with making what appears after :: relevant
  to find the right revision, by possibly including a remote name.
- msys likes to completely fuck up command lines when they contain ::.
  For remote helpers, the alternative that works is
  <helper>://<host>/etc.

Which leads me to think some "virtual" ref namespace could be a solution
to the problem. So instead of <helper>::, the prefix would be <helper>/.
For e.g. svn, svn/$remote/$rev would be a natural way to specify the
revision for a given remote. For mercurial, hg/$sha1.

Potentially, this could be a sort of pluggable ref stores, which could
be used for extensions such as the currently discussed reftable.

On the opposite end of the problem, I'm also thinking about git log
--decorate=<helper> displaying the mercurial revisions where branch
decorations would normally go.

I have no patch to show for it. Those are ideas that I first want to
discuss before implementing anything.

Thoughts?

Mike

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-09-21  1:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-18  6:42 Revision resolution for remote-helpers? Mike Hommey
2017-08-18 12:15 ` Jeff King
2017-08-18 21:57   ` Mike Hommey
2017-08-18 22:06 ` Jonathan Nieder
2017-08-18 22:17   ` Mike Hommey
2017-08-18 22:33     ` Jonathan Nieder
2017-08-22 20:15       ` [git-for-windows] " Johannes Schindelin
2017-08-24  8:23         ` Mike Hommey
2017-08-25 10:58           ` Johannes Schindelin
2017-08-25 12:02             ` Mike Hommey
2017-09-21  1:13               ` Mike Hommey

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).