Re: [fossil-users] How to make post-commit hook?

2016-10-14 Thread Svyatoslav Mishyn
(Thu, 13 Oct 08:25) Nickolas Lloyd:
> At a cursory glance, it looks like the `fsl' tool would allow you to do
> something similar: just define a new `fsl' command that will do the
> commit, export, and push all in one step.

So, now I just use a function that imitates a post-commit hook.
Not perfect, but it works.

https://f.juef.space/dotfiles/artifact/c164208b86419f679ac644ab8536eb66d96300dd?txt=1=86,115


-- 
I am not a native English speaker,
so feel free to correct any spelling or grammatical errors!


signature.asc
Description: PGP signature
___
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] How to make post-commit hook?

2016-10-13 Thread Nickolas Lloyd
Svyatoslav Mishyn writes:
>> I've put together a python script that is called as a git subcommand and
>> takes care of all of the synchronization under the hood.  Once it's
>> dropped in $GIT_EXEC_PATH I just call `git fossil pull' and `git fossil
>> push trunk' to interact with a fossil remote.
>
> and you call those commands after a commit/set of commits manually..?
Correct.  The local fossil repository is kept within the .git subdir of
the git clone.  The script just manages the details when I want to sync
up with the remote.
Typical usage would be as follows:
repo.git $ git fossil pull # pull in changes from the remote
repo.git $ # hack hack hack...
repo.git $ git commit -a -m "Changed some stuff"
repo.git $ git fossil push trunk

I have this set up to be a separate step rather than having `git fossil
commit' do the `git commit' for me so that I can e.g. keep private
branches, rebase, delete, etc, before merging my work into trunk and
pushing _that_.

At a cursory glance, it looks like the `fsl' tool would allow you to do
something similar: just define a new `fsl' command that will do the
commit, export, and push all in one step.

-Nick
___
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] How to make post-commit hook?

2016-10-12 Thread Svyatoslav Mishyn
(Wed, 12 Oct 13:39) Nickolas Lloyd:
> I've put together a python script that is called as a git subcommand and
> takes care of all of the synchronization under the hood.  Once it's
> dropped in $GIT_EXEC_PATH I just call `git fossil pull' and `git fossil
> push trunk' to interact with a fossil remote.

and you call those commands after a commit/set of commits manually..?


-- 
I am not a native English speaker,
so feel free to correct any spelling or grammatical errors!


signature.asc
Description: PGP signature
___
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] How to make post-commit hook?

2016-10-12 Thread Nickolas Lloyd
Svyatoslav Mishyn writes:
> g2f script syncs changes from git to fossil;
> f2g is a reverse version;
> they are based on this article:
> https://www.fossil-scm.org/index.html/artifact/1e82974b59e2c97c
I've put together a python script that is called as a git subcommand and
takes care of all of the synchronization under the hood.  Once it's
dropped in $GIT_EXEC_PATH I just call `git fossil pull' and `git fossil
push trunk' to interact with a fossil remote.

Does fossil have a similar method of dropping in custom subcommands?
Otherwise it may be better to just provide a wrapper script that invokes
git and fossil for you to achieve the same effect.

-Nick
___
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] How to make post-commit hook?

2016-10-11 Thread Ron W
On Tue, Oct 11, 2016 at 9:26 AM, Svyatoslav Mishyn 
wrote:
>
> as Commit Script I have this:
> tclInvoke catch {exec /home/juef/bin/f2g test}
>
> but it looks like a commit script is executed before commit:
> /home/juef/fossil/test: date >> z && f ci -m f1
> /home/juef/fossil/test: date >> z && f ci -m f2
> /home/juef/fossil/test: date >> z && f ci -m f3
>
> /home/juef/git/mirrors/fossil/test: git --no-pager log -n 3
> --pretty=format:"%s%n"
> f2
> f1
> 11
>

Have you looked at the contents of z in each the 3 most recent commits in
git? Do the changes in the date string in z match what was committed to
Fossil?
___
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] How to make post-commit hook?

2016-10-11 Thread Ron W
On Tue, Oct 11, 2016 at 9:26 AM, Svyatoslav Mishyn 
wrote:
>
> in git repo I have this:
> /home/juef/git/mirrors/fossil/test: cat .git/hooks/post-commit
> #!/bin/sh
>
> fossil_dir=/home/juef/fossil
> repo=test
>
> /home/juef/bin/g2f "$repo"
> cd "${fossil_dir}/${repo}" && fossil co trunk
>

"fossil co trunk" does a Fossil check out, so I don't see how that updates
the Fossil repo with the git commit.
___
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] How to make post-commit hook?

2016-10-11 Thread Joe Mistachkin

Svyatoslav Mishyn wrote:
>
> but it looks like a commit script is executed before commit:
> 

The script specified on the "xfersetup_commit" page should run right
after the database transaction is committed.  However, this will not
necessarily be after each Fossil commit.

Admittedly, the TH1 hooks documentation could stand to be improved.

--
Joe Mistachkin @ https://urn.to/r/mistachkin

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] How to make post-commit hook?

2016-10-11 Thread Svyatoslav Mishyn
Hi all,

I want to automate bidirectional synchronization (Fossil => Git => Fossil).

in git repo I have this:
/home/juef/git/mirrors/fossil/test: cat .git/hooks/post-commit
#!/bin/sh

fossil_dir=/home/juef/fossil
repo=test

/home/juef/bin/g2f "$repo"
cd "${fossil_dir}/${repo}" && fossil co trunk


in fossil repo I've enabled:
tcl and th1-hooks;

as Commit Script I have this:
tclInvoke catch {exec /home/juef/bin/f2g test}

but it looks like a commit script is executed before commit:
/home/juef/fossil/test: date >> z && f ci -m f1
/home/juef/fossil/test: date >> z && f ci -m f2
/home/juef/fossil/test: date >> z && f ci -m f3

/home/juef/git/mirrors/fossil/test: git --no-pager log -n 3 
--pretty=format:"%s%n"
f2
f1
11

on the page /xfersetup Commit has this description:
Specific TH1 code to run after processing a commit.

however on the page /xfersetup_commit it has:
that runs when a commit is processed


Also:
/home/juef/fossil/test: f set tcl
tcl  (local)  1
/home/juef/fossil/test: f test-th-eval 'tclReady'
0


Thanks.


-- 
I am not a native English speaker,
so feel free to correct any spelling or grammatical errors!


signature.asc
Description: PGP signature
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users