Re: [fossil-users] incorrect user info in export --git
Oh, you just fix a long annoying stuff for me. I'm used to mirror my different fossil project to github and was obliged to use an intermediary step to modify my username https://projects.depar.is/divers/artifact/e3f4dd012ebeb677 I was not aware of the possibility to customize our user info with fossil. Thank you very much :) Étienne Artur Shepilkowrites: > Attached the test script. > > The mailing list seems to have redacted the email addresses used in > the test, which makes the test fail. > > On Thu, Jan 5, 2017 at 10:52 PM, Artur Shepilko wrote: >> 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 , >> 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" >> ) 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" >> , 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 " "" -R xtest.fossil >> fossil user new has-general-info " \"First Last\" < >> has-general-i...@email.com > other info" "" -R xtest.fossil >> fossil user new " " "" "" -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 > {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 " --user >> " " >> >> 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
Re: [fossil-users] incorrect user info in export --git
Attached the test script. The mailing list seems to have redacted the email addresses used in the test, which makes the test fail. On Thu, Jan 5, 2017 at 10:52 PM, Artur Shepilkowrote: > 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 , > 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" > ) 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" > , 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 " "" -R xtest.fossil > fossil user new has-general-info " \"First Last\" < > has-general-i...@email.com > other info" "" -R xtest.fossil > fossil user new " " "" "" -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 {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 " --user > " " > > 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 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
Re: [fossil-users] incorrect user info in export --git
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, 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" ) 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" , 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 " "" -R xtest.fossil fossil user new has-general-info " \"First Last\" < has-general-i...@email.com > other info" "" -R xtest.fossil fossil user new " " "" "" -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 >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 " --user " " 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 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 >
Re: [fossil-users] incorrect user info in export --git
On Sun, Dec 25, 2016 at 12:22:43PM -0500, Ron W wrote: > > I only use git when I have to, generally when a project requires submitting > pull requests. In that case, I still track my local changes in Fossil. Then > I pull the latest into my clone of the git repo, merge the changes into my > work space, rebuild, retest abd repeat as needed. Then I commit the "final" > changes to my clone and send the pull request. That sounds like a use case for what I've built, plus functionality going the other way (Git->Fossil), which I haven't built (yet). Of course, all this stuff is handled by export and import commands for both Fossil and Git, but I built something to mirror Fossil repositories to Git repositories so I could simplify my life somewhat when doing that. > > At work, the controls software group uses Fossil "internally", but the > company is still "standardized" on SVN (because the IT group's vision is > for "thin client" PCs that are fully interchangeable, which doesn't work > for my group because we need specialized tool chains that don't "play well" > with IT's vision). We use Fossil for our day-to-day work, only committing > releases to SVN. It seems like you have need of tools for import/export mirroring with Subversion, too. -- 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
Re: [fossil-users] incorrect user info in export --git
On Sun, Dec 25, 2016 at 7:00 AM, <fossil-users-requ...@lists.fossil-scm.org> wrote: > > Date: Sun, 25 Dec 2016 05:11:28 + > From: Chad Perrin <c...@apotheon.net> > Subject: Re: [fossil-users] incorrect user info in export --git > > On Sat, Dec 24, 2016 at 12:47:43PM -0800, bch wrote: > > On Dec 24, 2016 10:05, "Stephan Beal" <sgb...@googlemail.com> wrote: > > > > On Sat, Dec 24, 2016 at 6:42 PM, Chad Perrin <c...@apotheon.net> wrote: > > > > > I hope the lack of responses to my questions was because of the holiday > > > season > > > > > > Or maybe interest in git is slowly dying off ;). > > > > > > Ever hopeful... > > I wish, but from what I've seen that's not happening in the wider world. > I'd easily believe people who start using Fossil end up losing interest > in Git, though. > I only use git when I have to, generally when a project requires submitting pull requests. In that case, I still track my local changes in Fossil. Then I pull the latest into my clone of the git repo, merge the changes into my work space, rebuild, retest abd repeat as needed. Then I commit the "final" changes to my clone and send the pull request. At work, the controls software group uses Fossil "internally", but the company is still "standardized" on SVN (because the IT group's vision is for "thin client" PCs that are fully interchangeable, which doesn't work for my group because we need specialized tool chains that don't "play well" with IT's vision). We use Fossil for our day-to-day work, only committing releases to SVN. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] incorrect user info in export --git
On Sat, Dec 24, 2016 at 12:47:43PM -0800, bch wrote: > On Dec 24, 2016 10:05, "Stephan Beal"wrote: > > On Sat, Dec 24, 2016 at 6:42 PM, Chad Perrin wrote: > > > I hope the lack of responses to my questions was because of the holiday > > season > > > Or maybe interest in git is slowly dying off ;). > > > Ever hopeful... I wish, but from what I've seen that's not happening in the wider world. I'd easily believe people who start using Fossil end up losing interest in Git, though. -- 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
Re: [fossil-users] incorrect user info in export --git
On Dec 24, 2016 10:05, "Stephan Beal"wrote: On Sat, Dec 24, 2016 at 6:42 PM, Chad Perrin wrote: > I hope the lack of responses to my questions was because of the holiday > season Or maybe interest in git is slowly dying off ;). Ever hopeful... -- - stephan beal http://wanderinghorse.net/home/stephan/ "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf ___ 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
Re: [fossil-users] incorrect user info in export --git
On Sat, Dec 24, 2016 at 6:42 PM, Chad Perrinwrote: > I hope the lack of responses to my questions was because of the holiday > season Or maybe interest in git is slowly dying off ;). -- - stephan beal http://wanderinghorse.net/home/stephan/ "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] incorrect user info in export --git
On Sat, Dec 24, 2016 at 09:29:01AM +, Chad Perrin wrote: > On Tue, Dec 20, 2016 at 11:35:46PM +, Chad Perrin 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. > > Is there any reason piping the Fossil export through sed to fix name and > email, then piping the correct result into Git, would not work? I only > ask because it does not seem to work here. I used a sed regex that I > have verified works on a string copied from an unmodified Fossil export, > but for some reason does not work when I actually try to use it by > sticking it between the Fossil export command and the Git import > commands, connected together via pipes. I've confirmed the sed approach works. Borrowing directly from here: https://www.fossil-scm.org/index.html/doc/trunk/www/inout.wiki . . . but simplifed, somewhat, with a sed command in the middle, the end result looks like this: fossil export --git --export-marks ../repo/fossil.marks \ ../repo.fossil | sed \ 's/^\(committer \+\)\([^ ]\+@[^ ]\+\)\( *<\)\(\w\+\)\(>.*\)$/\1\4\3\2\5/' \ | git fast-import --export-marks=../repo/git.marks The regex is a little long. I might try to pare it down slightly, at some point. I'll also try to find time to report an issue with Git export formatting that swaps email and name info, then if I feel *very* ambitious about the time I have available to spend I might also try submitting a patch to close the issue. Don't hold your breath, though; life is crazy, and my to-do list is already long. I hope the lack of responses to my questions was because of the holiday season, because that means you all might be having a good time. -- 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
Re: [fossil-users] incorrect user info in export --git
On Tue, Dec 20, 2016 at 11:35:46PM +, Chad Perrin 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. Is there any reason piping the Fossil export through sed to fix name and email, then piping the correct result into Git, would not work? I only ask because it does not seem to work here. I used a sed regex that I have verified works on a string copied from an unmodified Fossil export, but for some reason does not work when I actually try to use it by sticking it between the Fossil export command and the Git import commands, connected together via pipes. -- 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