Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Source control utility. Diffs and run actions at any change in a directory.

License

webdev23/source_control_sentry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

17 Commits

Repository files navigation

profile for NVRM at Stack Overflow, Q&A for professional and enthusiast programmers

[SCS] Source Control Sentry

Watch for recursive content,ownerships and rights changes.
Backup/Restore files.
Create hard copies and display file differences.
Optionally execute commands, reload a browser tab, at a file change.
Restore files on demand.

Backup files versions, while keeping an eye on the flow.
By default, exclude hidden git files. Exclude vim and nano .swp files. Exclude nohup.out.

By default, without parameters, the program starts to watch the current directory. And display file diffs at a change.

PARAMS:

 -e --exec command
 Execute command (Use quotes if necessary)
 -r --reload program_name
 Refresh program_name (must have F5 capabilities)
 -x --inject js_file
 javascript injection in browser console
 --purge 
 Delete cache
 -b --browse 
 Explore diffs changes and restore files
 

Browse historic and restore files

Browse current DIR historic and restore files.
Those are all changes made in the current DIR, by date, while the current program was running.

cd /mydir && scs -b

Examples:

Reload focused tabs of many browsers, when a file changed.

scs -r firefox -r chromium

Run commands, when a file changed.

scs -e "./mytest.sh"

Inject the content of script.js in the currently focused Firefox tab, when a file changed.

scs -x script.js

Simple run

This is a monolithic script written in php. It will take care to create a hidden backup directory .scs in the home folder.
The following tools are necessary on the system. (Notice scs might verify and update them at the first launch)

sudo apt install php curl xdotool diffutils colordiff wdiff

The simplest usage is to put scs in the target directory and run it:

wget https://webdev23.github.io/source_control_sentry/scs && chmod +x scs && ./scs

Global Installation (Recommended)

To install globally in one command, with all the dependencies and shortcuts, you can use my dedicated tool Ο† phi.

If Ο† phi is not currently installed, do:

php <(curl https://webdev23.github.io/phi/phi) install https://webdev23.github.io/source_control_sentry/scs

If Ο† phi is already there, simply:

phi install https://webdev23.github.io/source_control_sentry/scs

Then, from any directory, start the program:

scs

πŸ’‘ Usage cases

🌐 Web development

Simply reload your browser tab automaticaly. Visualize your css without leaving your editor.

πŸ”§ Automatization and testing

A file change event will trigger the javascript code you wrote, in the browser console.

πŸ” Trace a program

Observe how a program works by viewing the change made in his files in real time.

βœ… Run automagic tests

Write your test scripts, and pass them in the -e param.
Their output are going to be displayed on the scs screen.

πŸš— Compile and run on the fly

For the tasks requiring compilation, simply get the result by just saving your editor.

πŸ”₯ A simple text editor become all what we need

No risks to loose code, rapid debugging. No more code lost with too much CTRL+Z.

😜 Assist development

Keep an eye and quickly remember the changes made across files and line numbers.

About

Source control utility. Diffs and run actions at any change in a directory.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /