autosaved, pronounced autosave-d is a utility written in Go to autosave progress on code projects.

Related tags

Utilities autosaved
Overview

autosaved

autosaved, pronounced autosave-d (for autosave daemon) is a utility written in Go to autosave progress on code projects.

It uses the go-git package to save snapshots without interfering the normal Git flow - branches that are to be pushed upstream, HEAD, or the Git index.

It provides an interface called asdi (short for autosaved interface), which can be used to interact with the daemon.

Installation

You can download a binary from the v0.1 release: https://github.com/nikochiko/autosaved/releases/tag/v0.1 for your architecture and OS

Currently, I have only added 3 binaries for linux/amd64, windows/amd64, and darwin/amd64.

This is because that's what came with gox, which I used to package the release binaries. If you have a darwin/arm or something else, don't fret. It's super easy to build it yourself. I used go 1.17, but it may be compatible with some older versions too. Simply go build to get the binary.

Once you have the binary, you can just mv it to a bin/ folder.

# for example
sudo mv asdi_linux_amd64 /usr/local/bin/asdi

That's all about it. The only other setup now is to start the daemon ;)

Setup

To get it working, you'll have to setup the daemon first. It can be activated with asdi start in any normal terminal, but you may want to run it on systemd or screen to keep it alive through failures and restarts.

Once that's done you're all ready. Just cd into your project directory and run asdi watch, this will notify the daemon to start watching the directory.

It does so by adding the repository's full path to the configuration (by default ~/.autosaved.yaml), which gets picked up by Viper on the fly.

Systemd configuration

A sample systemd unit file can be found here: autosaved.service.

To add it to systemd, you can do the following steps:

wget https://raw.githubusercontent.com/nikochiko/autosaved/main/autosaved.service

# vim/nano/vscode into autosaved.service
# change these two lines to your own username
User=kaustubh # your own pc username
Group=kaustubh # your own pc username

# once that's done, close the editor
# move the service to systemd's home
sudo mv autosaved.service /etc/systemd/system/autosaved.service

# enable and start the service
sudo systemctl enable autosaved.service
sudo systemctl start autosaved.service

# to check whether it's running properly, you can run
sudo systemctl status autosaved.service

Configuration

The configuration too comes with very usable defaults. autosaved will traverse all the watched repositories every 2 minutes by default, although this can be changed. This is defined by the checking_interval config option.

The other option is after_every:, this option defines how long after one commit/autosave should we wait until we autosave the next time in each repository. The minutes and seconds options inside this will get added up. For example, 1 minute and 2 seconds would give 62 seconds as the minimum time to wait before autosaving the same repository.

Finally, the repositories part is how autosaved remembers which repositories to keep an eye on. This may be modified manually or by doing asdi watch in a Git project.

checking_interval: 120
after_every:
    minutes: 2
    seconds: 0
repositories:
    - /home/kaustubh/Desktop/projects/autosaved

Commands

  • asdi start: starts the daemon. the daemon has to run for automatic saving to work
  • asdi stop: stops the daemon. other processes can find the daemon's PID by using the lockfile. Graceful exit of the daemon should be done by sending SIGTERM to the process.
  • asdi save: manually saves progress in a repository. this may be useful when you are not using the daemon, or when you are too impatient to wait for its next cycle.
  • asdi restore : this restores the changes from a checkpoint committed by autosaved. the checkpoints stay outside the main refs, and don't interfere with the staging index or current branch. their names start with _asd_ so that in an alphabetical list of branches, you can scroll down and find relevant information.
  • asdi watch: start watching a file path. this will add the repository's path to the config file. If the daemon is active, it won't need a restart to pick this up.
  • asdi list : shows N (by default, 10) max commits starting from HEAD. It will show the commits made by user more widely, and then the autosave commits that were made on top of that commit will be displayed like bullet points and numbered so it is easy to make sense of the list.

Recovery

To recover something, you can grab its commit hash from asdi list and run asdi restore .

I have done it in this video here: https://www.youtube.com/watch?v=VFgLyTNwHu4

Screenshots

  • Listing image

LICENSE

This project is licensed under GPLv3. See LICENSE for more.

