Saw your message and recalled that I stumbled on the same issue some
years back. Indeed fossil trumps git, so nobody looks back :)

In case you wonder, the reason you saw the email and name getting
swapped is because the email was expected to be in form <user@email>,
mind the <>.

I just checked-in the fix
(http://fossil-scm.org/index.html/info/76d9a4555b56405d), hope this
works for you.

Briefly, fossil user contact info may be formatted as email-only
(u...@email.com), or also include a name ("Name User"
<u...@email.com>) in addition to other type of info (??mail, phone).

Below is a test-script I used to verify the functionality.

As a side-note, fossil user's contact info format seems to be not
explicitly specified. So technically, fossil would accept anything
there. Yet looking at the export --git code, there are some implied
expectations about possible contents of the info field in users table.
Looks like the email was generally expected in form: "Name User"
<u...@email.com>, note the brackets <>.

The fix preserves these expectations, just in case. Following is the
test-scipt I used to verify the generation of the git committer
record:

---------------------------
#!/bin/bash

if [ -e xtest.fossil ] ; then rm xtest.fossil ; fi
if [ -d xtest ] ; then rm -rf xtest ; fi
if [ -e xtest.git-fast ] ; then rm xtest.git-fast ; fi
if [ -d xtest-git ] ; then rm -rf xtest-git ; fi
if [ -e xtest-git.authors-expected ] ; then rm xtest-git.authors-expected ; fi

fossil version

fossil init xtest.fossil --admin-user adminuser

fossil user new "email@as.username" "" "" -R xtest.fossil
fossil user new no-info "" "" -R xtest.fossil
fossil user new has-email-only "has-email-o...@email.com" "" -R xtest.fossil
fossil user new has-info "Name User <has-i...@email.com>" "" -R xtest.fossil
fossil user new has-general-info "  \"First Last\"   <
has-general-i...@email.com > other info" "" -R xtest.fossil
fossil user new "<bracketed-email@as.username>" "" "" -R xtest.fossil

echo "#######################################################"
echo "I|FOSSIL::user list:username      info"
fossil user list -R xtest.fossil

echo "#######################################################"
echo "I|GIT::xtest-git.authors-expected list:{name, email}"
cat <<EOF >xtest-git.authors-expected
{First Last, has-general-i...@email.com}
{Name User, has-i...@email.com}
{adminuser, adminuser}
{bracketed-email@as.username, bracketed-email@as.username}
{email@as.username, email@as.username}
{has-email-only, has-email-o...@email.com}
{no-info, no-info}
EOF
cat xtest-git.authors-expected

echo "#######################################################"
echo "I|FOSSIL::repo setup"
mkdir xtest
cd xtest
fossil open ../xtest.fossil
fossil user default adminuser --user adminuser

echo "Test" >>test.txt
fossil add test.txt
fossil commit -m "By default"

echo "Test" >>test.txt
fossil commit -m "By email@as.username" --user "email@as.username"
echo "Test" >>test.txt
fossil commit -m "By no-info" --user no-info
echo "Test" >>test.txt
fossil commit -m "By has-email-only" --user has-email-only
echo "Test" >>test.txt
fossil commit -m "By has-info" --user has-info
echo "Test" >>test.txt
fossil commit -m "By has-general-info" --user has-general-info
echo "Test" >>test.txt
fossil commit -m "By <bracketed-email@as.username>" --user
"<bracketed-email@as.username>"

fossil timeline

echo "#######################################################"
echo "I|FOSSIL::export --git"
cd ..
fossil export --git xtest.fossil >xtest.git-fast

echo "I|GIT::import"
mkdir xtest-git
cd xtest-git
git init
git fast-import <../xtest.git-fast

git checkout trunk
git log --oneline --pretty=format:"{%aN, %aE}" --reverse | sort -u
>../xtest-git.authors

echo "#######################################################"
echo "I|GIT::xtest-git.authors list:{name, email}"
cd ..
cat xtest-git.authors

echo "#######################################################"
echo "I|TEST::diff to xtest-git.authors-expected"
diff xtest-git.authors xtest-git.authors-expected || echo
"E|FAILED-TEST::diff to xtest-git.authors-expected"

---------------------------


On Tue, Dec 20, 2016 at 5:35 PM, Chad Perrin <c...@apotheon.net> wrote:
> When exporting from a Fossil repository and importing into a Git
> repository, the commits all seem to identify the email address as the
> name and the name as the email address.  The command I use is
> essentially identical to what the documentation/example at
> fossil-scm.org, and I do not see a way in the help documentation for the
> tool or on the website for how to control the way it identifies the
> author of a commit on export.
>
> Is there a work-around for this?  Is this a problem affecting anyone
> else?  Any help figuring this out would be appreciated.
>
> --
> Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
> _______________________________________________
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to