Fossil Forum

Forum
Login

Commit changes by fossil web GUI

By peter on 2018-09-18 19:44:24 [link]

Hello,

I am experimenting with recent (2018-09-14) tcl enabled trunk version of fossil and repository having tcl=1, th1-docs=1 and th1-hooks=1 set.

For my colleagues with no way to get shell access I like to provide means to commit changes with commit description message.

In my crude POC, on /tktsetup_com page (TH1 script that initializes variables prior to generating any of the ticket view, edit, or creation pages) I prepend default script with:

tclEval {exec sh -c "/home/usr/repos/wrk/process_repo.sh &" };

In a root of open checkout I place script process_repo.sh with:

#!/bin/bash 
## external scrip to addremove files and possibly commit user originating message
echo `date`   >> /home/usr/repos/wrk/operationlog.log
echo $@       >> /home/usr/repos/wrk/operationlog.log
echo $1       >> /home/usr/repos/wrk/operationlog.log
cd /home/usr/repos/wrk/ && fossil addremove     >> /home/usr/repos/wrk/operationlog.log
cd /home/usr/repos/wrk/ && fossil commit -m 'commit message'  >> /home/usr/repos/wrk/operationlog.log

Now whenever I click on /ticket link it addremove all changes in checkout and commits with static "commit message" message.

I would greatly appreciate suggestions on:

  • how to present user with form to describe current changes in checkout and transfer this message to commit script/command
  • what would be better place/approach to hook execution of external script for addremove and commit action
  • any other ideas how to accomplish this better, perhaps by fossil only means (no external script)

Thanks

By andygoth on 2018-09-22 00:39:28 [link]

Thank you for bringing this up. I have so many ideas on this subject. The central point is to extend the concept of the "ckout" version recognized by /doc and have it show up as a fake version in the timeline against which diffs can be performed. When the "ckout" version is selected using /info, not only will it show all the changes in the checked-out version relative to its baseline, but it will also provide extra buttons to actually check it in, as well as to revert it or add new files or whatever else.

By wyoung on 2018-09-22 01:17:56

This request has come up several times before, so apparently several people want it.

It's sensible, too, no more odd than posting to a blog, forum, or wiki. Fossil is already most of the way to allowing it. It'd probably be easier to do than this forum feature.

Doing it in terms of ckout is a good plan.

I think all we want here is someone with the itch to scratch it. I think the main difficulty in finding the feature's implementor is that the wishes are coming largely from the "I don't write software" camp.

By anonymous on 2018-09-22 01:12:37 [link]

Have considered using fossil via cgi?

Technically you can make fossil do anything from behind the cgi, you can serve forms and pages, and executing fossil commands on the back-end.