Issues
  • Move config to $XDG_CONFIG_HOME..

    Move config to $XDG_CONFIG_HOME..

    .. which defaults to $HOME/.config.

    How are you making a new app IN 2022(!) and yet make this mistake of supporting the pollution of the home folder with endless dotfiles is beyond me

    Great app though, I was brought here by those google suggestions at new tab

    good first issue 
    opened by necauqua 2
  • Fix #5: Move config to $XDG_CONFIG_HOME if it exist

    Fix #5: Move config to $XDG_CONFIG_HOME if it exist

    to solve the issue https://github.com/nikochiko/autosaved/issues/5

    opened by kmollee 2
  • New autosaves happen when autosave branch is already up to date

    New autosaves happen when autosave branch is already up to date

    This happened few times. Should look if there is a bug somewhere or just side effects of an older version

    opened by nikochiko 1
  • New command: `autosaved unwatch`

    New command: `autosaved unwatch`

    null

    opened by nikochiko 0
  • Cleanup output of `autosaved list`

    Cleanup output of `autosaved list`

    Sometimes, there will be a "Autosaves:" but no commits inside the section.

    opened by nikochiko 0
  • Fix #9: Cleanup `autosaved list` UI

    Fix #9: Cleanup `autosaved list` UI

    null

    opened by nikochiko 0
  • Move config to $XDG_CONFIG_HOME if it exist

    Move config to $XDG_CONFIG_HOME if it exist

    to solve the issue https://github.com/nikochiko/autosaved/issues/5

    opened by kmollee 0
  • Restyle Fix: default config directory should be consistent to $HOME/.config

    Restyle Fix: default config directory should be consistent to $HOME/.config

    A duplicate of #13 with additional commits that automatically address incorrect style, created by Restyled.

    :warning: Even though this PR is not a Fork, it contains outside contributions. Please review accordingly.

    Since the original Pull Request was opened as a fork in a contributor's repository, we are unable to create a Pull Request branching from it with only the style fixes.

    The following Restylers made fixes:

    To incorporate these changes, you can either:

    1. Merge this Pull Request instead of the original, or

    2. Ask your contributor to locally incorporate these commits and push them to the original Pull Request

      Expand for example instructions
      ```console
      git remote add upstream https://github.com/nikochiko/autosaved.git
      git fetch upstream pull/<this PR number>/head
      git merge --ff-only FETCH_HEAD
      git push
      ```
      

    NOTE: As work continues on the original Pull Request, this process will re-run and update (force-push) this Pull Request with updated style fixes as necessary. If the style is fixed manually at any point (i.e. this process finds no fixes to make), this Pull Request will be closed automatically.

    Sorry if this was unexpected. To disable it, see our documentation.

    opened by restyled-io[bot] 0
  • Restyle Update documentation about default config path

    Restyle Update documentation about default config path

    A duplicate of #15 with additional commits that automatically address incorrect style, created by Restyled.

    :warning: Even though this PR is not a Fork, it contains outside contributions. Please review accordingly.

    Since the original Pull Request was opened as a fork in a contributor's repository, we are unable to create a Pull Request branching from it with only the style fixes.

    The following Restylers made fixes:

    To incorporate these changes, you can either:

    1. Merge this Pull Request instead of the original, or

    2. Ask your contributor to locally incorporate these commits and push them to the original Pull Request

      Expand for example instructions
      ```console
      git remote add upstream https://github.com/nikochiko/autosaved.git
      git fetch upstream pull/<this PR number>/head
      git merge --ff-only FETCH_HEAD
      git push
      ```
      

    NOTE: As work continues on the original Pull Request, this process will re-run and update (force-push) this Pull Request with updated style fixes as necessary. If the style is fixed manually at any point (i.e. this process finds no fixes to make), this Pull Request will be closed automatically.

    Sorry if this was unexpected. To disable it, see our documentation.

    opened by restyled-io[bot] 0
  • Update documentation about default config path

    Update documentation about default config path

    Update readme's default config from ~/.autosaved.yaml to ~/.config/.autosaved.yaml

    opened by kmollee 0
  • Fix: default config directory should be consistent to $HOME/.config

    Fix: default config directory should be consistent to $HOME/.config

    Default dirctory might be $HOME/.config or $HOME/ if first one is not exist, that might caused confusion for users.

    opened by kmollee 3
  • Feature addition to restore: `autosaved restore --paths dir/file1 dir/file2 <commit-hash>`

    Feature addition to restore: `autosaved restore --paths dir/file1 dir/file2 `

    Only restore the given paths. Recently ran into this need when I made some change to a file that I later thought I wanted to revert. This feature may help in cases like these.

    I am putting this on low priority. If some other people also think there is a need for this then comment or react with a thumbs up on this issue.

    opened by nikochiko 11
  • New command: `autosaved cleanup`

    New command: `autosaved cleanup`

    It may become a nuisance to see too many branches in the list. We can configure autosaved to delete autosave branches that are either older than x hours or not in the last x commits.

    opened by nikochiko 0
  • Clarify configuration names

    Clarify configuration names

    The configuration names are confusing (checking_interval and after_every), do something to polish that so that it is easier to get the correct idea from the config file

    opened by nikochiko 0
  • Web UI?

    Web UI?

    I am trying to keep it as lightweight as possible, but if a Web UI will allow people to have better visibility on their Git structure, we should consider that.

    opened by nikochiko 0
  • Look into inotify for listening to fs events

    Look into inotify for listening to fs events

    opened by nikochiko 0
