[sylpheed:37035] Re: Sylpheed project

Antonio Ospite <[email protected]> Fri, 8 Oct 2021 22:40:48 +0200
Newsgroups gmane.mail.sylpheed.general
Message-ID <[email protected]>
On Fri, 8 Oct 2021 14:53:16 +0900
Hiroyuki Yamamoto <[email protected]> wrote:

> Hello,
> 
> First, sorry for no response for long periods. I'm still alive :)
> 
> I'm somewhat busy for work and some projects in the company,
> so I have not been able to update Sylpheed,
> though its development is still not stopped.
>

Glad to hear that.

> The recent matter of concern is to migrate the svn repository to github,
> mainly to reduce the server maintenance cost and improve user-friendliness.
> (Its schedule is not yet determined, but probably in the near future)
> 

My two cents:

  - github.com would allow for the most exposure for sure;
  - gitlab.com would be a possible alternative in case there was any
    reason to avoid a proprietary service like github;
  - freedesktop.org might also be willing to host Sylpheed if
    gitlab.com was not viable for some reason.

In any case I am attaching a script to convert the Sylpheed SVN history
to git in a clean way.

Unfortunately the SVN repo seems down so it's not easy for everyone to
tests it, but I am sure Hiroyuki could make it work somehow with a
local repository.

I am available to help for the conversion from SVN to git if there is
any need.

Ciao,
   Antonio

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
sylpheed-svn-to-git-conversion.sh (text/x-sh, 2.4 KB)
#!/bin/sh

# Helper script to convert the Sylpheed svn repository to git.
#
# Dependencies:
#   - subversion for the 'svn' command
#   - git
#   - git-svn

set -e
set -x

# XXX unfortunately the official SVN repo seems to be down...
#REPO_URL=svn://sylpheed.sraoss.jp/sylpheed/

if [ -z "$REPO_URL" ];
then
  if [ -z "$1" ];
  then
    echo "usage: $(basename "$0") <svn_repo_url>" 1>&2
    echo "" 1>&2
    echo "The URL could also use the file:// scheme as long as it points to a full SVN repo." 1>&2
    exit 1
  fi
  REPO_URL="$1"
fi

if ! [ -d  sylpheed_SVN ];
then
  # Checkout the whole repository, not just the trunk.
  svn checkout "$REPO_URL"
  mv sylpheed sylpheed_SVN
fi

# Generate a file with the usernames of all the authors.
if ! [ -f authors.txt ];
then
  (
  cd sylpheed_SVN
  for author in $(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq); do
    case "$author" in
      [Hh]iro|yamamoto)
        GIT_AUTHOR="Hiroyuki Yamamoto <[email protected]>"
        ;;
      *)
        echo "Unexpected Sylpheed developer: $author" >&2
        exit 1
        ;;
    esac
    echo "${author} = $GIT_AUTHOR" >> ../authors.txt
  done
  )
fi

# Then clone the whole repository with git-svn.
if ! [ -d sylpheed_git-svn ];
then
  git svn clone --prefix=svn/ --stdlayout --authors-file=authors.txt "$REPO_URL" sylpheed_git-svn
fi

# The previous step takes a very long time, so work on a copy from now on, to
# avoid re-running the previous command if anything goes wrong.
if ! [ -d sylpheed ];
then
  cp -a sylpheed_git-svn sylpheed
fi

# Cleanup the git repository.

# We need to get some tools for that first.
if ! [ -d  git-svn-abandon ];
then
  git clone git://github.com/nothingmuch/git-svn-abandon.git
fi
export PATH="$PATH:${PWD}/git-svn-abandon"

# Clean up svn stuff.
(
cd sylpheed
git svn-abandon-fix-refs
git svn-abandon-cleanup

# Now check that all the branches and tags are here.
git branch -a
git tag -l

# Remove the last traces of svn heritage.
git config --remove-section svn
git config --remove-section svn-remote.svn
rm -rf .git/svn .git/logs/refs/remotes/svn/ .git/refs/remotes/svn/
)

# Check space usage.
du -hs sylpheed_SVN sylpheed

cat <<EOM
Wow quite a difference in size, and all the info about branches and tags is
still here.

The repository should be now in good shape with all the history preserved.

A possible TODO is to rename branches and tags to follow a more git-like
scheme.
EOM