git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andreas Stricker <astricker@futurelab.ch>
To: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Cc: git@vger.kernel.org
Subject: Re: git-svn show-externals and svn version
Date: Wed, 07 Mar 2012 10:39:40 +0100	[thread overview]
Message-ID: <4F572CDC.6060303@futurelab.ch> (raw)
In-Reply-To: <5B8386D7-3C01-4A58-A7AB-9AA43BB45572@nikolaus-demmel.de>

Nikolaus Demmel <nikolaus@nikolaus-demmel.de> wrote:
> I feel a bit like I am talking to myself, but I see from the high
> traffic on this list that people are busy doing great things :-). I will
> write anyway in case someone interested in git-svn listens.

Um I'm always a bit behind in reading this list. A long time ago my
colleague and I implemented a parser for the new svn:externals format
as a proof of concept[1]. I never took the time to finish it.

> So I've investigated the matter a bit further. Turns out in the
> subversion SWIG language bindings there is an API function that parses
> svn:externals definitions for you.

This looks like a sane approach. I ended with a bunch of complicated
parsing code [2].

> How could this be used in git-svn show-externals? As layed out before, I
> believe that the current output for the svn1.5 syntax is inherently
> broken and we should not worry about backwards compatibility for
> that.

I second that. The output for the new syntax is just plain broken and
can't be used in a sane way. I know that because I tried...

> To maintain backwards compatibility with the output for the old
> format and to give a canonical, easy to parse, output for any external
> definition, I suggest sticking to the current format, just inserting the
> parsed definition at the appropriate place with relative URLs completely
> resolved to absolute ones.

This is exactly what my proof of concept does. The output format keeps
the same as for pre subversion 1.5 format.

> The pre-svn1.5 syntax for external definitions was:
> 
> LOCAL-PATH [-r REVISION] ABSOLUTE-URL
> 
> The output for show-externals was thus (note that there is no parsing of
> the external definition going on yet):
> 
> DIRECTORY-PREFIX/LOCAL-PATH [-rREVISION] ABSOLUTE-URL

Wasn't there also a line commented with a hash "#" before that? Like:
# DIRECTORY-PREFIX

> The DIRECTORY-PREFIX was added because show-externals shows the external
> definitions for all subdirectories recursively. With this prefix, every
> line can be processed on its own. I suggest extending this output to:
> 
> DIRECTORY-PREFIX/LOCAL-PATH [-rREVISION] ABSOLUTE-URL[@PEG-REV]
> 
> Again, as mentioned above, show-externals should parse the definitions
> and resolve relative URLs. Any lines that the svn API call cannot parse
> should be completely ommited (e.g. commented lines and empty lines).

A sane approach. What about a warning about lines skipped?

> As I understand it show-externals is intended primarily for scripts for
> further processing. With this extension existing scripts for the old
> syntax should keep working also long as they don't feature
> peg-revisions. With relative URLs resolved and a standard ordering old
> and new syntax cannot be distinguished in terms of show-externals output
> (except when there are peg-revsion are there).

True. So external tools like git-svn-clone-externals will still work
with this. I verified this with my proof of concept.

Regards, Andy

[1] https://github.com/AndyStricker/git
[2]
https://github.com/AndyStricker/git/commit/9981b3b8313fb831247a16a04d5040bd6a8660b1

      parent reply	other threads:[~2012-03-07  9:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-19 18:53 git-svn show-externals and svn version Nikolaus Demmel
2012-02-21 11:14 ` Nikolaus Demmel
2012-02-22 15:27   ` Nikolaus Demmel
2012-03-04 10:46     ` Jakub Narebski
2012-03-07  9:39     ` Andreas Stricker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F572CDC.6060303@futurelab.ch \
    --to=astricker@futurelab.ch \
    --cc=git@vger.kernel.org \
    --cc=nikolaus@nikolaus-demmel.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).