Releases(v0.2)
Owner
Kaustubh Maske Patil
Your friendly neighbourhood FOSS guy. Google Code-in 2019 Winner.
Kaustubh Maske Patil
A lightweight casting package for Go projects

Cast GoLobby Cast is a lightweight casting package for Go projects. Documentation Required Go Versions It requires Go v1.11 or newer versions. Install

GoLobby 7 Nov 1, 2021
Clean-Swift source and test code auto-generator. It can save you time typing 500-600 lines of code.

Clean-Swift source & test code auto generator Overview Run Output Basic Usage make config.yaml target_project_name: Miro // target project name copyri

David Ha 17 Dec 14, 2021
Code generator that generates boilerplate code for a go http server

http-bootstrapper This is a code generator that uses go templates to generate a bootstrap code for a go http server. Usage Generate go http server cod

Jijo Thomas John 1 Nov 20, 2021
A super simple Lodash like utility library with essential functions that empowers the development in Go

A simple Utility library for Go Go does not provide many essential built in functions when it comes to the data structure such as slice and map. This

Rahul Baruri 103 Jan 10, 2022
Robust & Easy to use struct mapper and utility methods for Go

go-model Robust & Easy to use model mapper and utility methods for Go struct. Typical methods increase productivity and make Go development more fun ?

Jeevanandam M. 334 Jan 20, 2022
gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools.

gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools. Table of Contents Introduction

Bytedance Inc. 470 Jan 15, 2022
Utility to add network config file in apk

Utility to add network config file in apk. Which bypass the proxy intercept restriction for user installed burpsuit CA certificate.

dwij patel 3 May 11, 2021
Small utility to allow simpler, quicker testing of parsing files in crowdsec

cs_parser_test Small utility to allow simpler, quicker testing of parsing files in crowdsec Usage $ sudo cs_parser_test -t syslog /var/log/mail.log N

david reid 3 Jul 13, 2021
sigbypass4xx is a utility to automate well-know techniques used to bypass access control restrictions.

sigbypass4xx sigbypass4xx is a utility to automate well-know techniques used to bypass access control restrictions. Resources Usage Installation From

Signed Security 9 Dec 20, 2021
Utility functions for work with the Kubernetes Go-Client

go-k8s-utils This repository contains utils for the work with Kubernetes, in specific with the go-client library. Testing This package contains utils

Christoph Stäbler 0 Dec 17, 2021
Scylla-octopus is a backup and maintenance utility for scylladb.

scylla-octopus: a scylladb backup utility Scylla-octopus is a backup and maintenance utility for scylladb. It attempts to reproduce some functionality

Kolesa Group 18 Dec 20, 2021
A Go utility to convert Go example tests into jupyter notebooks.

go2colab Scientists (my main project's users) love jupyter notebook tutorials pkg.dev.go's runnable playground doesn't support file IO but I love exam

Tim 2 Nov 8, 2021
Simple utility to get/set the PWM duty cycle and to measure the RPM for a fan connected to the 4-pin header on the CM4IO.

cm4iofan Simple utility to get/set the PWM duty cycle and to measure the RPM for a fan connected to the 4-pin header on the CM4IO. Requirements Enable

Thomas Maier 4 Jan 7, 2022
Envoy utility to process envoy config for fast development and debugging.

envoyconf-tools Envoy is a proxy, really awesome and we are devs who often use it, face errors and struggle to debug it, when envoy config's source is

VOrishirne 3 Oct 31, 2021
A utility library to do files/io/bytes processing/parsing in file-system or network.

goreader A utility library to do files/io/bytes processing/parsing in file-system or network. These features are really common to be implemented for a

VOrishirne 4 Nov 1, 2021
Utility to restrict which package is allowed to import another package.

go-import-rules Utility to restrict which package is allowed to import another package. This tool will read import-rules.yaml or import-rules.yml in t

PAYFAZZ 0 Jan 7, 2022
The utility that created for easily database and their tables rolling up

The utility that created for easily database and their tables rolling up

null 0 Nov 6, 2021
A funny utility to manage your PS1 variable.

PSOne Introduction Are you a Veteran Unix Admin? If so, you probably know the charm of the PS1 environment variable. For a deep focus I suggest you to

Alessio Greggi 4 Jan 14, 2022
A small utility to extract your Telegram contacts as VCF file.

Telegram to VCF A small utility to extract your Telegram contacts as VCF file. Usage At first build this application or use the precompiled binaries o

Hirbod Behnam 3 Jan 11, 2022