bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notes about git-svn source control in macOS


From: Dr . Jürgen Sauermann
Subject: Re: Notes about git-svn source control in macOS
Date: Sat, 27 Mar 2021 18:31:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi Peter,

thanks for sharing this.

Non-MAC users (?) should be warned that
git svn clone seems to be a new (?) or MAC
specific (?) git feature; my git (version 2.17.1) complains:

eedjsa@server68:/tmp$ git svn clone --preserve-empty-dirs -r HEAD https://svn.savannah.gnu.org/svn/apl/trunk
git: 'svn' is not a git command. See 'git --help'.

The
--preserve-empty-dirs looks like a long needed bug-fix for git which could improve
git from being an annoyance to being a mere nuisance. In my experience, though,  empty
directories in git are already dropped on commit rather than on clone and therefore

--preserve-empty-dirs should IMHO be an option for git commit rather than for git clone
(and maybe it is already?).

For that reason a straight

   git clone https://git.savannah.gnu.org/git/apl.git

might be more predictable than a "git svn clone".

Best Regards,
Jürgen


On 3/26/21 6:55 PM, Peter Teeson wrote:

Hi Jürgen:
Hope the following can be useful and perhaps even remove the extra maintenance burden of git.

I don’t understand enough about the various configure files (.ac, .sub, etc etc) etc to modify buildtag myself.

respect

Peter


For macOS users

TL:DNR
// download svn repo using git clone
Gandalf:~ pteeson$ git svn clone --preserve-empty-dirs -r HEAD https://svn.savannah.gnu.org/svn/apl/trunk > git-log 2>&1 

// for build tag script mods
// Are we on macOS and which version
Gandalf:trunk-git pteeson$ sw_vers |grep "ProductName"
ProductName: Mac OS X
 
Gandalf:trunk-git pteeson$ sw_vers | grep "ProductVersion"
ProductVersion: 10.14.6

// which svn 
Gandalf:trunk-git pteeson$ git svn info | grep "Revision:"
Revision: 1440

Details
Because Apple no longer distributes svn as part of its Developer tools (Xcode and Command Line Tools)
macOS users  should use git or take responsibility for installing svn. Of course this is not a big deal.

But for those who wish to use Apple’s tools I have been doing some deep diving over the last many days and learned a few things.

(1) Compare downloading the GNU APL repository using svn vs git

Gandalf:~ pteeson$ svn co http://svn.savannah.gnu.org/svn/apl/trunk > svn-log 2>&1
Gandalf:~ pteeson$ git svn clone --preserve-empty-dirs -r HEAD https://svn.savannah.gnu.org/svn/apl/trunk > git-log 2>&1

git notes: (a) if you do not specify the -r HEAD option you will be downloading all 1440 svns. This is usually NOT what you want!
      You really only want the latest svn, in this example 1440.

(b) If you do not use --preserve-empty-dirs you will not be happy - ask Jürgen for the details.

 (c) It’s not reasonable to diff download logs because the order in which the files are gathered is Heisenberged.
      Unless you want to sort them both - but why bother.
(d) However comparing the respective ./confire logs shows only 3 differences 
      2 of them are the respective names of the download dirs:  trunk-git vs trunk-svn 

      1 from the git ./configure —— *** current directory is not a svn checkout: keeping old buildtag. 
       But see item (2) below. Credit to John Helm for discovering this.

The good news is that it seems possible to lighten Jürgens maintenance load by eliminating the git server and use the svn URL.
and git clone with the added options indicated above.

See <https://git-scm.com/docs/git-svn> where the above options are documented.

(2) The git./configure issue requires some mods to the buildtag script. 
But it’s encouraging to compare the svn info vs the git svn info. (see git-svn documentation)

Gandalf:~ pteeson$ cd /Users/pteeson/Desktop/trunk-svn  Gandalf:~ pteeson$ cd /Users/pteeson/Desktop/trunk-git 
Gandalf:trunk-svn pteeson$ svn info Gandalf:trunk-git pteeson$ git svn info
Path: . Path: .
Working Copy Root Path: /Users/pteeson/Desktop/trunk-svn
Relative URL: ^/trunk
Repository UUID: bd74f7bd-1a55-4bac-9fab-68015b139e80 Repository UUID: bd74f7bd-1a55-4bac-9fab-68015b139e80
Revision: 1440 Revision: 1440
Node Kind: directory Node Kind: directory
Schedule: normal Schedule: normal
Last Changed Author: j_sauermann Last Changed Author: j_sauermann
Last Changed Rev: 1440 Last Changed Rev: 1440
Last Changed Date: 2021-02-26 10:54:15 -0500 (Fri, 26 Feb 2021) Last Changed Date: 2021-02-26 10:54:15 -0500 (Fri, 26 Feb 2021)

(3) buildtag script mods.
In Terminal bash/vsh we can use sw_vers to give us this information for mods to builtags:

Gandalf:trunk-git pteeson$ sw_vers |grep "ProductName"
ProductName: Mac OS X
 
Gandalf:trunk-git pteeson$ sw_vers | grep "ProductVersion"
ProductVersion: 10.14.6

Together with git svn info 

Gandalf:trunk-git pteeson$ git svn info | grep "Revision:"
Revision: 1440


HTH




reply via email to

[Prev in Thread] Current Thread [Next in Thread]